19 m_newSurfaceRequested(true),
20 m_eglDisplay(EGL_NO_DISPLAY),
21 m_eglSurface(EGL_NO_SURFACE)
36 return m_eglSurface != EGL_NO_SURFACE;
45 if (m_requestedBufferSize !=
bufferSize() || m_eglSurface == EGL_NO_SURFACE) {
46 if (m_eglSurface != EGL_NO_SURFACE) {
61 qFatal(
"QQnxEglWindow: renderable type is not OpenGLES");
66 int usage = SCREEN_USAGE_OPENGL_ES2;
67#if _SCREEN_VERSION >= _SCREEN_MAKE_VERSION(1, 0, 0)
68 if (
context->format().majorVersion() == 3)
69 usage |= SCREEN_USAGE_OPENGL_ES3;
74 qFatal(
"QQnxEglWindow: failed to set window usage, errno=%d", errno);
76 if (!m_requestedBufferSize.
isValid()) {
77 qWarning(
"QQNX: Trying to create 0 size EGL surface. "
78 "Please set a valid window size before calling QOpenGLContext::makeCurrent()");
82 m_eglDisplay =
context->eglDisplay();
83 m_eglConfig =
context->eglConfig();
89 const EGLint eglSurfaceAttrs[] =
91 EGL_RENDER_BUFFER, EGL_BACK_BUFFER,
95 qCDebug(lcQpaWindowEgl) <<
"Creating EGL surface from" <<
this <<
context
99 EGLSurface eglSurface = eglCreateWindowSurface(
105 if (eglSurface == EGL_NO_SURFACE)
106 qWarning(
"QQNX: failed to create EGL surface, err=%d", eglGetError());
108 m_eglSurface = eglSurface;
111void QQnxEglWindow::destroyEGLSurface()
114 if (m_eglSurface != EGL_NO_SURFACE) {
115 EGLBoolean eglResult = eglDestroySurface(m_eglDisplay, m_eglSurface);
117 qFatal(
"QQNX: failed to destroy EGL surface, err=%d", eglGetError());
120 m_eglSurface = EGL_NO_SURFACE;
140 m_requestedBufferSize = newGeometry.
size();
152 qFatal(
"QQnxWindow: red size not defined");
156 qFatal(
"QQnxWindow: green size not defined");
160 qFatal(
"QQnxWindow: blue size not defined");
163 if (redSize == 5 && greenSize == 6 && blueSize == 5)
164 return SCREEN_FORMAT_RGB565;
165 else if (redSize == 8 && greenSize == 8 && blueSize == 8)
166 return SCREEN_FORMAT_RGBA8888;
168 qFatal(
"QQnxWindow: unsupported pixel format");
173 m_requestedBufferSize =
QSize();
bool testAndSetOrdered(T expectedValue, T newValue) noexcept
bool testAndSetRelease(T expectedValue, T newValue) noexcept
bool isInitialized() const
void resetBuffers() override
QQnxEglWindow(QWindow *window, screen_context_t context, bool needRootWindow)
int pixelFormat() const override
EGLSurface surface() const
void ensureInitialized(QQnxGLContext *context)
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
#define Q_LOGGING_CATEGORY(name,...)
#define qCDebug(category,...)
GLsizeiptr const void GLenum usage