summaryrefslogtreecommitdiff
path: root/libs/hwui/TextureCache.cpp
diff options
context:
space:
mode:
author Chris Craik <ccraik@google.com> 2015-07-17 23:59:14 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2015-07-17 23:59:17 +0000
commit0bb5c26bcea4b171583e57134b9717c77fbdcb14 (patch)
treef30bfaaa722b76dff1434d4e82416f375cfb1f1e /libs/hwui/TextureCache.cpp
parent57ee4b87fee76d9f85d28a09e370a92b5839a8dd (diff)
parent6ad690e16f8e139bfd29a035b52ab616d813a74b (diff)
Merge "Fix AssetAtlas usage in BitmapShaders" into mnc-dev
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 fe1b7fdbfbbf..2a900870223b 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)) {