summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@nokia.com>2011-10-07 12:21:59 (GMT)
committerLiang Qi <liang.qi@nokia.com>2011-10-07 12:21:59 (GMT)
commit7cf9030bd7a50b6d98d454510417c6ecc3f33d49 (patch)
tree7c5c562ba490e217d8cef81ff1fd5958a0cacccb /src/opengl
parent7f3cd2949ccb16b1b611c05bf6ab7274cf04a0f8 (diff)
parent96fcfc720aa1c6d0b6d741f8169cd37ea9fcd9a9 (diff)
downloadQt-7cf9030bd7a50b6d98d454510417c6ecc3f33d49.zip
Qt-7cf9030bd7a50b6d98d454510417c6ecc3f33d49.tar.gz
Qt-7cf9030bd7a50b6d98d454510417c6ecc3f33d49.tar.bz2
Merge remote-tracking branch 'origin/4.7' into qt-4.8-from-4.7
Conflicts: doc/src/getting-started/installation.qdoc doc/src/platforms/platform-notes.qdoc src/corelib/tools/qlocale_symbian.cpp src/gui/kernel/qwidget_p.h src/network/access/qnetworkaccesshttpbackend.cpp src/opengl/qgl.cpp src/plugins/bearer/symbian/qnetworksession_impl.cpp
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/qgl.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index cedccaa..423fa08 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -103,6 +103,7 @@
#ifdef Q_OS_SYMBIAN
#include <private/qgltexturepool_p.h>
+#include <private/qeglcontext_p.h>
#endif
// #define QT_GL_CONTEXT_RESOURCE_DEBUG
@@ -3432,8 +3433,25 @@ const QGLContext* QGLContext::currentContext()
return 0;
#else
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;
#endif //Q_WS_QPA
}