diff options
Diffstat (limited to 'src/plugins/platforms/qnx/qqnxglcontext.cpp')
-rw-r--r-- | src/plugins/platforms/qnx/qqnxglcontext.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/plugins/platforms/qnx/qqnxglcontext.cpp b/src/plugins/platforms/qnx/qqnxglcontext.cpp index 355f52c46e..34e8150928 100644 --- a/src/plugins/platforms/qnx/qqnxglcontext.cpp +++ b/src/plugins/platforms/qnx/qqnxglcontext.cpp @@ -124,7 +124,15 @@ QQnxGLContext::QQnxGLContext(QOpenGLContext *glContext) if (m_eglConfig == 0) qFatal("QQnxGLContext: failed to find EGL config"); - m_eglContext = eglCreateContext(ms_eglDisplay, m_eglConfig, EGL_NO_CONTEXT, contextAttrs()); + EGLContext shareContext = EGL_NO_CONTEXT; + if (m_glContext) { + QQnxGLContext *qshareContext = dynamic_cast<QQnxGLContext*>(m_glContext->shareHandle()); + if (qshareContext) { + shareContext = qshareContext->m_eglContext; + } + } + + m_eglContext = eglCreateContext(ms_eglDisplay, m_eglConfig, shareContext, contextAttrs()); if (m_eglContext == EGL_NO_CONTEXT) { checkEGLError("eglCreateContext"); qFatal("QQnxGLContext: failed to create EGL context, err=%d", eglGetError()); |