diff options
author | Chris Craik <ccraik@google.com> | 2012-04-17 16:41:29 -0700 |
---|---|---|
committer | Chris Craik <ccraik@google.com> | 2012-04-18 13:27:21 -0700 |
commit | e080317b90534632e8be18dc8d5e9a51554b444a (patch) | |
tree | 28d222178f1a99fa7ce7333a3935176af46a2bd4 /Source/WebCore/platform/graphics/android/rendering/TilesManager.cpp | |
parent | 6230a7a2415e8b40c6d19847bc94a0919f06127b (diff) | |
download | external_webkit-e080317b90534632e8be18dc8d5e9a51554b444a.zip external_webkit-e080317b90534632e8be18dc8d5e9a51554b444a.tar.gz external_webkit-e080317b90534632e8be18dc8d5e9a51554b444a.tar.bz2 |
prevent double TileGrid preparation
bug:6346848
also renamed TileGrid* variables for clarity
Change-Id: Ie0e56a6e1e85db426c4944b03125248cd6a647c0
Diffstat (limited to 'Source/WebCore/platform/graphics/android/rendering/TilesManager.cpp')
-rw-r--r-- | Source/WebCore/platform/graphics/android/rendering/TilesManager.cpp | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/Source/WebCore/platform/graphics/android/rendering/TilesManager.cpp b/Source/WebCore/platform/graphics/android/rendering/TilesManager.cpp index e8b8cd1..f46562a 100644 --- a/Source/WebCore/platform/graphics/android/rendering/TilesManager.cpp +++ b/Source/WebCore/platform/graphics/android/rendering/TilesManager.cpp @@ -258,22 +258,16 @@ TileTexture* TilesManager::getAvailableTexture(Tile* owner) { android::Mutex::Autolock lock(m_texturesLock); - // Sanity check that the tile does not already own a texture - if (owner->backTexture() && owner->backTexture()->owner() == owner) { - ALOGV("same owner (%d, %d), getAvailableBackTexture(%x) => texture %x", - owner->x(), owner->y(), owner, owner->backTexture()); - if (owner->isLayerTile()) - m_availableTilesTextures.remove(m_availableTilesTextures.find(owner->backTexture())); - else - m_availableTextures.remove(m_availableTextures.find(owner->backTexture())); - return owner->backTexture(); - } - WTF::Vector<TileTexture*>* availableTexturePool; - if (owner->isLayerTile()) { + if (owner->isLayerTile()) availableTexturePool = &m_availableTilesTextures; - } else { + else availableTexturePool = &m_availableTextures; + + // Sanity check that the tile does not already own a texture + if (owner->backTexture() && owner->backTexture()->owner() == owner) { + availableTexturePool->remove(availableTexturePool->find(owner->backTexture())); + return owner->backTexture(); } // The heuristic for selecting a texture is as follows: |