Title: [95114] trunk/Source/WebCore
Revision
95114
Author
[email protected]
Date
2011-09-14 13:12:19 -0700 (Wed, 14 Sep 2011)

Log Message

[skia] fast/canvas/setWidthResetAfterForcedRender is flaky
https://bugs.webkit.org/show_bug.cgi?id=67955

Reviewed by Stephen White.

When destroying an ImageBuffer due to a canvas resize, we weren't clearing the texture ID on the layer,
resulting in future compositor draw calls binding an invalid texture.  This results in the test failing and
possibly drawing from a bad texture.

Covered by fast/canvas/setWidthResetAfterForcedRender.html in the GPU configuration.

* platform/graphics/chromium/Canvas2DLayerChromium.cpp:
(WebCore::Canvas2DLayerChromium::drawsContent)
* platform/graphics/skia/ImageBufferSkia.cpp:
(WebCore::ImageBuffer::~ImageBuffer):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (95113 => 95114)


--- trunk/Source/WebCore/ChangeLog	2011-09-14 20:05:19 UTC (rev 95113)
+++ trunk/Source/WebCore/ChangeLog	2011-09-14 20:12:19 UTC (rev 95114)
@@ -1,3 +1,21 @@
+2011-09-14  James Robinson  <[email protected]>
+
+        [skia] fast/canvas/setWidthResetAfterForcedRender is flaky
+        https://bugs.webkit.org/show_bug.cgi?id=67955
+
+        Reviewed by Stephen White.
+
+        When destroying an ImageBuffer due to a canvas resize, we weren't clearing the texture ID on the layer,
+        resulting in future compositor draw calls binding an invalid texture.  This results in the test failing and
+        possibly drawing from a bad texture.
+
+        Covered by fast/canvas/setWidthResetAfterForcedRender.html in the GPU configuration.
+
+        * platform/graphics/chromium/Canvas2DLayerChromium.cpp:
+        (WebCore::Canvas2DLayerChromium::drawsContent)
+        * platform/graphics/skia/ImageBufferSkia.cpp:
+        (WebCore::ImageBuffer::~ImageBuffer):
+
 2011-09-14  Eric Seidel  <[email protected]>
 
         Remove ENABLE_SVG_USE as <use> is required by HTML5

Modified: trunk/Source/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.cpp (95113 => 95114)


--- trunk/Source/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.cpp	2011-09-14 20:05:19 UTC (rev 95113)
+++ trunk/Source/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.cpp	2011-09-14 20:12:19 UTC (rev 95114)
@@ -60,7 +60,7 @@
 
 bool Canvas2DLayerChromium::drawsContent() const
 {
-    return (m_context
+    return m_textureId && (m_context
             && (m_context->getExtensions()->getGraphicsResetStatusARB() == GraphicsContext3D::NO_ERROR));
 }
 

Modified: trunk/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp (95113 => 95114)


--- trunk/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp	2011-09-14 20:05:19 UTC (rev 95113)
+++ trunk/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp	2011-09-14 20:12:19 UTC (rev 95114)
@@ -116,6 +116,10 @@
 
 ImageBuffer::~ImageBuffer()
 {
+#if USE(ACCELERATED_COMPOSITING)
+    if (m_data.m_platformLayer)
+        m_data.m_platformLayer->setTextureId(0);
+#endif
     if (m_context && m_context->platformContext()) {
         // This is so that the SkGpuDevice destructor has the correct context.
         m_context->platformContext()->makeGrContextCurrent();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to