summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/graphics/android/TilesManager.cpp
diff options
context:
space:
mode:
authorShimeng (Simon) Wang <swang@google.com>2011-02-15 14:30:49 -0800
committerShimeng (Simon) Wang <swang@google.com>2011-02-15 14:30:49 -0800
commit522c8aecb5c6a797ceb59e8eaa9ab44e3a5fda54 (patch)
tree5ab49c0a39589a9554d6f45c06802f0b985e59ce /WebCore/platform/graphics/android/TilesManager.cpp
parenta06ac8116d6d5d82316f450445453171cd7add1c (diff)
downloadexternal_webkit-522c8aecb5c6a797ceb59e8eaa9ab44e3a5fda54.zip
external_webkit-522c8aecb5c6a797ceb59e8eaa9ab44e3a5fda54.tar.gz
external_webkit-522c8aecb5c6a797ceb59e8eaa9ab44e3a5fda54.tar.bz2
Set correct max texture allocations.
This fixes core dump or dead lock in GL code when rotating screen. Change-Id: I5da2e5a41dfdb18f98f126d2a2fac999210ce7c7
Diffstat (limited to 'WebCore/platform/graphics/android/TilesManager.cpp')
-rw-r--r--WebCore/platform/graphics/android/TilesManager.cpp10
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);