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.
* compositing/visible-rect/iframe-no-layers.html: For WK2, the size of the visibleRect
includes the size of the border of the iframe. In order to elliminate platform
differences, set this border to 0.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@170597
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2014-06-30 Myles C. Maxfield <mmaxfield@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.
+ * compositing/visible-rect/iframe-no-layers.html: For WK2, the size of the visibleRect
+ includes the size of the border of the iframe. In order to elliminate platform
+ differences, set this border to 0.
+
2014-06-30 Michael Saboff <msaboff@apple.com>
Reduce memory required for js/typedarray-zero-size.js
iframe {
margin: 10px;
+ border: 0px solid black;
}
</style>
<script>
--- /dev/null
+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)
+ )
+ )
+)
+
--- /dev/null
+<!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>
+2014-06-30 Myles C. Maxfield <mmaxfield@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-30 Brent Fulgham <bfulgham@apple.com>
[Win] Unreviewed project gardening.
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;
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);