summaryrefslogtreecommitdiffstats
path: root/src/gui/egl
diff options
context:
space:
mode:
authorDavid Boddie <dboddie@trolltech.com>2009-12-04 16:00:13 (GMT)
committerDavid Boddie <dboddie@trolltech.com>2009-12-04 16:00:13 (GMT)
commit0ec20e4fdd70dc11df5932ea2c282efce21dee15 (patch)
tree7387b1db111bb0930e6e01c0b405112a0b317343 /src/gui/egl
parent8577da4a70be7400b1dc7d2265a31de46f8e8bb9 (diff)
parent33441e2a611f07207b0b942368aab9010cdf8ab1 (diff)
downloadQt-0ec20e4fdd70dc11df5932ea2c282efce21dee15.zip
Qt-0ec20e4fdd70dc11df5932ea2c282efce21dee15.tar.gz
Qt-0ec20e4fdd70dc11df5932ea2c282efce21dee15.tar.bz2
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.6
Diffstat (limited to 'src/gui/egl')
-rw-r--r--src/gui/egl/qegl.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gui/egl/qegl.cpp b/src/gui/egl/qegl.cpp
index c0e4890..cf28dc4 100644
--- a/src/gui/egl/qegl.cpp
+++ b/src/gui/egl/qegl.cpp
@@ -236,6 +236,18 @@ bool QEglContext::makeCurrent(EGLSurface surface)
currentSurface = surface;
setCurrentContext(apiType, this);
+ // Force the right API to be bound before making the context current.
+ // The EGL implementation should be able to figure this out from ctx,
+ // but some systems require the API to be explicitly set anyway.
+#ifdef EGL_OPENGL_ES_API
+ if (apiType == QEgl::OpenGL)
+ eglBindAPI(EGL_OPENGL_ES_API);
+#endif
+#ifdef EGL_OPENVG_API
+ if (apiType == QEgl::OpenVG)
+ eglBindAPI(EGL_OPENVG_API);
+#endif
+
bool ok = eglMakeCurrent(dpy, surface, surface, ctx);
if (!ok)
qWarning() << "QEglContext::makeCurrent():" << errorString(eglGetError());