Title: [117032] trunk/Source/WebCore
Revision
117032
Author
[email protected]
Date
2012-05-14 23:12:05 -0700 (Mon, 14 May 2012)

Log Message

RenderLayer::repaintRectIncludingDescendants shouldn't include repaint rects of composited descendants
https://bugs.webkit.org/show_bug.cgi?id=86429
<rdar://problem/11445132>

Reviewed by Simon Fraser.

Change repaintRectIncludingDescendants to not include repaint rects for composited child layers,
and rename the function to make it more clear that that's what it does now.

No new tests, scrolling performance optimization.

* page/FrameView.cpp:
(WebCore::FrameView::scrollContentsFastPath):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::repaintRectIncludingNonCompositingDescendants):
* rendering/RenderLayer.h:
(RenderLayer):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (117031 => 117032)


--- trunk/Source/WebCore/ChangeLog	2012-05-15 05:55:57 UTC (rev 117031)
+++ trunk/Source/WebCore/ChangeLog	2012-05-15 06:12:05 UTC (rev 117032)
@@ -1,3 +1,23 @@
+2012-05-14  Tim Horton  <[email protected]>
+
+        RenderLayer::repaintRectIncludingDescendants shouldn't include repaint rects of composited descendants
+        https://bugs.webkit.org/show_bug.cgi?id=86429
+        <rdar://problem/11445132>
+
+        Reviewed by Simon Fraser.
+
+        Change repaintRectIncludingDescendants to not include repaint rects for composited child layers,
+        and rename the function to make it more clear that that's what it does now.
+
+        No new tests, scrolling performance optimization.
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::scrollContentsFastPath):
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::repaintRectIncludingNonCompositingDescendants):
+        * rendering/RenderLayer.h:
+        (RenderLayer):
+
 2012-05-14  Gavin Peters  <[email protected]>
 
         Add Prerenderer, PrerenderHandle and a chromium interface for Prerendering.

Modified: trunk/Source/WebCore/page/FrameView.cpp (117031 => 117032)


--- trunk/Source/WebCore/page/FrameView.cpp	2012-05-15 05:55:57 UTC (rev 117031)
+++ trunk/Source/WebCore/page/FrameView.cpp	2012-05-15 06:12:05 UTC (rev 117032)
@@ -1489,7 +1489,7 @@
         if (renderBox->isComposited())
             continue;
 #endif
-        IntRect updateRect = pixelSnappedIntRect(renderBox->layer()->repaintRectIncludingDescendants());
+        IntRect updateRect = pixelSnappedIntRect(renderBox->layer()->repaintRectIncludingNonCompositingDescendants());
         updateRect = contentsToRootView(updateRect);
         if (!isCompositedContentLayer && clipsRepaints())
             updateRect.intersect(rectToScroll);

Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (117031 => 117032)


--- trunk/Source/WebCore/rendering/RenderLayer.cpp	2012-05-15 05:55:57 UTC (rev 117031)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp	2012-05-15 06:12:05 UTC (rev 117032)
@@ -452,11 +452,16 @@
         *offsetFromRoot = oldOffsetFromRoot;
 }
 
-LayoutRect RenderLayer::repaintRectIncludingDescendants() const
+LayoutRect RenderLayer::repaintRectIncludingNonCompositingDescendants() const
 {
     LayoutRect repaintRect = m_repaintRect;
-    for (RenderLayer* child = firstChild(); child; child = child->nextSibling())
-        repaintRect.unite(child->repaintRectIncludingDescendants());
+    for (RenderLayer* child = firstChild(); child; child = child->nextSibling()) {
+        // Don't include repaint rects for composited child layers; they will paint themselves and have a different origin.
+        if (child->isComposited())
+            continue;
+
+        repaintRect.unite(child->repaintRectIncludingNonCompositingDescendants());
+    }
     return repaintRect;
 }
 

Modified: trunk/Source/WebCore/rendering/RenderLayer.h (117031 => 117032)


--- trunk/Source/WebCore/rendering/RenderLayer.h	2012-05-15 05:55:57 UTC (rev 117031)
+++ trunk/Source/WebCore/rendering/RenderLayer.h	2012-05-15 06:12:05 UTC (rev 117032)
@@ -511,7 +511,7 @@
 
     // Return a cached repaint rect, computed relative to the layer renderer's containerForRepaint.
     LayoutRect repaintRect() const { return m_repaintRect; }
-    LayoutRect repaintRectIncludingDescendants() const;
+    LayoutRect repaintRectIncludingNonCompositingDescendants() const;
 
     enum UpdateLayerPositionsAfterScrollFlag {
         NoFlag = 0,
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to