[chromium] Disable root layer clears on release builds.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Feb 2012 20:35:06 +0000 (20:35 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Feb 2012 20:35:06 +0000 (20:35 +0000)
https://bugs.webkit.org/show_bug.cgi?id=77478

Patch by Jonathan Backer <backer@chromium.org> on 2012-02-08
Reviewed by James Robinson.

Source/WebCore:

* platform/graphics/chromium/LayerRendererChromium.cpp:
(WebCore::LayerRendererChromium::clearRenderSurface):
(WebCore::LayerRendererChromium::drawRenderPass):
* platform/graphics/chromium/LayerRendererChromium.h:
(LayerRendererChromium):

LayoutTests:

* platform/chromium-gpu-linux/fast/canvas/canvas-text-alignment-expected.png:
* platform/chromium-gpu-linux/media/video-zoom-expected.png:
* platform/chromium-linux/compositing/direct-image-compositing-expected.png:
* platform/chromium-linux/compositing/geometry/ancestor-overflow-change-expected.png:
* platform/chromium-linux/compositing/geometry/fixed-in-composited-expected.png:
* platform/chromium-linux/compositing/geometry/tall-page-composited-expected.png:
* platform/chromium-linux/compositing/masks/masked-ancestor-expected.png:
* platform/chromium-linux/compositing/masks/multiple-masks-expected.png:
* platform/chromium-linux/compositing/masks/simple-composited-mask-expected.png:
* platform/chromium-linux/compositing/scaling/tiled-layer-recursion-expected.png:
* platform/chromium-linux/platform/chromium/compositing/layout-width-change-expected.png:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107120 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/chromium-gpu-linux/fast/canvas/canvas-text-alignment-expected.png
LayoutTests/platform/chromium-gpu-linux/media/video-zoom-expected.png
LayoutTests/platform/chromium-linux/compositing/direct-image-compositing-expected.png
LayoutTests/platform/chromium-linux/compositing/geometry/ancestor-overflow-change-expected.png
LayoutTests/platform/chromium-linux/compositing/geometry/fixed-in-composited-expected.png
LayoutTests/platform/chromium-linux/compositing/geometry/tall-page-composited-expected.png
LayoutTests/platform/chromium-linux/compositing/masks/masked-ancestor-expected.png
LayoutTests/platform/chromium-linux/compositing/masks/multiple-masks-expected.png
LayoutTests/platform/chromium-linux/compositing/masks/simple-composited-mask-expected.png
LayoutTests/platform/chromium-linux/compositing/scaling/tiled-layer-recursion-expected.png
LayoutTests/platform/chromium-linux/platform/chromium/compositing/layout-width-change-expected.png
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h

index 09a7dab..47a8987 100644 (file)
@@ -1,3 +1,22 @@
+2012-02-08  Jonathan Backer  <backer@chromium.org>
+
+        [chromium] Disable root layer clears on release builds.
+        https://bugs.webkit.org/show_bug.cgi?id=77478
+
+        Reviewed by James Robinson.
+
+        * platform/chromium-gpu-linux/fast/canvas/canvas-text-alignment-expected.png:
+        * platform/chromium-gpu-linux/media/video-zoom-expected.png:
+        * platform/chromium-linux/compositing/direct-image-compositing-expected.png:
+        * platform/chromium-linux/compositing/geometry/ancestor-overflow-change-expected.png:
+        * platform/chromium-linux/compositing/geometry/fixed-in-composited-expected.png:
+        * platform/chromium-linux/compositing/geometry/tall-page-composited-expected.png:
+        * platform/chromium-linux/compositing/masks/masked-ancestor-expected.png:
+        * platform/chromium-linux/compositing/masks/multiple-masks-expected.png:
+        * platform/chromium-linux/compositing/masks/simple-composited-mask-expected.png:
+        * platform/chromium-linux/compositing/scaling/tiled-layer-recursion-expected.png:
+        * platform/chromium-linux/platform/chromium/compositing/layout-width-change-expected.png:
+
 2012-02-07  Andy Estes  <aestes@apple.com>
 
         REGRESSION (r102983): ClicktoFlash drawing of old style youtube embeds missing until resize
index 7198f12..854a99a 100644 (file)
Binary files a/LayoutTests/platform/chromium-gpu-linux/fast/canvas/canvas-text-alignment-expected.png and b/LayoutTests/platform/chromium-gpu-linux/fast/canvas/canvas-text-alignment-expected.png differ
index 6d771f0..fe8cc80 100644 (file)
Binary files a/LayoutTests/platform/chromium-gpu-linux/media/video-zoom-expected.png and b/LayoutTests/platform/chromium-gpu-linux/media/video-zoom-expected.png differ
index 13871fe..399fac6 100644 (file)
Binary files a/LayoutTests/platform/chromium-linux/compositing/direct-image-compositing-expected.png and b/LayoutTests/platform/chromium-linux/compositing/direct-image-compositing-expected.png differ
index ada2142..20f61a2 100644 (file)
Binary files a/LayoutTests/platform/chromium-linux/compositing/geometry/ancestor-overflow-change-expected.png and b/LayoutTests/platform/chromium-linux/compositing/geometry/ancestor-overflow-change-expected.png differ
index a9901e1..395333f 100644 (file)
Binary files a/LayoutTests/platform/chromium-linux/compositing/geometry/fixed-in-composited-expected.png and b/LayoutTests/platform/chromium-linux/compositing/geometry/fixed-in-composited-expected.png differ
index 8613751..cc6cd41 100644 (file)
Binary files a/LayoutTests/platform/chromium-linux/compositing/geometry/tall-page-composited-expected.png and b/LayoutTests/platform/chromium-linux/compositing/geometry/tall-page-composited-expected.png differ
index cdadcdc..90b9ede 100644 (file)
Binary files a/LayoutTests/platform/chromium-linux/compositing/masks/masked-ancestor-expected.png and b/LayoutTests/platform/chromium-linux/compositing/masks/masked-ancestor-expected.png differ
index 1156b1a..3bb8124 100644 (file)
Binary files a/LayoutTests/platform/chromium-linux/compositing/masks/multiple-masks-expected.png and b/LayoutTests/platform/chromium-linux/compositing/masks/multiple-masks-expected.png differ
index 3e65645..dda4932 100644 (file)
Binary files a/LayoutTests/platform/chromium-linux/compositing/masks/simple-composited-mask-expected.png and b/LayoutTests/platform/chromium-linux/compositing/masks/simple-composited-mask-expected.png differ
index 4a62ce3..8b59b4a 100644 (file)
Binary files a/LayoutTests/platform/chromium-linux/compositing/scaling/tiled-layer-recursion-expected.png and b/LayoutTests/platform/chromium-linux/compositing/scaling/tiled-layer-recursion-expected.png differ
index ee01512..43a0bf2 100644 (file)
Binary files a/LayoutTests/platform/chromium-linux/platform/chromium/compositing/layout-width-change-expected.png and b/LayoutTests/platform/chromium-linux/platform/chromium/compositing/layout-width-change-expected.png differ
index b3c4ca4..377a5e6 100644 (file)
@@ -1,3 +1,16 @@
+2012-02-08  Jonathan Backer  <backer@chromium.org>
+
+        [chromium] Disable root layer clears on release builds.
+        https://bugs.webkit.org/show_bug.cgi?id=77478
+
+        Reviewed by James Robinson.
+
+        * platform/graphics/chromium/LayerRendererChromium.cpp:
+        (WebCore::LayerRendererChromium::clearRenderSurface):
+        (WebCore::LayerRendererChromium::drawRenderPass):
+        * platform/graphics/chromium/LayerRendererChromium.h:
+        (LayerRendererChromium):
+
 2012-02-08  Anders Carlsson  <andersca@apple.com>
 
         Add a content shadow layer to the render layer compositor
index bae4da3..1e5ee56 100644 (file)
@@ -306,9 +306,9 @@ void LayerRendererChromium::viewportChanged()
     m_currentRenderSurface = 0;
 }
 
