diff options
Diffstat (limited to 'WebCore/platform/graphics/android/TilesManager.cpp')
-rw-r--r-- | WebCore/platform/graphics/android/TilesManager.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/WebCore/platform/graphics/android/TilesManager.cpp b/WebCore/platform/graphics/android/TilesManager.cpp index 571d9cc..0fb3b1b 100644 --- a/WebCore/platform/graphics/android/TilesManager.cpp +++ b/WebCore/platform/graphics/android/TilesManager.cpp @@ -58,7 +58,7 @@ // at least 5 * 3 = 15 textures. We can also enable offscreen textures #define EXPANDED_TILE_BOUNDS_X 1 #define EXPANDED_TILE_BOUNDS_Y 4 -#define MAX_TEXTURE_ALLOCATION (5+EXPANDED_TILE_BOUNDS_X*2)*(3+EXPANDED_TILE_BOUNDS_Y*2)*2 +#define MAX_TEXTURE_ALLOCATION (5+1+EXPANDED_TILE_BOUNDS_X*2)*(3+1+EXPANDED_TILE_BOUNDS_Y*2)*2 #define TILE_WIDTH 300 #define TILE_HEIGHT 300 @@ -78,6 +78,11 @@ GLint TilesManager::getMaxTextureSize() return maxTextureSize; } +int TilesManager::getMaxTextureAllocation() +{ + return MAX_TEXTURE_ALLOCATION; +} + TilesManager::TilesManager() : m_layersMemoryUsage(0) , m_maxTextureCount(0) @@ -369,7 +374,8 @@ int TilesManager::maxTextureCount() void TilesManager::setMaxTextureCount(int max) { XLOG("setMaxTextureCount: %d", max); - if (m_maxTextureCount >= max && m_maxTextureCount) + if (max > MAX_TEXTURE_ALLOCATION || + (m_maxTextureCount >= max && m_maxTextureCount)) return; android::Mutex::Autolock lock(m_texturesLock); |