diff options
author | Nicolas Roard <nicolasroard@google.com> | 2011-08-04 10:11:47 -0700 |
---|---|---|
committer | Nicolas Roard <nicolasroard@google.com> | 2011-08-04 10:11:47 -0700 |
commit | 82b16301ec89989ef436f317f2f23f57ed2e2660 (patch) | |
tree | 4865de64fa32f7776765281c4e4fb91bdd59f692 /Source/WebCore | |
parent | 9c20fe3057959d107a9b9f8ee78f2d244313fe77 (diff) | |
download | external_webkit-82b16301ec89989ef436f317f2f23f57ed2e2660.zip external_webkit-82b16301ec89989ef436f317f2f23f57ed2e2660.tar.gz external_webkit-82b16301ec89989ef436f317f2f23f57ed2e2660.tar.bz2 |
Fix memory increase
bug:5118763
Change-Id: Ice0f3792cd9e288459713411d755f1717896087e
Diffstat (limited to 'Source/WebCore')
-rw-r--r-- | Source/WebCore/platform/graphics/android/TilesManager.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Source/WebCore/platform/graphics/android/TilesManager.cpp b/Source/WebCore/platform/graphics/android/TilesManager.cpp index 9a18758..b99cbfc 100644 --- a/Source/WebCore/platform/graphics/android/TilesManager.cpp +++ b/Source/WebCore/platform/graphics/android/TilesManager.cpp @@ -130,7 +130,10 @@ void TilesManager::allocateTiles() nbTexturesAllocated++; } - for (int i = 0; i < LAYER_TILES; i++) { + int nbLayersTexturesToAllocate = LAYER_TILES - m_tilesTextures.size(); + XLOG("%d layers tiles to allocate (%d textures planned)", nbLayersTexturesToAllocate, LAYER_TILES); + int nbLayersTexturesAllocated = 0; + for (int i = 0; i < nbLayersTexturesToAllocate; i++) { BaseTileTexture* texture = new BaseTileTexture( layerTileWidth(), layerTileHeight()); // the atomic load ensures that the texture has been fully initialized @@ -139,8 +142,13 @@ void TilesManager::allocateTiles() reinterpret_cast<BaseTileTexture*>( android_atomic_acquire_load(reinterpret_cast<int32_t*>(&texture))); m_tilesTextures.append(loadedTexture); + nbLayersTexturesAllocated++; } - XLOG("allocated %d textures", nbTexturesAllocated); + XLOG("allocated %d textures for base (total: %d, %d Mb), %d textures for layers (total: %d, %d Mb)", + nbTexturesAllocated, m_textures.size(), + m_textures.size() * TILE_WIDTH * TILE_HEIGHT * 4 / 1024 / 1024, + nbLayersTexturesAllocated, m_tilesTextures.size(), + m_tilesTextures.size() * LAYER_TILE_WIDTH * LAYER_TILE_HEIGHT * 4 / 1024 / 1024); } void TilesManager::printTextures() |