From 19d730890eba9da7bdccc2fbc8407bffd622311e Mon Sep 17 00:00:00 2001 From: Michael Dominic K Date: Wed, 7 Jul 2010 09:20:00 +0200 Subject: Actually do use the properties parameter in ::createSurface for x11egl. --- src/gui/egl/qegl_x11.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/gui/egl/qegl_x11.cpp b/src/gui/egl/qegl_x11.cpp index fb9ee9d..bf79ec7 100644 --- a/src/gui/egl/qegl_x11.cpp +++ b/src/gui/egl/qegl_x11.cpp @@ -330,10 +330,8 @@ void qt_set_winid_on_widget(QWidget* w, Qt::HANDLE id) // NOTE: The X11 version of createSurface will re-create the native drawable if it's visual doesn't // match the one for the passed in EGLConfig -EGLSurface QEgl::createSurface(QPaintDevice *device, EGLConfig config, const QEglProperties *unusedProperties) +EGLSurface QEgl::createSurface(QPaintDevice *device, EGLConfig config, const QEglProperties *properties) { - Q_UNUSED(unusedProperties); - int devType = device->devType(); if (devType == QInternal::Pbuffer) { @@ -417,7 +415,12 @@ EGLSurface QEgl::createSurface(QPaintDevice *device, EGLConfig config, const QEg // At this point, the widget's window should be created and have the correct visual. Now we // just need to create the EGL surface for it: - EGLSurface surf = eglCreateWindowSurface(QEgl::display(), config, (EGLNativeWindowType)widget->winId(), 0); + const int *props; + if (properties) + props = properties->properties(); + else + props = 0; + EGLSurface surf = eglCreateWindowSurface(QEgl::display(), config, (EGLNativeWindowType)widget->winId(), props); if (surf == EGL_NO_SURFACE) qWarning("QEglContext::createSurface(): Unable to create EGL surface, error = 0x%x", eglGetError()); return surf; -- cgit v0.12 From ed4906de38f3421549ed2d71e3725bbe286f24ce Mon Sep 17 00:00:00 2001 From: Michael Dominic K Date: Fri, 1 Apr 2011 10:02:35 +0200 Subject: QGLContext on EGL gets an additional QEglProperties static field applied to every window surface created. Conflicts: src/opengl/qgl_egl.cpp src/opengl/qgl_p.h --- src/opengl/qgl_egl.cpp | 7 +++++++ src/opengl/qgl_p.h | 3 +++ src/opengl/qgl_x11egl.cpp | 3 ++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/opengl/qgl_egl.cpp b/src/opengl/qgl_egl.cpp index d6b2d3b..ef36eb9 100644 --- a/src/opengl/qgl_egl.cpp +++ b/src/opengl/qgl_egl.cpp @@ -52,6 +52,8 @@ QT_BEGIN_NAMESPACE +QEglProperties *QGLContextPrivate::extraWindowSurfaceCreationProps = NULL; + void qt_eglproperties_set_glformat(QEglProperties& eglProperties, const QGLFormat& glFormat) { int redSize = glFormat.redBufferSize(); @@ -309,6 +311,11 @@ void QGLContextPrivate::swapRegion(const QRegion ®ion) eglContext->swapBuffersRegion2NOK(eglSurfaceForDevice(), ®ion); } +void QGLContextPrivate::setExtraWindowSurfaceCreationProps(QEglProperties *props) +{ + extraWindowSurfaceCreationProps = props; +} + void QGLWidget::setMouseTracking(bool enable) { QWidget::setMouseTracking(enable); diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h index b2261a2..0bdd6e3 100644 --- a/src/opengl/qgl_p.h +++ b/src/opengl/qgl_p.h @@ -369,11 +369,14 @@ public: EGLSurface eglSurface; void destroyEglSurfaceForDevice(); EGLSurface eglSurfaceForDevice() const; + static QEglProperties *extraWindowSurfaceCreationProps; + static void setExtraWindowSurfaceCreationProps(QEglProperties *props); #endif #if defined(Q_WS_QPA) QPlatformGLContext *platformContext; void setupSharing(); + #elif defined(Q_WS_X11) || defined(Q_WS_MAC) void* cx; #endif diff --git a/src/opengl/qgl_x11egl.cpp b/src/opengl/qgl_x11egl.cpp index 93f17ae..5755067 100644 --- a/src/opengl/qgl_x11egl.cpp +++ b/src/opengl/qgl_x11egl.cpp @@ -232,7 +232,8 @@ bool QGLContext::chooseContext(const QGLContext* shareContext) if (devType == QInternal::Widget) { if (d->eglSurface != EGL_NO_SURFACE) eglDestroySurface(d->eglContext->display(), d->eglSurface); - d->eglSurface = QEgl::createSurface(device(), d->eglContext->config()); + // extraWindowSurfaceCreationProps default to NULL unless were specifically set before + d->eglSurface = QEgl::createSurface(device(), d->eglContext->config(), d->extraWindowSurfaceCreationProps); XFlush(X11->display); setWindowCreated(true); } -- cgit v0.12