summaryrefslogtreecommitdiffstats
path: root/src/opengl/qgl_symbian.cpp
diff options
context:
space:
mode:
authorJani Hautakangas <jani.hautakangas@nokia.com>2011-03-22 09:03:13 (GMT)
committerJani Hautakangas <jani.hautakangas@nokia.com>2011-03-22 09:46:25 (GMT)
commit48c5a020c6ad6ee5ef1721d422f10bbc40dd1557 (patch)
tree2efc4cf4ab3fb56cc5f989aa65167f60cdf35798 /src/opengl/qgl_symbian.cpp
parentde4bd221124e0a133858839b4b824165a9eb7dff (diff)
downloadQt-48c5a020c6ad6ee5ef1721d422f10bbc40dd1557.zip
Qt-48c5a020c6ad6ee5ef1721d422f10bbc40dd1557.tar.gz
Qt-48c5a020c6ad6ee5ef1721d422f10bbc40dd1557.tar.bz2
Change Symbian to use destroyed swap behaviour in GL
Destroyed swap behaviour is a little bit faster than preserved swap with heavily animated UIs like QML. Task-number: QTBUG-18270 Reviewed-by: Samuel Rødal
Diffstat (limited to 'src/opengl/qgl_symbian.cpp')
-rw-r--r--src/opengl/qgl_symbian.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/opengl/qgl_symbian.cpp b/src/opengl/qgl_symbian.cpp
index 78624a2..7caaabd 100644
--- a/src/opengl/qgl_symbian.cpp
+++ b/src/opengl/qgl_symbian.cpp
@@ -228,13 +228,20 @@ bool QGLContext::chooseContext(const QGLContext* shareContext) // almost same as
d->eglSurface = QEgl::createSurface(device(), d->eglContext->config());
-#if !defined(QGL_NO_PRESERVED_SWAP)
- eglGetError(); // Clear error state first.
- eglSurfaceAttrib(QEgl::display(), d->eglSurface,
- EGL_SWAP_BEHAVIOR, EGL_BUFFER_PRESERVED);
- if (eglGetError() != EGL_SUCCESS) {
- qWarning("QGLContext: could not enable preserved swap");
- }
+ eglGetError(); // Clear error state first.
+
+#ifdef QGL_NO_PRESERVED_SWAP
+ eglSurfaceAttrib(QEgl::display(), d->eglSurface,
+ EGL_SWAP_BEHAVIOR, EGL_BUFFER_DESTROYED);
+
+ if (eglGetError() != EGL_SUCCESS)
+ qWarning("QGLContext: could not enable destroyed swap behaviour");
+#else
+ eglSurfaceAttrib(QEgl::display(), d->eglSurface,
+ EGL_SWAP_BEHAVIOR, EGL_BUFFER_PRESERVED);
+
+ if (eglGetError() != EGL_SUCCESS)
+ qWarning("QGLContext: could not enable preserved swap behaviour");
#endif
setWindowCreated(true);