Make GraphicsLayerCA::backingStoreMemoryEstimate() give a better estimate for tiled...
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Mar 2013 05:59:13 +0000 (05:59 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Mar 2013 05:59:13 +0000 (05:59 +0000)
commite124a02cb0124778390de6e2458484305c281dc2
tree4e825420585eb2bb3e835bb6514813eb5e33e294
parentecd126e4df6ad5347a8c29bd9e3b4831601adf2d
Make GraphicsLayerCA::backingStoreMemoryEstimate() give a better estimate for tiled layers
https://bugs.webkit.org/show_bug.cgi?id=112864

Reviewed by Tim Horton.

If a GraphicsLayerCA has TiledBacking, ask the TiledBacking how
much memory it's using for tiles, rather than just using
height * width * 4.

Implement retainedTileBackingStoreMemory() in the TileController,
summing the memory used by parented tiles.

The original code was incorrectly multiplying by contentsScale
only once rather than twice (2x contents scale uses 4x as much memory).

* platform/graphics/TiledBacking.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::backingStoreMemoryEstimate):
* platform/graphics/ca/mac/TileController.h:
* platform/graphics/ca/mac/TileController.mm:
(WebCore::TileController::retainedTileBackingStoreMemory):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@146438 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/TiledBacking.h
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
Source/WebCore/platform/graphics/ca/mac/TileController.h
Source/WebCore/platform/graphics/ca/mac/TileController.mm