Title: [170414] trunk
Revision
170414
Author
mmaxfi...@apple.com
Date
2014-06-24 18:25:23 -0700 (Tue, 24 Jun 2014)

Log Message

Tiles on bottom of screen are not always allocated when necessary
https://bugs.webkit.org/show_bug.cgi?id=134272

Reviewed by Simon Fraser.

Source/WebCore:
The initial visibleRect is in the coordinate of the root layer, so its origin
is at the top left of the view. The initial rect we were using doesn't
include the contents inset, so it was too short, which was causing tiles near
the bottom of the screen to not always be allocated if the tile threshold was
close to the bottom of the view. Instead, we want to include the contents
inset size so the visible rect includes the entire view.
GraphicsLayerCA::recursiveCommitChanges() takes care of mapping and cropping
the visible rect into the tiled layer's coordinate system, at which point it
is used for visible tile logic.

Test: platform/mac-wk2/tiled-drawing/visible-rect-content-inset.html

* platform/graphics/ca/TileCoverageMap.cpp:
(WebCore::TileCoverageMap::update):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::flushPendingLayerChanges):

LayoutTests:
Apply a content inset, then dump visible rects.

* platform/mac-wk2/tiled-drawing/visible-rect-content-inset-expected.txt: Added.
* platform/mac-wk2/tiled-drawing/visible-rect-content-inset.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (170413 => 170414)


--- trunk/LayoutTests/ChangeLog	2014-06-25 01:19:25 UTC (rev 170413)
+++ trunk/LayoutTests/ChangeLog	2014-06-25 01:25:23 UTC (rev 170414)
@@ -1,3 +1,15 @@
+2014-06-24  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        Tiles on bottom of screen are not always allocated when necessary
+        https://bugs.webkit.org/show_bug.cgi?id=134272
+
+        Reviewed by Simon Fraser.
+
+        Apply a content inset, then dump visible rects.
+
+        * platform/mac-wk2/tiled-drawing/visible-rect-content-inset-expected.txt: Added.
+        * platform/mac-wk2/tiled-drawing/visible-rect-content-inset.html: Added.
+
 2014-06-24  Samuel White  <samuel_wh...@apple.com>
 
         AX: Remove tight platform expectation coupling form roles-exposed layout test.

Added: trunk/LayoutTests/platform/mac-wk2/tiled-drawing/visible-rect-content-inset-expected.txt (0 => 170414)


--- trunk/LayoutTests/platform/mac-wk2/tiled-drawing/visible-rect-content-inset-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac-wk2/tiled-drawing/visible-rect-content-inset-expected.txt	2014-06-25 01:25:23 UTC (rev 170414)
@@ -0,0 +1,19 @@
+This test applies a content inset and then dumps the layer tree including visible rects. The visible rects should match the expected rects.
+(GraphicsLayer
+  (anchor 0.00 0.00)
+  (bounds 800.00 500.00)
+  (visible rect 0.00, 0.00 800.00 x 500.00)
+  (contentsScale 1.00)
+  (children 1
+    (GraphicsLayer
+      (bounds 800.00 500.00)
+      (contentsOpaque 1)
+      (visible rect 0.00, 0.00 800.00 x 500.00)
+      (contentsScale 1.00)
+      (tile cache coverage 0, 0 800 x 500)
+      (tile size 512 x 512)
+      (top left tile 0, 0 tiles grid 2 x 1)
+    )
+  )
+)
+

Added: trunk/LayoutTests/platform/mac-wk2/tiled-drawing/visible-rect-content-inset.html (0 => 170414)


