12#include <QSurfaceFormat>
13#include <QtGui/private/qwindow_p.h>
14#include <QtGui/qguiapplication.h>
16#include <QtGui/private/qeglconvenience_p.h>
17#include <android/native_window.h>
18#include <android/native_window_jni.h>
19#include <qpa/qplatformscreen.h>
20#include <qpa/qwindowsysteminterface.h>
31 m_surfaceWaitCondition.
wakeOne();
33 if (m_nativeSurfaceId != -1)
50 QRect dirtyRegion(currentGeometry.
left() + dirtyClient.
left(),
51 currentGeometry.
top() + dirtyClient.
top(),
54 QRect mOldGeometryLocal = m_oldGeometry;
55 m_oldGeometry = currentGeometry;
57 if (mOldGeometryLocal != currentGeometry)
70 if (m_nativeSurfaceId != -1)
76 && availableGeometry.
width() > 0
77 && availableGeometry.
height() > 0) {
92 if (m_nativeSurfaceId == -1) {
102 if (m_eglSurface == EGL_NO_SURFACE) {
113 if (m_nativeSurfaceId == -1 || !m_androidSurfaceObject.isValid())
130 if (m_nativeSurfaceId != -1) {
132 m_nativeSurfaceId = -1;
143 m_nativeWindow = ANativeWindow_fromSurface(env.jniEnv(), m_androidSurfaceObject.object());
145 m_eglSurface = eglCreateWindowSurface(m_eglDisplay,
config, m_nativeWindow, NULL);
147 if (
Q_UNLIKELY(m_eglSurface == EGL_NO_SURFACE)) {
148 EGLint
error = eglGetError();
149 eglTerminate(m_eglDisplay);
150 qFatal(
"EGL Error : Could not create the egl surface: error = 0x%x\n",
error);
156 if (m_nativeWindow == 0)
157 return window()->requestedFormat();
164 if (m_eglSurface != EGL_NO_SURFACE) {
165 eglMakeCurrent(m_eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
166 eglDestroySurface(m_eglDisplay, m_eglSurface);
167 m_eglSurface = EGL_NO_SURFACE;
170 if (m_nativeWindow) {
171 ANativeWindow_release(m_nativeWindow);
183 m_androidSurfaceObject =
surface;
185 m_surfaceWaitCondition.
wakeOne();
static Qt::ApplicationState applicationState()
void unlock() noexcept
Unlocks the mutex.
void lock() noexcept
Locks the mutex.
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
constexpr int height() const noexcept
Returns the height of the rectangle.
constexpr QPoint topLeft() const noexcept
Returns the position of the rectangle's top-left corner.
constexpr int top() const noexcept
Returns the y-coordinate of the rectangle's top edge.
constexpr int left() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr int width() const noexcept
Returns the width of the rectangle.
The QRegion class specifies a clip region for a painter.
QRect boundingRect() const noexcept
Returns the bounding rectangle of this region.
bool wait(QMutex *, QDeadlineTimer=QDeadlineTimer(QDeadlineTimer::Forever))
static bool handleExposeEvent(QWindow *window, const QRegion ®ion)
struct wl_display * display
Combined button and popup list for selecting options.
void destroySurface(int surfaceId)
void setSurfaceGeometry(int surfaceId, const QRect &geometry)
int createSurface(AndroidSurfaceClient *client, const QRect &geometry, bool onTop, int imageDepth)
DBusConnection const char DBusError * error
QSurfaceFormat q_glFormatFromConfig(EGLDisplay display, const EGLConfig config, const QSurfaceFormat &referenceFormat)
typedef EGLSurface(EGLAPIENTRYP PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC)(EGLDisplay dpy
typedef EGLDisplay(EGLAPIENTRYP PFNEGLGETPLATFORMDISPLAYEXTPROC)(EGLenum platform
GLfloat GLfloat GLfloat w
[0]
GLint GLsizei GLsizei height
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLfloat GLfloat GLfloat GLfloat h
Q_GUI_EXPORT QWindowPrivate * qt_window_private(QWindow *window)