Title: [137467] trunk/Source
Revision
137467
Author
[email protected]
Date
2012-12-12 07:55:45 -0800 (Wed, 12 Dec 2012)

Log Message

[EFL [WebGL] [Wk2] Resizing the canvas breaks WebGL.
https://bugs.webkit.org/show_bug.cgi?id=104535.

Patch by Kondapally Kalyan <[email protected]> on 2012-12-12
Reviewed by Kenneth Rohde Christiansen.

GraphicsContext3DEfl does not re-create the surface on canvas resize, this
conflicted with the logic in coordinated graphics Layer.
CoordinatedGraphicsLayer checks for GraphicsSurfaceToken to decide if the surface
in UI-Process should be recreated or not. With this
patch we also check for size of the platform Layer.

Source/WebCore:

* platform/graphics/efl/GraphicsContext3DEfl.cpp:
(WebCore::GraphicsContext3D::createGraphicsSurfaces):
* platform/graphics/efl/GraphicsContext3DPrivate.cpp:
(GraphicsContext3DPrivate::didResizeCanvas):
(GraphicsContext3DPrivate::platformLayerSize):
* platform/graphics/efl/GraphicsContext3DPrivate.h:
(GraphicsContext3DPrivate):

Source/WebKit2:

* WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::setContentsToCanvas):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.h:
(CoordinatedGraphicsLayer):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (137466 => 137467)


--- trunk/Source/WebCore/ChangeLog	2012-12-12 15:54:20 UTC (rev 137466)
+++ trunk/Source/WebCore/ChangeLog	2012-12-12 15:55:45 UTC (rev 137467)
@@ -1,3 +1,24 @@
+2012-12-12  Kondapally Kalyan  <[email protected]>
+
+        [EFL [WebGL] [Wk2] Resizing the canvas breaks WebGL.
+        https://bugs.webkit.org/show_bug.cgi?id=104535.
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        GraphicsContext3DEfl does not re-create the surface on canvas resize, this
+        conflicted with the logic in coordinated graphics Layer.
+        CoordinatedGraphicsLayer checks for GraphicsSurfaceToken to decide if the surface
+        in UI-Process should be recreated or not. With this
+        patch we also check for size of the platform Layer.
+
+        * platform/graphics/efl/GraphicsContext3DEfl.cpp:
+        (WebCore::GraphicsContext3D::createGraphicsSurfaces):
+        * platform/graphics/efl/GraphicsContext3DPrivate.cpp:
+        (GraphicsContext3DPrivate::didResizeCanvas):
+        (GraphicsContext3DPrivate::platformLayerSize):
+        * platform/graphics/efl/GraphicsContext3DPrivate.h:
+        (GraphicsContext3DPrivate):
+
 2012-12-12  Antoine Quint  <[email protected]>
 
         Web Inspector: Crash in InspectorDOMAgent::pushNodePathToFrontend when inspecting document with CSS generated content

Modified: trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DEfl.cpp (137466 => 137467)


--- trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DEfl.cpp	2012-12-12 15:54:20 UTC (rev 137466)
+++ trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DEfl.cpp	2012-12-12 15:55:45 UTC (rev 137467)
@@ -231,9 +231,9 @@
 }
 
 #if USE(GRAPHICS_SURFACE)
-void GraphicsContext3D::createGraphicsSurfaces(const IntSize&)
+void GraphicsContext3D::createGraphicsSurfaces(const IntSize& size)
 {
-    m_private->didResizeCanvas();
+    m_private->didResizeCanvas(size);
 }
 #endif
 

Modified: trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.cpp (137466 => 137467)


--- trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.cpp	2012-12-12 15:54:20 UTC (rev 137466)
+++ trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.cpp	2012-12-12 15:55:45 UTC (rev 137467)
@@ -123,9 +123,10 @@
 #endif
 
 #if USE(GRAPHICS_SURFACE)
-void GraphicsContext3DPrivate::didResizeCanvas()
+void GraphicsContext3DPrivate::didResizeCanvas(const IntSize& size)
 {
     m_pendingSurfaceResize = true;
+    m_size = size;
 }
 
 uint32_t GraphicsContext3DPrivate::copyToGraphicsSurface()
