Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qandroidplatformopenglwindow.h
Go to the documentation of this file.
1// Copyright (C) 2014 BogDan Vatra <bogdan@kde.org>
2// Copyright (C) 2016 The Qt Company Ltd.
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
5#ifndef QANDROIDPLATFORMOPENGLWINDOW_H
6#define QANDROIDPLATFORMOPENGLWINDOW_H
7
10
11#include <QWaitCondition>
12#include <QtCore/qjnienvironment.h>
13#include <QtCore/qjniobject.h>
14
15#include <EGL/egl.h>
16
18
20{
21public:
24
25 void setGeometry(const QRect &rect) override;
26 EGLSurface eglSurface(EGLConfig config);
27 QSurfaceFormat format() const override;
28
29 bool checkNativeSurface(EGLConfig config);
30
32
33 void repaint(const QRegion &region) override;
34
35protected:
36 void surfaceChanged(JNIEnv *jniEnv, jobject surface, int w, int h) override;
37 void createEgl(EGLConfig config);
38 void clearEgl();
39
40private:
41 EGLDisplay m_eglDisplay = EGL_NO_DISPLAY;
42 EGLSurface m_eglSurface = EGL_NO_SURFACE;
43 EGLNativeWindowType m_nativeWindow = nullptr;
44
45 int m_nativeSurfaceId = -1;
46 QJniObject m_androidSurfaceObject;
47 QWaitCondition m_surfaceWaitCondition;
48 QSurfaceFormat m_format;
49 QRect m_oldGeometry;
50};
51
53#endif // QANDROIDPLATFORMOPENGLWINDOW_H
void repaint(const QRegion &region) override
void applicationStateChanged(Qt::ApplicationState) override
EGLSurface eglSurface(EGLConfig config)
void surfaceChanged(JNIEnv *jniEnv, jobject surface, int w, int h) override
void setGeometry(const QRect &rect) override
This function is called by Qt whenever a window is moved or resized using the QWindow API.
QSurfaceFormat format() const override
Returns the actual surface format of the window.
\inmodule QtCore
QSurface * surface() const
QWindow * window() const
Returns the window which belongs to the QPlatformWindow.
\inmodule QtCore\reentrant
Definition qrect.h:30
The QRegion class specifies a clip region for a painter.
Definition qregion.h:27
The QSurfaceFormat class represents the format of a QSurface. \inmodule QtGui.
\inmodule QtGui
Definition qwindow.h:63
rect
[4]
struct wl_display * display
Definition linuxdmabuf.h:41
Combined button and popup list for selecting options.
ApplicationState
Definition qnamespace.h:261
EGLConfig config
typedef EGLSurface(EGLAPIENTRYP PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC)(EGLDisplay dpy
typedef EGLDisplay(EGLAPIENTRYP PFNEGLGETPLATFORMDISPLAYEXTPROC)(EGLenum platform
GLfloat GLfloat GLfloat w
[0]
GLfloat GLfloat GLfloat GLfloat h