Remove a redundant repaint when a layer becomes composited
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 15 Mar 2015 20:42:44 +0000 (20:42 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 15 Mar 2015 20:42:44 +0000 (20:42 +0000)
https://bugs.webkit.org/show_bug.cgi?id=142711

Reviewed by Anders Carlsson.

RenderLayerCompositor::computeCompositingRequirements() doesn't need to call
repaintOnCompositingChange() when a layer is going to become composited,
because updateBacking() does exactly the same thing. I used an assertion
and ran the tests to ensure this wasn't a behavior change.

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::computeCompositingRequirements):

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

Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderLayerCompositor.cpp

index b3f2467..76b35ea 100644 (file)
@@ -1,3 +1,18 @@
+2015-03-15  Simon Fraser  <simon.fraser@apple.com>
+
+        Remove a redundant repaint when a layer becomes composited
+        https://bugs.webkit.org/show_bug.cgi?id=142711
+
+        Reviewed by Anders Carlsson.
+
+        RenderLayerCompositor::computeCompositingRequirements() doesn't need to call
+        repaintOnCompositingChange() when a layer is going to become composited,
+        because updateBacking() does exactly the same thing. I used an assertion
+        and ran the tests to ensure this wasn't a behavior change.
+
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::computeCompositingRequirements):
+
 2015-03-15  Benjamin Poulain  <bpoulain@apple.com>
 
         Change the exact attribute matching to be ASCII case-insensitive
index c81bfbc..1bdd45b 100644 (file)
@@ -1447,10 +1447,7 @@ void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* ancestor
 #endif
     }
     
-    // If the layer is going into compositing mode, repaint its old location.
     ASSERT(willBeComposited == needsToBeComposited(layer));
-    if (!layer.isComposited() && willBeComposited)
-        repaintOnCompositingChange(layer);
 
     // Update backing now, so that we can use isComposited() reliably during tree traversal in rebuildCompositingLayerTree().
     if (updateBacking(layer, CompositingChangeRepaintNow, willBeComposited ? BackingRequired::Yes : BackingRequired::No))