summaryrefslogtreecommitdiff
path: root/libs/hwui/TextureCache.cpp
diff options
context:
space:
mode:
author John Reck <jreck@google.com> 2015-07-21 21:04:45 +0000
committer Android Git Automerger <android-git-automerger@android.com> 2015-07-21 21:04:45 +0000
commit9317d0b9904573bdb0d815ec563dd263447f11db (patch)
treeebc8fe43d6981e62b16e6640343b5ed74022c26c /libs/hwui/TextureCache.cpp
parentcf6500b9bae461107d5c0c58de511df907d19fb3 (diff)
parent1fddd3efa9ac10e794d7bdf457b7b52c7e4614f7 (diff)
am 1fddd3ef: Merge "Mark isInUse per-window" into mnc-dev
* commit '1fddd3efa9ac10e794d7bdf457b7b52c7e4614f7': Mark isInUse per-window
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;
}