summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/graphics/android/TilesManager.cpp
diff options
context:
space:
mode:
authorNicolas Roard <nicolas@android.com>2011-01-29 17:32:43 -0800
committerNicolas Roard <nicolas@android.com>2011-01-29 17:32:43 -0800
commit86e2f0fb10185de5c83fed0cf4aa6818e5451615 (patch)
treeac7736864a390947a553ebb3e3795c653cac9ce1 /WebCore/platform/graphics/android/TilesManager.cpp
parent0ca8045217bb9b308ddb407d7a9ce17d92d9f9fb (diff)
downloadexternal_webkit-86e2f0fb10185de5c83fed0cf4aa6818e5451615.zip
external_webkit-86e2f0fb10185de5c83fed0cf4aa6818e5451615.tar.gz
external_webkit-86e2f0fb10185de5c83fed0cf4aa6818e5451615.tar.bz2
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
Diffstat (limited to 'WebCore/platform/graphics/android/TilesManager.cpp')
-rw-r--r--WebCore/platform/graphics/android/TilesManager.cpp6
1 files changed, 5 insertions, 1 deletions
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<BackedDoubleBufferedTexture*>(