From 3a3a8a5cdda72d79add3d08082523d5115cb47a8 Mon Sep 17 00:00:00 2001 From: Nicolas Roard Date: Tue, 1 Feb 2011 03:58:44 -0800 Subject: Implement automatic texture size allocation for layers This fix several issues (3d transforms, etc.) and in general makes websites using layers snappier (gmail, etc.) bug:3367038 bug:3367048 Change-Id: Ib178416209c3636c7700296978a1f35a7a54ee22 --- WebCore/platform/graphics/android/TilesManager.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'WebCore/platform/graphics/android/TilesManager.cpp') diff --git a/WebCore/platform/graphics/android/TilesManager.cpp b/WebCore/platform/graphics/android/TilesManager.cpp index 81b0404..8cbca35 100644 --- a/WebCore/platform/graphics/android/TilesManager.cpp +++ b/WebCore/platform/graphics/android/TilesManager.cpp @@ -61,7 +61,9 @@ #define TILE_HEIGHT 300 // Define a maximum amount of ram used by layers -#define MAX_LAYERS_ALLOCATION 20971520 // 20Mb +#define MAX_LAYERS_ALLOCATION 33554432 // 32Mb +// Define a maximum amount of ram used by one layer +#define MAX_LAYER_ALLOCATION 8388608 // 8Mb #define BYTES_PER_PIXEL 4 // 8888 config namespace WebCore { @@ -339,6 +341,16 @@ LayerTexture* TilesManager::createTextureForLayer(LayerAndroid* layer, const Int return texture; } +int TilesManager::maxLayersAllocation() +{ + return MAX_LAYERS_ALLOCATION; +} + +int TilesManager::maxLayerAllocation() +{ + return MAX_LAYER_ALLOCATION; +} + int TilesManager::maxTextureCount() { android::Mutex::Autolock lock(m_texturesLock); -- cgit v1.1