Title: [131164] trunk/Source/WebCore
Revision
131164
Author
zeno.albis...@digia.com
Date
2012-10-12 02:36:54 -0700 (Fri, 12 Oct 2012)

Log Message

[Qt][WK2] GraphicsSurfaceGLX should keep track of previous GL context.
https://bugs.webkit.org/show_bug.cgi?id=99076

In GraphicsSurfaceGLX/GraphicsSurfacePrivate we create a new
QOpenGLContext for resolving GL methods.
This context is implicitly made current on creation.
Therefore we need to keep track of the previously bound context
and make that one current again after calling create.

Reviewed by Kenneth Rohde Christiansen.

* platform/graphics/surfaces/qt/GraphicsSurfaceGLX.cpp:
(WebCore::GraphicsSurfacePrivate::GraphicsSurfacePrivate):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (131163 => 131164)


--- trunk/Source/WebCore/ChangeLog	2012-10-12 09:36:36 UTC (rev 131163)
+++ trunk/Source/WebCore/ChangeLog	2012-10-12 09:36:54 UTC (rev 131164)
@@ -1,3 +1,19 @@
+2012-10-12  Zeno Albisser  <z...@webkit.org>
+
+        [Qt][WK2] GraphicsSurfaceGLX should keep track of previous GL context.
+        https://bugs.webkit.org/show_bug.cgi?id=99076
+
+        In GraphicsSurfaceGLX/GraphicsSurfacePrivate we create a new
+        QOpenGLContext for resolving GL methods.
+        This context is implicitly made current on creation.
+        Therefore we need to keep track of the previously bound context
+        and make that one current again after calling create.
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        * platform/graphics/surfaces/qt/GraphicsSurfaceGLX.cpp:
+        (WebCore::GraphicsSurfacePrivate::GraphicsSurfacePrivate):
+
 2012-10-12  Balazs Kelemen  <kbal...@webkit.org>
 
         Unreviewed, rolling out r130389.

Modified: trunk/Source/WebCore/platform/graphics/surfaces/qt/GraphicsSurfaceGLX.cpp (131163 => 131164)


--- trunk/Source/WebCore/platform/graphics/surfaces/qt/GraphicsSurfaceGLX.cpp	2012-10-12 09:36:36 UTC (rev 131163)
+++ trunk/Source/WebCore/platform/graphics/surfaces/qt/GraphicsSurfaceGLX.cpp	2012-10-12 09:36:54 UTC (rev 131164)
@@ -107,8 +107,18 @@
         , m_textureIsYInverted(false)
         , m_hasAlpha(false)
     {
+        QSurface* currentSurface = 0;
+        QOpenGLContext* currentContext = QOpenGLContext::currentContext();
+        if (currentContext)
+            currentSurface = currentContext->surface();
+
         m_display = XOpenDisplay(0);
         m_glContext->create();
+
+        // The GLX implementation of QOpenGLContext will reset the current context when create is being called.
+        // Therefore we have to make the previous context current again.
+        if (currentContext)
+            currentContext->makeCurrent(currentSurface);
     }
 
     ~GraphicsSurfacePrivate()
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to