diff options
author | Nicolas Roard <nicolas@android.com> | 2011-01-31 16:02:42 -0800 |
---|---|---|
committer | Nicolas Roard <nicolas@android.com> | 2011-01-31 23:16:39 -0800 |
commit | 7e3773d591be20a4ddb1ef7df2709fd7655b7917 (patch) | |
tree | a95c6e0074c7d24749a8ad5a853a885b20180b46 /WebCore/platform/graphics/android/GLWebViewState.cpp | |
parent | 968791c5f1c465f0633c618fda279246ba213fdf (diff) | |
download | external_webkit-7e3773d591be20a4ddb1ef7df2709fd7655b7917.zip external_webkit-7e3773d591be20a4ddb1ef7df2709fd7655b7917.tar.gz external_webkit-7e3773d591be20a4ddb1ef7df2709fd7655b7917.tar.bz2 |
Implement dynamic allocation of base tiles.
This way, a webview will only consume as much GPU memory
as needed, depending on its size, to a maximum of 256
tiles per TiledPage.
bug:3376517
Change-Id: Icc1e47623297cf1c01d40aa9e123c1a05373e7e5
Diffstat (limited to 'WebCore/platform/graphics/android/GLWebViewState.cpp')
-rw-r--r-- | WebCore/platform/graphics/android/GLWebViewState.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/WebCore/platform/graphics/android/GLWebViewState.cpp b/WebCore/platform/graphics/android/GLWebViewState.cpp index 3c1d40a..63fe730 100644 --- a/WebCore/platform/graphics/android/GLWebViewState.cpp +++ b/WebCore/platform/graphics/android/GLWebViewState.cpp @@ -287,6 +287,11 @@ void GLWebViewState::setViewport(SkRect& viewport, float scale) static_cast<int>(floorf(viewport.fTop * invTileContentHeight)), static_cast<int>(ceilf(viewport.fRight * invTileContentWidth)), static_cast<int>(ceilf(viewport.fBottom * invTileContentHeight))); + + int maxTextureCount = (m_viewportTileBounds.width()+1)*(m_viewportTileBounds.height()+1)*2; + TilesManager::instance()->setMaxTextureCount(maxTextureCount); + m_tiledPageA->updateBaseTileSize(); + m_tiledPageB->updateBaseTileSize(); } } // namespace WebCore |