diff options
author | Nicolas Roard <nicolas@android.com> | 2011-01-29 17:32:43 -0800 |
---|---|---|
committer | Nicolas Roard <nicolas@android.com> | 2011-01-29 17:32:43 -0800 |
commit | 86e2f0fb10185de5c83fed0cf4aa6818e5451615 (patch) | |
tree | ac7736864a390947a553ebb3e3795c653cac9ce1 /WebCore/platform/graphics/android/TilesManager.cpp | |
parent | 0ca8045217bb9b308ddb407d7a9ce17d92d9f9fb (diff) | |
download | external_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.cpp | 6 |
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*>( |