[chromium] Preserve offscreen tiles instead of immediately recycling them
authorenne@google.com <enne@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Oct 2011 23:19:15 +0000 (23:19 +0000)
committerenne@google.com <enne@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Oct 2011 23:19:15 +0000 (23:19 +0000)
commit893c1b0b0e975d02d94d1e4714ee8c04f5647bbf
tree25f52bb2ca99e95aa00eee12cf660e7240079c5b
parent8c030f998a5688143fa591668c09769b23e85c00
[chromium] Preserve offscreen tiles instead of immediately recycling them
https://bugs.webkit.org/show_bug.cgi?id=70352

Reviewed by James Robinson.

Tested by existing layout tests.

Prior to having a TextureManager class, tiled layers recycled their
textures internally to avoid reallocation. Unfortunately, it recycled
these tiles as soon as they went offscreen, even if they were still
valid. Instead, keep tiles around forever, letting the TextureManager
decide (via LRU) when to reclaim the underlying textures. This will
improve scrolling performance due to not needing to repaint tiles.

This change does lead to more texture reallocation for any textures
that get reclaimed, but the command buffer implementation already
pools and reuses texture ids, so it should not introduce additional
flush syncs. If there's any performance penalty, it'll be at the
driver level, but I'd prefer to measure that there's a problem before
prematurely optimizing and adding complexity to the TextureManager.

* platform/graphics/chromium/TiledLayerChromium.cpp:
(WebCore::TiledLayerChromium::cleanupResources):
(WebCore::TiledLayerChromium::createTile):
(WebCore::TiledLayerChromium::prepareToUpdate):
* platform/graphics/chromium/TiledLayerChromium.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@97809 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp
Source/WebCore/platform/graphics/chromium/TiledLayerChromium.h