@@ -173,8 +174,9 @@
 
 IntSize GraphicsContext3DPrivate::platformLayerSize() const
 {
-    return IntSize(m_context->m_currentWidth, m_context->m_currentHeight);
+    return m_size;
 }
+
 #endif
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.h (137466 => 137467)


--- trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.h	2012-12-12 15:54:20 UTC (rev 137466)
+++ trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.h	2012-12-12 15:55:45 UTC (rev 137467)
@@ -57,7 +57,7 @@
     virtual IntSize platformLayerSize() const;
     virtual uint32_t copyToGraphicsSurface();
     virtual GraphicsSurfaceToken graphicsSurfaceToken() const;
-    void didResizeCanvas();
+    void didResizeCanvas(const IntSize&);
 #endif
     bool makeContextCurrent();
     void releaseResources();
@@ -72,6 +72,7 @@
     OwnPtr<GraphicsContext3D::ContextLostCallback> m_contextLostCallback;
     ListHashSet<GC3Denum> m_syntheticErrors;
     bool m_pendingSurfaceResize;
+    IntSize m_size;
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebKit2/ChangeLog (137466 => 137467)


--- trunk/Source/WebKit2/ChangeLog	2012-12-12 15:54:20 UTC (rev 137466)
+++ trunk/Source/WebKit2/ChangeLog	2012-12-12 15:55:45 UTC (rev 137467)
@@ -1,3 +1,21 @@
+2012-12-12  Kondapally Kalyan  <[email protected]>
+
+        [EFL [WebGL] [Wk2] Resizing the canvas breaks WebGL.
+        https://bugs.webkit.org/show_bug.cgi?id=104535.
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        GraphicsContext3DEfl does not re-create the surface on canvas resize, this
+        conflicted with the logic in coordinated graphics Layer.
+        CoordinatedGraphicsLayer checks for GraphicsSurfaceToken to decide if the surface
+        in UI-Process should be recreated or not. With this
+        patch we also check for size of the platform Layer.
+
+        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp:
+        (WebCore::CoordinatedGraphicsLayer::setContentsToCanvas):
+        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.h:
+        (CoordinatedGraphicsLayer):
+
 2012-12-12  Sheriff Bot  <[email protected]>
 
         Unreviewed, rolling out r137438.

Modified: trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp (137466 => 137467)


--- trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp	2012-12-12 15:54:20 UTC (rev 137466)
+++ trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp	2012-12-12 15:55:45 UTC (rev 137467)
@@ -328,7 +328,7 @@
         ASSERT(m_canvasToken.isValid());
         if (!platformLayer)
             m_canvasNeedsDestroy = true;
-        else if (m_canvasToken != platformLayer->graphicsSurfaceToken()) {
+        else if ((m_canvasSize != platformLayer->platformLayerSize()) || (m_canvasToken != platformLayer->graphicsSurfaceToken())) {
             // m_canvasToken can be different to platformLayer->graphicsSurfaceToken(), even if m_canvasPlatformLayer equals platformLayer.
             m_canvasNeedsDestroy = true;
             m_canvasNeedsCreate = true;
@@ -340,6 +340,7 @@
 
     m_canvasPlatformLayer = platformLayer;
     // m_canvasToken is updated only here. In detail, when GraphicsContext3D is changed or reshaped, m_canvasToken is changed and setContentsToCanvas() is always called.
+    m_canvasSize = m_canvasPlatformLayer ? m_canvasPlatformLayer->platformLayerSize() : IntSize();
     m_canvasToken = m_canvasPlatformLayer ? m_canvasPlatformLayer->graphicsSurfaceToken() : GraphicsSurfaceToken();
     ASSERT(!(!m_canvasToken.isValid() && m_canvasPlatformLayer));
     if (m_canvasPlatformLayer)

Modified: trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.h (137466 => 137467)


--- trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.h	2012-12-12 15:54:20 UTC (rev 137466)
+++ trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.h	2012-12-12 15:55:45 UTC (rev 137467)
@@ -240,6 +240,7 @@
 
     PlatformLayer* m_canvasPlatformLayer;
 #if USE(GRAPHICS_SURFACE)
+    IntSize m_canvasSize;
     GraphicsSurfaceToken m_canvasToken;
 #endif
     Timer<CoordinatedGraphicsLayer> m_animationStartedTimer;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to