From 74935efa85015deff39cdf7e168f3a0aba5c5403 Mon Sep 17 00:00:00 2001 From: Teng-Hui Zhu Date: Wed, 29 Jun 2011 16:48:13 -0700 Subject: Don't create newer LayerTexture when hitting upper bound. bug:4976882 Change-Id: If1c913da8bdc3a310a3a665dc895711093fb8788 --- Source/WebCore/platform/graphics/android/TilesManager.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Source/WebCore') 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); -- cgit v1.1