diff options
author | 2015-07-21 22:00:50 +0000 | |
---|---|---|
committer | 2015-07-21 22:00:50 +0000 | |
commit | c052a9a1bb1d0b7918f73166a36e96e0b1a9ed92 (patch) | |
tree | c5efd992b399b9c5222d9ddf3c0918056804d048 /libs/hwui/TextureCache.cpp | |
parent | a48c0304bfc72dbf422382ced0a5b2705a7bfd9f (diff) | |
parent | a2fd32348b06b22963fcc7c33179fddbd2394dbf (diff) |
am a2fd3234: am 3bfe4b47: am 1cd5afc1: am 9317d0b9: am 1fddd3ef: Merge "Mark isInUse per-window" into mnc-dev
* commit 'a2fd32348b06b22963fcc7c33179fddbd2394dbf':
Mark isInUse per-window
Diffstat (limited to 'libs/hwui/TextureCache.cpp')
-rw-r--r-- | libs/hwui/TextureCache.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libs/hwui/TextureCache.cpp b/libs/hwui/TextureCache.cpp index 386da72e0557..c4467f1856ff 100644 --- a/libs/hwui/TextureCache.cpp +++ b/libs/hwui/TextureCache.cpp @@ -119,10 +119,12 @@ void TextureCache::setAssetAtlas(AssetAtlas* assetAtlas) { mAssetAtlas = assetAtlas; } -void TextureCache::resetMarkInUse() { +void TextureCache::resetMarkInUse(void* ownerToken) { LruCache<uint32_t, Texture*>::Iterator iter(mCache); while (iter.next()) { - iter.value()->isInUse = false; + if (iter.value()->isInUse == ownerToken) { + iter.value()->isInUse = nullptr; + } } } @@ -186,10 +188,10 @@ Texture* TextureCache::getCachedTexture(const SkBitmap* bitmap, AtlasUsageType a return texture; } -bool TextureCache::prefetchAndMarkInUse(const SkBitmap* bitmap) { +bool TextureCache::prefetchAndMarkInUse(void* ownerToken, const SkBitmap* bitmap) { Texture* texture = getCachedTexture(bitmap, AtlasUsageType::Use); if (texture) { - texture->isInUse = true; + texture->isInUse = ownerToken; } return texture; } |