diff options
author | 2015-07-21 21:19:47 +0000 | |
---|---|---|
committer | 2015-07-21 21:19:47 +0000 | |
commit | 1cd5afc135b0aea3249219fcfb393d9bd9b53ec2 (patch) | |
tree | b63232652dbc79169ef9410d7468313445e3b573 /libs/hwui/TextureCache.cpp | |
parent | 67cd2fc5eb92dd1fb2fe6621d3d1d4dd33f199ce (diff) | |
parent | 9317d0b9904573bdb0d815ec563dd263447f11db (diff) |
am 9317d0b9: am 1fddd3ef: Merge "Mark isInUse per-window" into mnc-dev
* commit '9317d0b9904573bdb0d815ec563dd263447f11db':
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; } |