Tile cache doesn't have an upper limit
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Feb 2012 19:59:47 +0000 (19:59 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Feb 2012 19:59:47 +0000 (19:59 +0000)
commit048a097cd5b78e7c097a2f8be2c54f668c54fd0e
treefce5f17d7b0a2ffdb1ffe8084c28c370205d4c19
parentaf584710da7d0fff6b3f52c8650ff9a6cf7e8fb1
Tile cache doesn't have an upper limit
https://bugs.webkit.org/show_bug.cgi?id=77564
<rdar://problem/10710744>

Reviewed by Darin Adler.

Cache enough tiles to cover 3x the visible height and 2x the visible width of the page,
and drop tiles that are outside that area.

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::platformCALayerDidCreateTiles):
Call GraphicsLayerClient::notifySyncRequired here, which will schedule a layer flush and ensure that
the page layout is up to date before the new tiles are painted.

* platform/graphics/ca/PlatformCALayerClient.h:
Add platformCALayerDidCreateTiles member function.

* platform/graphics/ca/mac/TileCache.h:
Update for new/removed member functions and member variables.

* platform/graphics/ca/mac/TileCache.mm:
(WebCore::TileCache::TileCache):
Initialize the tile revalidation timer.

(WebCore::TileCache::tileCacheLayerBoundsChanged):
If we don't have any tiles at all right now, revalidate the tiles immediately. Otherwise,
schedule the revalidation timer.

(WebCore::TileCache::setNeedsDisplayInRect):
Return early if we have no tiles.

(WebCore::TileCache::visibleRectChanged):
Schedule tile revalidation.

(WebCore::TileCache::rectForTileIndex):
New helper function that returns the bounds rect of a tile given its tile index.

(WebCore::TileCache::getTileIndexRangeForRect):
Clamp the rect to the bounds of the tile cache layer.

(WebCore::TileCache::scheduleTileRevalidation):
Schedule the revalidation timer if it hasn't already been scheduled.

(WebCore::TileCache::tileRevalidationTimerFired):
Call revalidateTiles.

(WebCore::TileCache::revalidateTiles):
Compute the tile coverage rect and remove all tiles that are outside. Create new tiles for any
parts of the tile coverage rect that don't have tiles already.

(WebCore::TileCache::tileLayerAtIndex):
Remove invalid assertions.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106482 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
Source/WebCore/platform/graphics/ca/PlatformCALayerClient.h
Source/WebCore/platform/graphics/ca/mac/TileCache.h
Source/WebCore/platform/graphics/ca/mac/TileCache.mm