OSDN Git Service

Double number of tile textures allocated - do not merge
authorChris Craik <ccraik@google.com>
Fri, 14 Oct 2011 00:04:21 +0000 (17:04 -0700)
committerChris Craik <ccraik@google.com>
Fri, 14 Oct 2011 00:04:21 +0000 (17:04 -0700)
bug:5452814
Change-Id: Ib13a0f4e5189af0e4928bc376b29610e20eeb4dc

Source/WebCore/platform/graphics/android/GLWebViewState.cpp
Source/WebCore/platform/graphics/android/TilesManager.cpp

index efcf877..66c0370 100644 (file)
@@ -295,8 +295,10 @@ void GLWebViewState::setViewport(SkRect& viewport, float scale)
     // 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;
+
+    // NOTE: fetching 4 viewports worth, may need to be adjusted per-device
     int maxTextureCount = (viewMaxTileX + TILE_PREFETCH_DISTANCE * 2) *
-        (viewMaxTileY + TILE_PREFETCH_DISTANCE * 2) * 2;
+        (viewMaxTileY + TILE_PREFETCH_DISTANCE * 2) * 4;
     TilesManager::instance()->setMaxTextureCount(maxTextureCount);
     m_tiledPageA->updateBaseTileSize();
     m_tiledPageB->updateBaseTileSize();
index 74cc764..7edc4b8 100644 (file)
@@ -69,7 +69,7 @@
 // number to cap the layer tile texturs, it worked on both phones and tablets.
 // TODO: after merge the pool of base tiles and layer tiles, we should revisit
 // the logic of allocation management.
-#define MAX_TEXTURE_ALLOCATION ((6+TILE_PREFETCH_DISTANCE*2)*(5+TILE_PREFETCH_DISTANCE*2)*2)
+#define MAX_TEXTURE_ALLOCATION ((6+TILE_PREFETCH_DISTANCE*2)*(5+TILE_PREFETCH_DISTANCE*2)*4)
 #define TILE_WIDTH 256
 #define TILE_HEIGHT 256
 #define LAYER_TILE_WIDTH 256