diff options
author | Chris Craik <ccraik@google.com> | 2011-09-13 14:54:08 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-09-13 14:54:08 -0700 |
commit | dc0d2b5e841d47894b32b959a48bf373ff6367a7 (patch) | |
tree | 470097f10b9ecb4d5a09f1509cd46a37629960c2 | |
parent | 9be67d65f88609c74e3093bb47dc0fe2f2b5e894 (diff) | |
parent | 6fa81b6762dfc7fdd6d9f177d0c326e7bef3537b (diff) | |
download | external_webkit-dc0d2b5e841d47894b32b959a48bf373ff6367a7.zip external_webkit-dc0d2b5e841d47894b32b959a48bf373ff6367a7.tar.gz external_webkit-dc0d2b5e841d47894b32b959a48bf373ff6367a7.tar.bz2 |
Merge "Allocate textures based purely on viewport size"
-rw-r--r-- | Source/WebCore/platform/graphics/android/GLWebViewState.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Source/WebCore/platform/graphics/android/GLWebViewState.cpp b/Source/WebCore/platform/graphics/android/GLWebViewState.cpp index d85d8b7..5764a6b 100644 --- a/Source/WebCore/platform/graphics/android/GLWebViewState.cpp +++ b/Source/WebCore/platform/graphics/android/GLWebViewState.cpp @@ -393,8 +393,11 @@ void GLWebViewState::setViewport(SkRect& viewport, float scale) static_cast<int>(ceilf(viewport.fRight * invTileContentWidth)), static_cast<int>(ceilf(viewport.fBottom * invTileContentHeight))); - int maxTextureCount = (m_viewportTileBounds.width() + TILE_PREFETCH_DISTANCE * 2) * - (m_viewportTileBounds.height() + TILE_PREFETCH_DISTANCE * 2) * 2; + // allocate max possible number of tiles visible with this viewport + int viewMaxTileX = static_cast<int>(ceilf((viewport.width()-1) * invTileContentWidth)) + 1; + int viewMaxTileY = static_cast<int>(ceilf((viewport.height()-1) * invTileContentHeight)) + 1; + int maxTextureCount = (viewMaxTileX + TILE_PREFETCH_DISTANCE * 2) * + (viewMaxTileY + TILE_PREFETCH_DISTANCE * 2) * 2; TilesManager::instance()->setMaxTextureCount(maxTextureCount); m_tiledPageA->updateBaseTileSize(); m_tiledPageB->updateBaseTileSize(); |