Title: [135059] trunk
Revision
135059
Author
simon.fra...@apple.com
Date
2012-11-17 20:01:05 -0800 (Sat, 17 Nov 2012)

Log Message

Simplify bounds computation for the RenderView's layer
https://bugs.webkit.org/show_bug.cgi?id=102597

Reviewed by Anders Carlsson.

Source/WebCore:

Computing the bounds of the main layer (that of the RenderView) used to do
a full RenderLayer walk, taking the union of the bounds of all the sublayers,
which is very expensive on large pages.

For the RenderView we can avoid that entirely and just use the RenderView's
document rect. Since page scaling happens as a transform on this layer,
we want the unscaled document rect.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateLayerBounds):

LayoutTests:

Progressions as a result of this change:

* compositing/layer-creation/fixed-position-out-of-view-expected.txt: The height
is now the page height, since the page is scrollable.
* compositing/tiling/tile-cache-zoomed-expected.txt: The main layer now is not
affected by the page scale transform.
* platform/mac/compositing/tiling/tile-cache-zoomed-expected.txt: Ditto.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (135058 => 135059)


--- trunk/LayoutTests/ChangeLog	2012-11-18 03:37:49 UTC (rev 135058)
+++ trunk/LayoutTests/ChangeLog	2012-11-18 04:01:05 UTC (rev 135059)
@@ -1,5 +1,20 @@
 2012-11-17  Simon Fraser  <simon.fra...@apple.com>
 
+        Simplify bounds computation for the RenderView's layer
+        https://bugs.webkit.org/show_bug.cgi?id=102597
+
+        Reviewed by Anders Carlsson.
+
+        Progressions as a result of this change:
+
+        * compositing/layer-creation/fixed-position-out-of-view-expected.txt: The height
+        is now the page height, since the page is scrollable.
+        * compositing/tiling/tile-cache-zoomed-expected.txt: The main layer now is not
+        affected by the page scale transform.
+        * platform/mac/compositing/tiling/tile-cache-zoomed-expected.txt: Ditto.
+
+2012-11-17  Simon Fraser  <simon.fra...@apple.com>
+
         Rebaseline three tests affected by the dumping of tile grid extent.
 
         * platform/mac/compositing/tiling/rotated-tiled-clamped-expected.txt:

Modified: trunk/LayoutTests/compositing/layer-creation/fixed-position-out-of-view-expected.txt (135058 => 135059)


--- trunk/LayoutTests/compositing/layer-creation/fixed-position-out-of-view-expected.txt	2012-11-18 03:37:49 UTC (rev 135058)
+++ trunk/LayoutTests/compositing/layer-creation/fixed-position-out-of-view-expected.txt	2012-11-18 04:01:05 UTC (rev 135059)
@@ -2,7 +2,7 @@
   (bounds 785.00 1021.00)
   (children 1
     (GraphicsLayer
-      (bounds 785.00 600.00)
+      (bounds 785.00 1021.00)
       (children 1
         (GraphicsLayer
           (bounds 785.00 1021.00)

Modified: trunk/LayoutTests/compositing/tiling/tile-cache-zoomed-expected.txt (135058 => 135059)


--- trunk/LayoutTests/compositing/tiling/tile-cache-zoomed-expected.txt	2012-11-18 03:37:49 UTC (rev 135058)
+++ trunk/LayoutTests/compositing/tiling/tile-cache-zoomed-expected.txt	2012-11-18 04:01:05 UTC (rev 135059)
@@ -4,7 +4,7 @@
   (children 1
     (GraphicsLayer
       (anchor 0.00 0.00)
-      (bounds 3092.00 6640.00)
+      (bounds 1208.00 2594.00)
       (transform [1.60 0.00 0.00 0.00] [0.00 1.60 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 0.00 1.00])
       (visible rect 0.00, 0.00 490.63 x 365.63)
       (children 1

Modified: trunk/LayoutTests/platform/mac/compositing/tiling/tile-cache-zoomed-expected.txt (135058 => 135059)


--- trunk/LayoutTests/platform/mac/compositing/tiling/tile-cache-zoomed-expected.txt	2012-11-18 03:37:49 UTC (rev 135058)
+++ trunk/LayoutTests/platform/mac/compositing/tiling/tile-cache-zoomed-expected.txt	2012-11-18 04:01:05 UTC (rev 135059)
@@ -4,7 +4,7 @@
   (children 1
     (GraphicsLayer
       (anchor 0.00 0.00)
-      (bounds 3091.00 6640.00)
+      (bounds 1208.00 2594.00)
       (transform [1.60 0.00 0.00 0.00] [0.00 1.60 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 0.00 1.00])
       (visible rect 0.00, 0.00 490.63 x 365.63)
       (children 1

Modified: trunk/Source/WebCore/ChangeLog (135058 => 135059)


--- trunk/Source/WebCore/ChangeLog	2012-11-18 03:37:49 UTC (rev 135058)
+++ trunk/Source/WebCore/ChangeLog	2012-11-18 04:01:05 UTC (rev 135059)
@@ -1,3 +1,21 @@
+2012-11-17  Simon Fraser  <simon.fra...@apple.com>
+
+        Simplify bounds computation for the RenderView's layer
+        https://bugs.webkit.org/show_bug.cgi?id=102597
+
+        Reviewed by Anders Carlsson.
+
+        Computing the bounds of the main layer (that of the RenderView) used to do
+        a full RenderLayer walk, taking the union of the bounds of all the sublayers,
+        which is very expensive on large pages.
+        
+        For the RenderView we can avoid that entirely and just use the RenderView's
+        document rect. Since page scaling happens as a transform on this layer,
+        we want the unscaled document rect.
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::calculateLayerBounds):
+
 2012-11-17  Eric Seidel  <e...@webkit.org>
 
         Add ScriptWrappable to more WebCore classes which are commonly JS-wrapped

Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (135058 => 135059)


--- trunk/Source/WebCore/rendering/RenderLayer.cpp	2012-11-18 03:37:49 UTC (rev 135058)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp	2012-11-18 04:01:05 UTC (rev 135059)
@@ -4423,7 +4423,14 @@
         return IntRect();
 
     RenderLayerModelObject* renderer = this->renderer();
+
+    if (isRootLayer()) {
+        // The root layer is always just the size of the document.
+        return renderer->view()->unscaledDocumentRect();
+    }
+
     LayoutRect boundingBoxRect = localBoundingBox();
+
     if (renderer->isBox())
         toRenderBox(renderer)->flipForWritingMode(boundingBoxRect);
     else
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to