5package org.qtproject.qt.android;
7import android.annotation.SuppressLint;
8import android.content.Context;
9import android.graphics.PixelFormat;
10import android.view.Surface;
11import android.view.SurfaceHolder;
12import android.view.SurfaceView;
14@SuppressLint(
"ViewConstructor")
15class QtSurface extends SurfaceView implements SurfaceHolder.Callback
17 private QtSurfaceInterface m_surfaceCallback;
19 public QtSurface(Context
context, QtSurfaceInterface surfaceCallback,
boolean onTop,
int imageDepth)
23 setFocusableInTouchMode(
false);
24 setZOrderMediaOverlay(
onTop);
25 m_surfaceCallback = surfaceCallback;
26 getHolder().addCallback(
this);
28 getHolder().setFormat(PixelFormat.RGB_565);
30 getHolder().setFormat(PixelFormat.RGBA_8888);
34 public void surfaceCreated(SurfaceHolder holder)
39 public void surfaceChanged(SurfaceHolder holder,
int format,
int width,
int height)
43 if (m_surfaceCallback !=
null)
44 m_surfaceCallback.onSurfaceChanged(holder.getSurface());
48 public void surfaceDestroyed(SurfaceHolder holder)
50 if (m_surfaceCallback !=
null)
51 m_surfaceCallback.onSurfaceChanged(
null);
GLint GLsizei GLsizei height
GLint GLsizei GLsizei GLenum format
static bool onTop(QWaylandQuickShellSurfaceItem *surf)