-void LayerRendererChromium::clearSurfaceForDebug(CCRenderSurface* renderSurface, CCRenderSurface* rootRenderSurface, const FloatRect& surfaceDamageRect)
+void LayerRendererChromium::clearRenderSurface(CCRenderSurface* renderSurface, CCRenderSurface* rootRenderSurface, const FloatRect& surfaceDamageRect)
 {
-    // Non-root layers should clear their entire contents to transparent. The root layer
+    // Non-root layers should clear their entire contents to transparent. On DEBUG builds, the root layer
     // is cleared to blue to easily see regions that were not drawn on the screen. If we
     // are using partial swap / scissor optimization, then the surface should only
     // clear the damaged region, so that we don't accidentally clear un-changed portions
@@ -324,7 +324,11 @@ void LayerRendererChromium::clearSurfaceForDebug(CCRenderSurface* renderSurface,
     else
         GLC(m_context.get(), m_context->disable(GraphicsContext3D::SCISSOR_TEST));
 
-    m_context->clear(GraphicsContext3D::COLOR_BUFFER_BIT);
+#if defined(NDEBUG)
+    if (renderSurface != rootRenderSurface)
+#endif
+        m_context->clear(GraphicsContext3D::COLOR_BUFFER_BIT);
+
     GLC(m_context.get(), m_context->enable(GraphicsContext3D::SCISSOR_TEST));
 }
 
@@ -374,8 +378,7 @@ void LayerRendererChromium::drawRenderPass(const CCRenderPass* renderPass)
     if (!useRenderSurface(renderSurface))
         return;
 
-    // FIXME: eventually we should place this under a debug flag.
-    clearSurfaceForDebug(renderSurface, m_defaultRenderSurface, renderPass->surfaceDamageRect());
+    clearRenderSurface(renderSurface, m_defaultRenderSurface, renderPass->surfaceDamageRect());
 
     const CCQuadList& quadList = renderPass->quadList();
     for (size_t i = 0; i < quadList.size(); ++i)
index 4bcb258..bea4baa 100644 (file)
@@ -173,7 +173,7 @@ private:
     void setDrawViewportRect(const IntRect&, bool flipY);
 
     bool useRenderSurface(CCRenderSurface*);
-    void clearSurfaceForDebug(CCRenderSurface*, CCRenderSurface* rootRenderSurface, const FloatRect& surfaceDamageRect);
+    void clearRenderSurface(CCRenderSurface*, CCRenderSurface* rootRenderSurface, const FloatRect& surfaceDamageRect);
 
     void releaseRenderSurfaceTextures();