diff options
Diffstat (limited to 'WebCore/platform')
-rw-r--r-- | WebCore/platform/graphics/android/TiledPage.cpp | 4 | ||||
-rw-r--r-- | WebCore/platform/graphics/android/TilesManager.cpp | 10 | ||||
-rw-r--r-- | WebCore/platform/graphics/android/TilesManager.h | 1 |
3 files changed, 10 insertions, 5 deletions
diff --git a/WebCore/platform/graphics/android/TiledPage.cpp b/WebCore/platform/graphics/android/TiledPage.cpp index 620aa6f..36988dd 100644 --- a/WebCore/platform/graphics/android/TiledPage.cpp +++ b/WebCore/platform/graphics/android/TiledPage.cpp @@ -49,8 +49,6 @@ #endif // DEBUG -#define MAX_TILES 256 - namespace WebCore { using namespace android; @@ -65,7 +63,7 @@ TiledPage::TiledPage(int id, GLWebViewState* state) , m_latestPictureInval(0) , m_prepare(false) { - m_baseTiles = new BaseTile[MAX_TILES]; + m_baseTiles = new BaseTile[TilesManager::getMaxTextureAllocation() + 1]; #ifdef DEBUG_COUNT ClassTracker::instance()->increment("TiledPage"); #endif 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); diff --git a/WebCore/platform/graphics/android/TilesManager.h b/WebCore/platform/graphics/android/TilesManager.h index eeb38fe..29b7fc1 100644 --- a/WebCore/platform/graphics/android/TilesManager.h +++ b/WebCore/platform/graphics/android/TilesManager.h @@ -45,6 +45,7 @@ class TilesManager { public: static TilesManager* instance(); static GLint getMaxTextureSize(); + static int getMaxTextureAllocation(); static bool hardwareAccelerationEnabled() { |