summaryrefslogtreecommitdiffstats
path: root/libs/hwui/TextureCache.cpp
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2015-07-17 15:51:36 -0700
committerChris Craik <ccraik@google.com>2015-07-17 15:53:24 -0700
commit6ad690e16f8e139bfd29a035b52ab616d813a74b (patch)
tree8d4493016f1530ce19d30c98d2692b67f2de28e1 /libs/hwui/TextureCache.cpp
parentdb8fa48ed0864125a07f2bbe078fd60abd875ac7 (diff)
downloadframeworks_base-6ad690e16f8e139bfd29a035b52ab616d813a74b.zip
frameworks_base-6ad690e16f8e139bfd29a035b52ab616d813a74b.tar.gz
frameworks_base-6ad690e16f8e139bfd29a035b52ab616d813a74b.tar.bz2
Fix AssetAtlas usage in BitmapShaders
bug:22521999 Change-Id: I60859748ceee19ebc89ec98845e550ea26e36ecd
Diffstat (limited to 'libs/hwui/TextureCache.cpp')
-rw-r--r--libs/hwui/TextureCache.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/libs/hwui/TextureCache.cpp b/libs/hwui/TextureCache.cpp
index fe1b7fd..2a90087 100644
--- a/libs/hwui/TextureCache.cpp
+++ b/libs/hwui/TextureCache.cpp
@@ -140,8 +140,8 @@ bool TextureCache::canMakeTextureFromBitmap(const SkBitmap* bitmap) {
// Returns a prepared Texture* that either is already in the cache or can fit
// in the cache (and is thus added to the cache)
-Texture* TextureCache::getCachedTexture(const SkBitmap* bitmap) {
- if (CC_LIKELY(mAssetAtlas)) {
+Texture* TextureCache::getCachedTexture(const SkBitmap* bitmap, AtlasUsageType atlasUsageType) {
+ if (CC_LIKELY(mAssetAtlas != nullptr) && atlasUsageType == AtlasUsageType::Use) {
AssetAtlas::Entry* entry = mAssetAtlas->getEntry(bitmap);
if (CC_UNLIKELY(entry)) {
return entry->texture;
@@ -190,15 +190,15 @@ Texture* TextureCache::getCachedTexture(const SkBitmap* bitmap) {
}
bool TextureCache::prefetchAndMarkInUse(const SkBitmap* bitmap) {
- Texture* texture = getCachedTexture(bitmap);
+ Texture* texture = getCachedTexture(bitmap, AtlasUsageType::Use);
if (texture) {
texture->isInUse = true;
}
return texture;
}
-Texture* TextureCache::get(const SkBitmap* bitmap) {
- Texture* texture = getCachedTexture(bitmap);
+Texture* TextureCache::get(const SkBitmap* bitmap, AtlasUsageType atlasUsageType) {
+ Texture* texture = getCachedTexture(bitmap, atlasUsageType);
if (!texture) {
if (!canMakeTextureFromBitmap(bitmap)) {