summaryrefslogtreecommitdiffstats
path: root/Source/WebCore
diff options
context:
space:
mode:
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);