diff options
| author | 2015-07-21 20:50:27 +0000 | |
|---|---|---|
| committer | 2015-07-21 20:50:30 +0000 | |
| commit | 1fddd3efa9ac10e794d7bdf457b7b52c7e4614f7 (patch) | |
| tree | 406d987a0baa22be8ed272c285a8b4b7b16dd35c /libs/hwui/TextureCache.cpp | |
| parent | 55a116d00ca3f7b84a6af1c5c3472323ad5bc6ca (diff) | |
| parent | 00e79c9947b741194ff6c0d08ede9b3befbf9c9d (diff) | |
Merge "Mark isInUse per-window" into mnc-dev
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; } |