From 86e2f0fb10185de5c83fed0cf4aa6818e5451615 Mon Sep 17 00:00:00 2001 From: Nicolas Roard Date: Sat, 29 Jan 2011 17:32:43 -0800 Subject: Share a single bitmap for all the base tiles. Reduce the memory usage from 64Mb to 48Mb on google.com bug:3376517 Change-Id: Ia5c16c55edb0bbf6164c8cec8588f53543964ccd --- WebCore/platform/graphics/android/TilesManager.cpp | 6 +++++- 1 file changed, 5 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 16282c4..9d42058 100644 --- a/WebCore/platform/graphics/android/TilesManager.cpp +++ b/WebCore/platform/graphics/android/TilesManager.cpp @@ -72,9 +72,13 @@ TilesManager::TilesManager() { XLOG("TilesManager ctor"); m_textures.reserveCapacity(MAX_TEXTURE_ALLOCATION); + m_tilesBitmap = new SkBitmap(); + m_tilesBitmap->setConfig(SkBitmap::kARGB_8888_Config, tileWidth(), tileHeight()); + m_tilesBitmap->allocPixels(); + m_tilesBitmap->eraseColor(0); for (int i = 0; i < MAX_TEXTURE_ALLOCATION; i++) { BackedDoubleBufferedTexture* texture = new BackedDoubleBufferedTexture( - tileWidth(), tileHeight()); + tileWidth(), tileHeight(), m_tilesBitmap); // the atomic load ensures that the texture has been fully initialized // before we pass a pointer for other threads to operate on m_textures.append(reinterpret_cast( -- cgit v1.1