Title: [135996] trunk/Source/WebCore
Revision
135996
Author
[email protected]
Date
2012-11-28 04:07:50 -0800 (Wed, 28 Nov 2012)

Log Message

GraphicsSurface: Implement usage of GraphicsSurface for WebGL in WK1.
https://bugs.webkit.org/show_bug.cgi?id=103497

This is a temporary workaround for an issue with GraphicsSurfaceMac.
GraphicsSurfaceMac is currently implemented using CGL only.
CGL does not allow us to properly restore the NSView a context was made current with.
Therefore we have to go through QOpenGLContext to ensure the context
is being restored correctly.
As soon as we are updating GraphicsSurfaceMac to use NSOpenGL,
we should revert this patch.

Reviewed by Simon Hausmann.

* platform/graphics/qt/GraphicsContext3DQt.cpp:
(WebCore::GraphicsContext3DPrivate::paintToTextureMapper):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (135995 => 135996)


--- trunk/Source/WebCore/ChangeLog	2012-11-28 12:07:27 UTC (rev 135995)
+++ trunk/Source/WebCore/ChangeLog	2012-11-28 12:07:50 UTC (rev 135996)
@@ -3,6 +3,24 @@
         GraphicsSurface: Implement usage of GraphicsSurface for WebGL in WK1.
         https://bugs.webkit.org/show_bug.cgi?id=103497
 
+        This is a temporary workaround for an issue with GraphicsSurfaceMac.
+        GraphicsSurfaceMac is currently implemented using CGL only.
+        CGL does not allow us to properly restore the NSView a context was made current with.
+        Therefore we have to go through QOpenGLContext to ensure the context
+        is being restored correctly.
+        As soon as we are updating GraphicsSurfaceMac to use NSOpenGL,
+        we should revert this patch.
+
+        Reviewed by Simon Hausmann.
+
+        * platform/graphics/qt/GraphicsContext3DQt.cpp:
+        (WebCore::GraphicsContext3DPrivate::paintToTextureMapper):
+
+2012-11-28  Zeno Albisser  <[email protected]>
+
+        GraphicsSurface: Implement usage of GraphicsSurface for WebGL in WK1.
+        https://bugs.webkit.org/show_bug.cgi?id=103497
+
         Using GraphicsSurface for WebGL in WK1 allows us to share
         the code with the WK2 implementation.
 

Modified: trunk/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp (135995 => 135996)


--- trunk/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp	2012-11-28 12:07:27 UTC (rev 135995)
+++ trunk/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp	2012-11-28 12:07:50 UTC (rev 135996)
@@ -213,8 +213,21 @@
     blitMultisampleFramebufferAndRestoreContext();
 
     if (textureMapper->accelerationMode() == TextureMapper::OpenGLMode) {
+
+        // CGL only provides us the context, but not the view the context is currently bound to.
+        // To make sure the context is bound the the right surface we have to do a makeCurrent through QOpenGL again.
+        // FIXME: Remove this code as soon as GraphicsSurfaceMac makes use of NSOpenGL.
+        QOpenGLContext* currentContext = QOpenGLContext::currentContext();
+        QSurface* currentSurface = currentContext->surface();
+        makeCurrentIfNeeded();
+
         m_graphicsSurface->copyFromTexture(m_context->m_texture, IntRect(0, 0, m_context->m_currentWidth, m_context->m_currentHeight));
 
+        // CGL only provides us the context, but not the view the context is currently bound to.
+        // To make sure the context is bound the the right surface we have to do a makeCurrent through QOpenGL again.
+        // FIXME: Remove this code as soon as GraphicsSurfaceMac makes use of NSOpenGL.
+        currentContext->makeCurrent(currentSurface);
+
         TextureMapperGL* texmapGL = static_cast<TextureMapperGL*>(textureMapper);
         m_graphicsSurface->paintToTextureMapper(texmapGL, targetRect, matrix, opacity, mask);
         return;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to