summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-10-06 06:13:29 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-10-06 06:13:29 (GMT)
commit96fcfc720aa1c6d0b6d741f8169cd37ea9fcd9a9 (patch)
tree76f92ee4e003fb838c1a00b0900d7df8296282f2
parent117e27d4f24e686d66f8333dd69e55f16fe6a5d3 (diff)
parentdde0a87329a9e48f82c16c383a42ce42c5422351 (diff)
downloadQt-96fcfc720aa1c6d0b6d741f8169cd37ea9fcd9a9.zip
Qt-96fcfc720aa1c6d0b6d741f8169cd37ea9fcd9a9.tar.gz
Qt-96fcfc720aa1c6d0b6d741f8169cd37ea9fcd9a9.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public: Do not let QGLContext get out of sync when doing mixed VG-GL rendering
-rw-r--r--src/opengl/qgl.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 161e099..ca16cca 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -95,9 +95,9 @@
#ifdef Q_OS_SYMBIAN
#include <private/qgltexturepool_p.h>
+#include <private/qeglcontext_p.h>
#endif
-
QT_BEGIN_NAMESPACE
#if defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)
@@ -3426,8 +3426,25 @@ void QGLContext::setInitialized(bool on)
const QGLContext* QGLContext::currentContext()
{
QGLThreadContext *threadContext = qgl_context_storage.localData();
- if (threadContext)
+ if (threadContext) {
+#ifdef Q_OS_SYMBIAN
+ // Query the current context and return null if it is different.
+ // This is needed to support mixed VG-GL rendering.
+ // QtOpenVG is free to make a QEglContext current at any time and
+ // QGLContext gets no notification that its underlying QEglContext is
+ // not current anymore. We query directly from EGL to be thread-safe.
+ // QEglContext does not store all the contexts per-thread.
+ if (threadContext->context) {
+ QEglContext *eglcontext = threadContext->context->d_func()->eglContext;
+ if (eglcontext) {
+ EGLContext ctx = eglcontext->context();
+ if (ctx != eglGetCurrentContext())
+ return 0;
+ }
+ }
+#endif
return threadContext->context;
+ }
return 0;
}