summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/qnx/qqnxglcontext.cpp
diff options
context:
space:
mode:
authorBernd Weimer <bweimer@blackberry.com>2014-02-21 17:37:11 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-28 22:57:26 +0100
commite2d21a0483530d3d306a9f3505834b71f84236fb (patch)
treea989ed8dec033b23f1c417ca9486498eab266225 /src/plugins/platforms/qnx/qqnxglcontext.cpp
parent58b928aca8029a4ebc63b0120a7afb93db4e8691 (diff)
QNX: Report if GL context is shared
This fixes the tst_qopengl sharedResourceCleanup auto test Change-Id: I0ac6f45797f656b637254f01c2cb8073436b45b2 Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com> Reviewed-by: Fabian Bumberger <fbumberger@rim.com> Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Diffstat (limited to 'src/plugins/platforms/qnx/qqnxglcontext.cpp')
-rw-r--r--src/plugins/platforms/qnx/qqnxglcontext.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/plugins/platforms/qnx/qqnxglcontext.cpp b/src/plugins/platforms/qnx/qqnxglcontext.cpp
index 3a365be408..23db7f09f3 100644
--- a/src/plugins/platforms/qnx/qqnxglcontext.cpp
+++ b/src/plugins/platforms/qnx/qqnxglcontext.cpp
@@ -124,15 +124,11 @@ QQnxGLContext::QQnxGLContext(QOpenGLContext *glContext)
if (m_eglConfig == 0)
qFatal("QQnxGLContext: failed to find EGL config");
- EGLContext shareContext = EGL_NO_CONTEXT;
- if (m_glContext) {
- QQnxGLContext *qshareContext = dynamic_cast<QQnxGLContext*>(m_glContext->shareHandle());
- if (qshareContext) {
- shareContext = qshareContext->m_eglContext;
- }
- }
+ QQnxGLContext *glShareContext = static_cast<QQnxGLContext*>(m_glContext->shareHandle());
+ m_eglShareContext = glShareContext ? glShareContext->m_eglContext : EGL_NO_CONTEXT;
- m_eglContext = eglCreateContext(ms_eglDisplay, m_eglConfig, shareContext, contextAttrs(format));
+ m_eglContext = eglCreateContext(ms_eglDisplay, m_eglConfig, m_eglShareContext,
+ contextAttrs(format));
if (m_eglContext == EGL_NO_CONTEXT) {
checkEGLError("eglCreateContext");
qFatal("QQnxGLContext: failed to create EGL context, err=%d", eglGetError());
@@ -271,6 +267,11 @@ QFunctionPointer QQnxGLContext::getProcAddress(const QByteArray &procName)
return static_cast<QFunctionPointer>(eglGetProcAddress(procName.constData()));
}
+bool QQnxGLContext::isSharing() const
+{
+ return m_eglShareContext != EGL_NO_CONTEXT;
+}
+
EGLDisplay QQnxGLContext::getEglDisplay() {
return ms_eglDisplay;
}