summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@nokia.com>2011-05-27 02:12:02 -0700
committerQt by Nokia <qt-info@nokia.com>2011-07-06 12:03:30 +0200
commit5d9818e7b61ca47a1566ba15baed647879d9dcda (patch)
treec9b5ec34089b771454e425b286a19b97f2cf97e1 /src/plugins
parent1b1337601e40da73cfb7ad463b3651070130268e (diff)
We need to let the currentContext be in the same state after
setting the new eglsurface (cherry picked from commit af3efefeefe686e5c35ed502de077c0bcb6f6fc0) Change-Id: Ic1d62b21a1482d1bc7f1d99478e175e4b767e157 Reviewed-on: http://codereview.qt.nokia.com/1209 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandglcontext.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandglcontext.cpp b/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandglcontext.cpp
index 72ad5a8b6a..0f27501c71 100644
--- a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandglcontext.cpp
+++ b/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandglcontext.cpp
@@ -115,8 +115,15 @@ void *QWaylandGLContext::getProcAddress(const QString &string)
void QWaylandGLContext::setEglSurface(EGLSurface surface)
{
- doneCurrent();
+ bool wasCurrent = false;
+ if (QPlatformGLContext::currentContext() == this) {
+ wasCurrent = true;
+ doneCurrent();
+ }
mSurface = surface;
+ if (wasCurrent) {
+ makeCurrent();
+ }
}
EGLConfig QWaylandGLContext::eglConfig() const