Tiled layers are missing content on zooming
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Oct 2012 23:13:25 +0000 (23:13 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Oct 2012 23:13:25 +0000 (23:13 +0000)
commit09d51004845279216b1be366121c1d3726f453fb
tree58890a9c77c10aa86e824910529637e67adfe94a
parent60b19e7ff53972f3f017650452c8b1dee06d75bb
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:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@132542 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/compositing/tiling/tile-cache-zoomed-expected.txt [new file with mode: 0644]
LayoutTests/compositing/tiling/tile-cache-zoomed.html [new file with mode: 0644]
LayoutTests/platform/mac/tiled-drawing/tile-coverage-scroll-to-bottom-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
Source/WebCore/platform/graphics/ca/mac/TileCache.mm
Source/WebCore/rendering/RenderLayerCompositor.cpp