13#if defined(QQNXEGLWINDOW_DEBUG)
14#define qEglWindowDebug qDebug
16#define qEglWindowDebug QT_NO_QDEBUG_MACRO
23 m_newSurfaceRequested(true),
24 m_eglDisplay(EGL_NO_DISPLAY),
25 m_eglSurface(EGL_NO_SURFACE)
40 return m_eglSurface != EGL_NO_SURFACE;
49 if (m_requestedBufferSize !=
bufferSize() || m_eglSurface == EGL_NO_SURFACE) {
50 if (m_eglSurface != EGL_NO_SURFACE) {
65 qFatal(
"QQnxEglWindow: renderable type is not OpenGLES");
70 int usage = SCREEN_USAGE_OPENGL_ES2;
71#if _SCREEN_VERSION >= _SCREEN_MAKE_VERSION(1, 0, 0)
72 if (
context->format().majorVersion() == 3)
73 usage |= SCREEN_USAGE_OPENGL_ES3;
78 qFatal(
"QQnxEglWindow: failed to set window usage, errno=%d", errno);
80 if (!m_requestedBufferSize.
isValid()) {
81 qWarning(
"QQNX: Trying to create 0 size EGL surface. "
82 "Please set a valid window size before calling QOpenGLContext::makeCurrent()");
86 m_eglDisplay =
context->eglDisplay();
87 m_eglConfig =
context->eglConfig();
93 const EGLint eglSurfaceAttrs[] =
95 EGL_RENDER_BUFFER, EGL_BACK_BUFFER,
103 EGLSurface eglSurface = eglCreateWindowSurface(
109 if (eglSurface == EGL_NO_SURFACE)
110 qWarning(
"QQNX: failed to create EGL surface, err=%d", eglGetError());
112 m_eglSurface = eglSurface;
115void QQnxEglWindow::destroyEGLSurface()
118 if (m_eglSurface != EGL_NO_SURFACE) {
119 EGLBoolean eglResult = eglDestroySurface(m_eglDisplay, m_eglSurface);
121 qFatal(
"QQNX: failed to destroy EGL surface, err=%d", eglGetError());
124 m_eglSurface = EGL_NO_SURFACE;
144 m_requestedBufferSize = newGeometry.
size();
156 qFatal(
"QQnxWindow: red size not defined");
160 qFatal(
"QQnxWindow: green size not defined");
164 qFatal(
"QQnxWindow: blue size not defined");
167 if (redSize == 5 && greenSize == 6 && blueSize == 5)
168 return SCREEN_FORMAT_RGB565;
169 else if (redSize == 8 && greenSize == 8 && blueSize == 8)
170 return SCREEN_FORMAT_RGBA8888;
172 qFatal(
"QQnxWindow: unsupported pixel format");
177 m_requestedBufferSize =
QSize();
bool testAndSetOrdered(T expectedValue, T newValue) noexcept
bool testAndSetRelease(T expectedValue, T newValue) noexcept
bool isInitialized() const
void resetBuffers() override
int pixelFormat() const override
EGLSurface surface() const
void ensureInitialized(QQnxGLContext *context)
QQnxEglWindow(QWindow *window, screen_context_t context, bool needRootWindow)
void setGeometry(const QRect &rect) override
This function is called by Qt whenever a window is moved or resized using the QWindow API.
The QQnxWindow is the base class of the various classes used as instances of QPlatformWindow in the Q...
bool shouldMakeFullScreen() const
screen_window_t nativeHandle() const
void setBufferSize(const QSize &size)
QPlatformScreen * screen() const override
Returns the platform screen handle corresponding to this platform window, or null if the window is no...
void setGeometry(const QRect &rect) override
This function is called by Qt whenever a window is moved or resized using the QWindow API.
\inmodule QtCore\reentrant
constexpr QSize size() const noexcept
Returns the size of the rectangle.
constexpr bool isValid() const noexcept
Returns true if both the width and height is equal to or greater than 0; otherwise returns false.
SurfaceType surfaceType() const override
Returns the surface type of the window.
Combined button and popup list for selecting options.
typedef EGLBoolean(EGLAPIENTRYP PFNEGLQUERYDEVICESEXTPROC)(EGLint max_devices
typedef EGLSurface(EGLAPIENTRYP PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC)(EGLDisplay dpy
GLsizeiptr const void GLenum usage