summaryrefslogtreecommitdiffstats
path: root/Source/WebCore
diff options
context:
space:
mode:
authorTeng-Hui Zhu <ztenghui@google.com>2011-06-29 16:48:13 -0700
committerTeng-Hui Zhu <ztenghui@google.com>2011-06-30 09:54:29 -0700
commit74935efa85015deff39cdf7e168f3a0aba5c5403 (patch)
treeb229588e41e859a5a7be8611b17633e661449cd3 /Source/WebCore
parent3b7a33ca2a2cbc9d271aa5c362e32f4d5ce0ce9f (diff)
downloadexternal_webkit-74935efa85015deff39cdf7e168f3a0aba5c5403.zip
external_webkit-74935efa85015deff39cdf7e168f3a0aba5c5403.tar.gz
external_webkit-74935efa85015deff39cdf7e168f3a0aba5c5403.tar.bz2
Don't create newer LayerTexture when hitting upper bound.
bug:4976882 Change-Id: If1c913da8bdc3a310a3a665dc895711093fb8788
Diffstat (limited to 'Source/WebCore')
-rw-r--r--Source/WebCore/platform/graphics/android/TilesManager.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/Source/WebCore/platform/graphics/android/TilesManager.cpp b/Source/WebCore/platform/graphics/android/TilesManager.cpp
index b4df0a1..2259072 100644
--- a/Source/WebCore/platform/graphics/android/TilesManager.cpp
+++ b/Source/WebCore/platform/graphics/android/TilesManager.cpp
@@ -355,6 +355,10 @@ LayerTexture* TilesManager::createTextureForLayer(LayerAndroid* layer, const Int
if (m_layersMemoryUsage + size > MAX_LAYERS_ALLOCATION)
cleanupLayersTextures(layer, true);
+ // If the cleanup can't achieve the goal, then don't create a layerTexture.
+ if (m_layersMemoryUsage + size > MAX_LAYERS_ALLOCATION)
+ return 0;
+
LayerTexture* texture = new LayerTexture(w, h);
texture->setId(layer->uniqueId());
texture->setRect(rect);