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