summaryrefslogtreecommitdiff
path: root/libs/hwui/TextureCache.cpp
diff options
context:
space:
mode:
author John Reck <jreck@google.com> 2015-07-21 10:23:59 -0700
committer John Reck <jreck@google.com> 2015-07-21 10:46:54 -0700
commit00e79c9947b741194ff6c0d08ede9b3befbf9c9d (patch)
tree26098cf607eaef09a94855aec4ccdd9d8789fd55 /libs/hwui/TextureCache.cpp
parent29cf9aea5490c42b85aaaa98b6784daff82629f8 (diff)
Mark isInUse per-window
Bug: 22509159 Change-Id: I0ae0f1fa582ee38dcb9f24ca20f0b4d0c57ccb32
Diffstat (limited to 'libs/hwui/TextureCache.cpp')
-rw-r--r--libs/hwui/TextureCache.cpp10
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;
}