--- trunk/LayoutTests/platform/mac-wk2/tiled-drawing/visible-rect-content-inset.html	                        (rev 0)
+++ trunk/LayoutTests/platform/mac-wk2/tiled-drawing/visible-rect-content-inset.html	2014-06-25 01:25:23 UTC (rev 170414)
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+    <script>
+        if (window.testRunner)
+            testRunner.dumpAsText();
+        if (window.internals)
+            window.internals.setTopContentInset(100);
+
+        function doTest()
+        {
+            if (window.internals) {
+                document.getElementById('layers').innerText = internals.layerTreeAsText(document,
+                    internals.LAYER_TREE_INCLUDES_VISIBLE_RECTS | internals.LAYER_TREE_INCLUDES_TILE_CACHES);
+            }
+        }
+        window.addEventListener('load', doTest, false);
+    </script>
+</head>
+<body>
+This test applies a content inset and then dumps the layer tree including visible rects. The visible rects should match the expected rects.
+<pre id="layers">Layer tree goes here</p>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (170413 => 170414)


--- trunk/Source/WebCore/ChangeLog	2014-06-25 01:19:25 UTC (rev 170413)
+++ trunk/Source/WebCore/ChangeLog	2014-06-25 01:25:23 UTC (rev 170414)
@@ -1,5 +1,29 @@
 2014-06-24  Myles C. Maxfield  <mmaxfi...@apple.com>
 
+        Tiles on bottom of screen are not always allocated when necessary
+        https://bugs.webkit.org/show_bug.cgi?id=134272
+
+        Reviewed by Simon Fraser.
+
+        The initial visibleRect is in the coordinate of the root layer, so its origin
+        is at the top left of the view. The initial rect we were using doesn't
+        include the contents inset, so it was too short, which was causing tiles near
+        the bottom of the screen to not always be allocated if the tile threshold was
+        close to the bottom of the view. Instead, we want to include the contents
+        inset size so the visible rect includes the entire view.
+        GraphicsLayerCA::recursiveCommitChanges() takes care of mapping and cropping
+        the visible rect into the tiled layer's coordinate system, at which point it
+        is used for visible tile logic.
+
+        Test: platform/mac-wk2/tiled-drawing/visible-rect-content-inset.html
+
+        * platform/graphics/ca/TileCoverageMap.cpp:
+        (WebCore::TileCoverageMap::update):
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
+
+2014-06-24  Myles C. Maxfield  <mmaxfi...@apple.com>
+
         InlineTextBox's m_len can be an unsigned (rather than an unsigned short)
         https://bugs.webkit.org/show_bug.cgi?id=134173
 

Modified: trunk/Source/WebCore/platform/graphics/ca/TileCoverageMap.cpp (170413 => 170414)


--- trunk/Source/WebCore/platform/graphics/ca/TileCoverageMap.cpp	2014-06-25 01:19:25 UTC (rev 170413)
+++ trunk/Source/WebCore/platform/graphics/ca/TileCoverageMap.cpp	2014-06-25 01:25:23 UTC (rev 170414)
@@ -63,7 +63,6 @@
     FloatRect containerBounds = m_controller.bounds();
     FloatRect visibleRect = m_controller.visibleRect();
     visibleRect.contract(4, 4); // Layer is positioned 2px from top and left edges.
-    visibleRect.setHeight(visibleRect.height() - m_controller.topContentInset());
 
     float widthScale = 1;
     float scale = 1;

Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (170413 => 170414)


--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2014-06-25 01:19:25 UTC (rev 170413)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2014-06-25 01:25:23 UTC (rev 170414)
@@ -461,7 +461,7 @@
         rootLayer->flushCompositingState(visibleRect);
 #else
         // Having a m_clipLayer indicates that we're doing scrolling via GraphicsLayers.
-        IntRect visibleRect = m_clipLayer ? IntRect(IntPoint(), frameView.contentsSize()) : frameView.visibleContentRect();
+        IntRect visibleRect = m_clipLayer ? IntRect(IntPoint(), frameView.unscaledTotalVisibleContentSize()) : frameView.visibleContentRect();
         if (!frameView.exposedRect().isInfinite())
             visibleRect.intersect(IntRect(frameView.exposedRect()));
         rootLayer->flushCompositingState(visibleRect);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to