diff options
author | 2015-07-21 21:45:54 +0000 | |
---|---|---|
committer | 2015-07-21 21:45:54 +0000 | |
commit | a2fd32348b06b22963fcc7c33179fddbd2394dbf (patch) | |
tree | 1bd8b90259aedb291153f2b51ff26ed6e53b3c99 /libs/hwui/TextureCache.cpp | |
parent | cc432cc08919cec386213f993b36bfdc5adf6ed0 (diff) | |
parent | 3bfe4b47c7629fab50e64a62d1fa72ab714aa9e0 (diff) |
am 3bfe4b47: am 1cd5afc1: am 9317d0b9: am 1fddd3ef: Merge "Mark isInUse per-window" into mnc-dev
* commit '3bfe4b47c7629fab50e64a62d1fa72ab714aa9e0':
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 2a900870223b..fda009108aba 100644 --- a/libs/hwui/TextureCache.cpp +++ b/libs/hwui/TextureCache.cpp @@ -122,10 +122,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; + } } } @@ -189,10 +191,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; } |