diff options
author | Michael Dominic K <mdk@codethink.co.uk> | 2011-04-01 08:02:35 (GMT) |
---|---|---|
committer | Jørgen Lind <jorgen.lind@nokia.com> | 2011-04-01 08:04:00 (GMT) |
commit | ed4906de38f3421549ed2d71e3725bbe286f24ce (patch) | |
tree | 011071c5785c425f61fbc733359716480c8ad594 /src/opengl | |
parent | 19d730890eba9da7bdccc2fbc8407bffd622311e (diff) | |
download | Qt-ed4906de38f3421549ed2d71e3725bbe286f24ce.zip Qt-ed4906de38f3421549ed2d71e3725bbe286f24ce.tar.gz Qt-ed4906de38f3421549ed2d71e3725bbe286f24ce.tar.bz2 |
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
Diffstat (limited to 'src/opengl')
-rw-r--r-- | src/opengl/qgl_egl.cpp | 7 | ||||
-rw-r--r-- | src/opengl/qgl_p.h | 3 | ||||
-rw-r--r-- | src/opengl/qgl_x11egl.cpp | 3 |
3 files changed, 12 insertions, 1 deletions
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); } |