diff options
author | Liang Qi <liang.qi@nokia.com> | 2011-10-07 14:21:59 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@nokia.com> | 2011-10-07 14:21:59 +0200 |
commit | 7cf9030bd7a50b6d98d454510417c6ecc3f33d49 (patch) | |
tree | 7c5c562ba490e217d8cef81ff1fd5958a0cacccb /src/opengl/qgl.cpp | |
parent | 7f3cd2949ccb16b1b611c05bf6ab7274cf04a0f8 (diff) | |
parent | 96fcfc720aa1c6d0b6d741f8169cd37ea9fcd9a9 (diff) | |
download | qt4-tools-7cf9030bd7a50b6d98d454510417c6ecc3f33d49.tar.gz |
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/qgl.cpp')
-rw-r--r-- | src/opengl/qgl.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index cedccaa69b..423fa08a1f 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 } |