Title: [135648] trunk/Source/WebKit/qt
Revision
135648
Author
[email protected]
Date
2012-11-24 06:41:09 -0800 (Sat, 24 Nov 2012)

Log Message

[Qt] Make sure the QGLWidget context is current when creating the TextureMapper.
https://bugs.webkit.org/show_bug.cgi?id=103142

When creating the TextureMapperGL for WK1 we have to make sure
that the GL context provided by the QGLWidget is current.
Otherwise the GraphicsContext3DQt created by TextureMapperGL will pick up
the wrong pointer by calling QOpenGLContext::currentContext().

Reviewed by Kenneth Rohde Christiansen.

* WebCoreSupport/PageClientQt.cpp:
(WebCore::PageClientQGraphicsWidget::setRootGraphicsLayer):

Modified Paths

Diff

Modified: trunk/Source/WebKit/qt/ChangeLog (135647 => 135648)


--- trunk/Source/WebKit/qt/ChangeLog	2012-11-24 11:28:31 UTC (rev 135647)
+++ trunk/Source/WebKit/qt/ChangeLog	2012-11-24 14:41:09 UTC (rev 135648)
@@ -1,3 +1,18 @@
+2012-11-24  Zeno Albisser  <[email protected]>
+
+        [Qt] Make sure the QGLWidget context is current when creating the TextureMapper.
+        https://bugs.webkit.org/show_bug.cgi?id=103142
+
+        When creating the TextureMapperGL for WK1 we have to make sure
+        that the GL context provided by the QGLWidget is current.
+        Otherwise the GraphicsContext3DQt created by TextureMapperGL will pick up
+        the wrong pointer by calling QOpenGLContext::currentContext().
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        * WebCoreSupport/PageClientQt.cpp:
+        (WebCore::PageClientQGraphicsWidget::setRootGraphicsLayer):
+
 2012-11-23  Sheriff Bot  <[email protected]>
 
         Unreviewed, rolling out r135575.

Modified: trunk/Source/WebKit/qt/WebCoreSupport/PageClientQt.cpp (135647 => 135648)


--- trunk/Source/WebKit/qt/WebCoreSupport/PageClientQt.cpp	2012-11-24 11:28:31 UTC (rev 135647)
+++ trunk/Source/WebKit/qt/WebCoreSupport/PageClientQt.cpp	2012-11-24 14:41:09 UTC (rev 135648)
@@ -284,9 +284,14 @@
         TextureMapperLayerClient = adoptPtr(new TextureMapperLayerClientQt(page->mainFrame(), layer));
 #if USE(TEXTURE_MAPPER_GL)
         QGraphicsView* graphicsView = view->scene()->views()[0];
-        if (graphicsView && graphicsView->viewport() && graphicsView->viewport()->inherits("QGLWidget")) {
-            TextureMapperLayerClient->setTextureMapper(TextureMapper::create(TextureMapper::OpenGLMode));
-            return;
+        if (graphicsView && graphicsView->viewport()) {
+            QGLWidget* glWidget = qobject_cast<QGLWidget*>(graphicsView->viewport());
+            if (glWidget) {
+                // The GL context belonging to the QGLWidget viewport must be current when TextureMapper is being created.
+                glWidget->makeCurrent();
+                TextureMapperLayerClient->setTextureMapper(TextureMapper::create(TextureMapper::OpenGLMode));
+                return;
+            }
         }
 #endif
         TextureMapperLayerClient->setTextureMapper(TextureMapper::create());
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to