[chromium] Recycle tile-sized textures during commit to prevent reallocations
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Dec 2011 22:30:08 +0000 (22:30 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Dec 2011 22:30:08 +0000 (22:30 +0000)
commitc58fd0832a71192e8a3491278efebd234fee41ef
treef7e2faef9ca42be4d93046cbd682f238fd800d2a
parent2a3ce8e5f977e0ac5c0cd9fd03c2e9d53782c705
[chromium] Recycle tile-sized textures during commit to prevent reallocations
https://bugs.webkit.org/show_bug.cgi?id=70645

Patch by Grace Kloba <klobag@chromium.org> on 2011-12-02
Reviewed by James Robinson.

Currently texture request is capped by the high limit while we reclaim the
textures in each commit. This triggers new tiles always allocated when scrolling.
The proposal is to recycle the texture during request if the total used memory
is about to exceed the reclaim limit.

* platform/graphics/chromium/ManagedTexture.cpp:
(WebCore::ManagedTexture::reserve):
* platform/graphics/chromium/TextureManager.cpp:
(WebCore::TextureManager::setMemoryLimitBytes):
(WebCore::TextureManager::replaceTexture):
(WebCore::TextureManager::requestTexture):
* platform/graphics/chromium/TextureManager.h:

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