summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/eglconvenience
diff options
context:
space:
mode:
authorReuben Dowle <reuben.dowle@navico.com>2011-09-19 11:04:48 (GMT)
committerSamuel Rødal <samuel.rodal@nokia.com>2011-09-19 11:04:48 (GMT)
commit035a05e498568cacbc53017d6f7ee6691c050edb (patch)
tree09edc63fd5e12f79357933c7759c7bda34f9456f /src/plugins/platforms/eglconvenience
parent5eb449ddc0d9f5019082daf6804a048f88ff39c7 (diff)
downloadQt-035a05e498568cacbc53017d6f7ee6691c050edb.zip
Qt-035a05e498568cacbc53017d6f7ee6691c050edb.tar.gz
Qt-035a05e498568cacbc53017d6f7ee6691c050edb.tar.bz2
Allow generic EGL platform contexts to be shared
Merge-request: 1331 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src/plugins/platforms/eglconvenience')
-rw-r--r--src/plugins/platforms/eglconvenience/qeglplatformcontext.cpp5
-rw-r--r--src/plugins/platforms/eglconvenience/qeglplatformcontext.h2
2 files changed, 4 insertions, 3 deletions
diff --git a/src/plugins/platforms/eglconvenience/qeglplatformcontext.cpp b/src/plugins/platforms/eglconvenience/qeglplatformcontext.cpp
index 4d1d63e..d733cd6 100644
--- a/src/plugins/platforms/eglconvenience/qeglplatformcontext.cpp
+++ b/src/plugins/platforms/eglconvenience/qeglplatformcontext.cpp
@@ -48,7 +48,7 @@
#include <EGL/egl.h>
-QEGLPlatformContext::QEGLPlatformContext(EGLDisplay display, EGLConfig config, EGLint contextAttrs[], EGLSurface surface, EGLenum eglApi)
+QEGLPlatformContext::QEGLPlatformContext(EGLDisplay display, EGLConfig config, EGLint contextAttrs[], EGLSurface surface, EGLenum eglApi, QEGLPlatformContext *shareContext)
: QPlatformGLContext()
, m_eglDisplay(display)
, m_eglSurface(surface)
@@ -59,7 +59,8 @@ QEGLPlatformContext::QEGLPlatformContext(EGLDisplay display, EGLConfig config, E
}
eglBindAPI(m_eglApi);
- m_eglContext = eglCreateContext(m_eglDisplay,config, 0,contextAttrs);
+ EGLContext shareEglContext = shareContext ? shareContext->eglContext() : 0;
+ m_eglContext = eglCreateContext(m_eglDisplay,config, shareEglContext, contextAttrs);
if (m_eglContext == EGL_NO_CONTEXT) {
qWarning("Could not create the egl context\n");
eglTerminate(m_eglDisplay);
diff --git a/src/plugins/platforms/eglconvenience/qeglplatformcontext.h b/src/plugins/platforms/eglconvenience/qeglplatformcontext.h
index 9be1480..614b3cb 100644
--- a/src/plugins/platforms/eglconvenience/qeglplatformcontext.h
+++ b/src/plugins/platforms/eglconvenience/qeglplatformcontext.h
@@ -48,7 +48,7 @@
class QEGLPlatformContext : public QPlatformGLContext
{
public:
- QEGLPlatformContext(EGLDisplay display, EGLConfig config, EGLint contextAttrs[], EGLSurface surface, EGLenum eglApi);
+ QEGLPlatformContext(EGLDisplay display, EGLConfig config, EGLint contextAttrs[], EGLSurface surface, EGLenum eglApi, QEGLPlatformContext *shareContext = 0);
~QEGLPlatformContext();
void makeCurrent();