From b2aa1c7939ec3d7f0598e220c44947fe9fd81e3d Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=B8rgen=20Lind?= Date: Fri, 27 May 2011 02:12:02 -0700 Subject: [PATCH] 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 Reviewed-by: Paul Olav Tvete --- .../wayland/gl_integration/wayland_egl/qwaylandglcontext.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 72ad5a8..0f27501 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 -- 2.7.4