summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
authorTom Cooksey <thomas.cooksey@nokia.com>2010-04-16 09:50:55 (GMT)
committerTom Cooksey <thomas.cooksey@nokia.com>2010-04-16 12:52:13 (GMT)
commit74f28819d985984170964d12d8f527034db93017 (patch)
tree6c1650f2c0b2cbd70d79e55de8f8edf20107d093 /src/opengl
parent5480e3b68da98253ae6ec58bd0db0075225a4e22 (diff)
downloadQt-74f28819d985984170964d12d8f527034db93017.zip
Qt-74f28819d985984170964d12d8f527034db93017.tar.gz
Qt-74f28819d985984170964d12d8f527034db93017.tar.bz2
Set EGL_SWAP_BEHAVIOR to EGL_BUFFER_PRESERVED for regular QWidgets
QGLWidgets are assumed to be buffer destroyed, however regular QWidgets assume they can to partial updates and thus need the preserved swap behaviour. Reviewed-By: Trond Task-number: QTBUG-9554
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/qgl_x11egl.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/opengl/qgl_x11egl.cpp b/src/opengl/qgl_x11egl.cpp
index 6f210ce..d67a3ea 100644
--- a/src/opengl/qgl_x11egl.cpp
+++ b/src/opengl/qgl_x11egl.cpp
@@ -199,6 +199,10 @@ bool QGLContext::chooseContext(const QGLContext* shareContext)
configProps.setRenderableType(QEgl::OpenGL);
qt_eglproperties_set_glformat(configProps, d->glFormat);
+ // Set buffer preserved for regular QWidgets, QGLWidgets are ok with either preserved or destroyed:
+ if ((devType == QInternal::Widget) && qobject_cast<QGLWidget*>(static_cast<QWidget*>(device())) == 0)
+ configProps.setValue(EGL_SWAP_BEHAVIOR, EGL_BUFFER_PRESERVED);
+
if (!d->eglContext->chooseConfig(configProps, QEgl::BestPixelFormat)) {
delete d->eglContext;
d->eglContext = 0;