haikuwebkit/LayoutTests/compositing/tiling/tile-cache-zoomed.html

44 lines
1008 B
HTML
Raw Permalink Normal View History

Tiled layers are missing content on zooming https://bugs.webkit.org/show_bug.cgi?id=100422 Reviewed by Beth Dakin. Source/WebCore: Tiled layers using TileCaches were missing content after zooming. TileCache was confused in the presence of scaling; it unapplies the scale on the layer above the tiles (so the tiles live in screen space), and computed the tile coverage rect in these tile coordinates. This worked for the page tile cache, because its visibleRect was sent in pre-scaled. However, for tiled layer TileCaches this was wrong. Fix by scaling the tile coverage rect by m_scale before using it to compute which tiles to throw away and bring in. To fix the problem of the visibleRect being pre-scaled for the page tile cache, remove the setting of the visibleRect in RenderLayerCompositor::frameViewDidScroll(), and rely on GraphicsLayerCA::updateVisibleRect() which computes the visible rect in the correct, layer coordinates. Test: compositing/tiling/tile-cache-zoomed.html * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::updateVisibleRect): Call setVisibleRect() for all tile cache layers, not just tiled layer ones, but only do the visible rect adjustment for those that are not the page tile cache. * platform/graphics/ca/mac/TileCache.mm: (WebCore::TileCache::revalidateTiles): Use a coverageRectInTileCoords rect, which is scaled to be in the same coordinate space as the tile grid. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::frameViewDidScroll): Remove the code that sets the setVisibleRect() on the TiledBacking. LayoutTests: New test for zooming with a tiled layer, and adjust an existing result. * compositing/tiling/tile-cache-zoomed-expected.txt: Added. * compositing/tiling/tile-cache-zoomed.html: Added. * platform/mac/tiled-drawing/tile-coverage-scroll-to-bottom-expected.txt: Canonical link: https://commits.webkit.org/118456@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@132542 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-10-25 23:13:25 +00:00
<!DOCTYPE html>
<html>
<head>
<style>
body {
width: 1200px;
height: 2000px;
overflow: hidden;
}
.box {
height: 2500px;
width: 700px;
-webkit-transform: translateZ(1px);
background-color: silver;
}
</style>
<script>
if (window.testRunner)
testRunner.dumpAsText();
function doTest()
{
if (window.eventSender)
eventSender.scalePageBy(1.6, 1.6);
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>
<div class="box">
</div>
<pre id="layers">Layer tree goes here</p>
</body>
</html>