diff options
author | 2015-07-18 00:24:55 +0000 | |
---|---|---|
committer | 2015-07-18 00:24:55 +0000 | |
commit | fbd2d949587b1b7a14f98f5ed3fb33c3b4978a93 (patch) | |
tree | c1e5dd5540af577eaedf4d32da0a2d4a727825cc /libs/hwui/TextureCache.cpp | |
parent | 9f71f05be09020136dfa8a9cad52d0200dd7f5d0 (diff) | |
parent | b6e41a08826d01dba3ad30c14e72e3531d22d0ad (diff) |
am b6e41a08: am 0bb5c26b: Merge "Fix AssetAtlas usage in BitmapShaders" into mnc-dev
* commit 'b6e41a08826d01dba3ad30c14e72e3531d22d0ad':
Fix AssetAtlas usage in BitmapShaders
Diffstat (limited to 'libs/hwui/TextureCache.cpp')
-rw-r--r-- | libs/hwui/TextureCache.cpp | 10 |
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)) { |