summaryrefslogtreecommitdiffstats
path: root/libs/hwui/TextureCache.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui/TextureCache.h')
-rw-r--r--libs/hwui/TextureCache.h27
1 files changed, 21 insertions, 6 deletions
diff --git a/libs/hwui/TextureCache.h b/libs/hwui/TextureCache.h
index e7fc990..7a7ee5a 100644
--- a/libs/hwui/TextureCache.h
+++ b/libs/hwui/TextureCache.h
@@ -66,20 +66,30 @@ public:
/**
* Resets all Textures to not be marked as in use
*/
- void resetMarkInUse();
+ void resetMarkInUse(void* ownerToken);
/**
* Attempts to precache the SkBitmap. Returns true if a Texture was successfully
* acquired for the bitmap, false otherwise. If a Texture was acquired it is
* marked as in use.
*/
- bool prefetchAndMarkInUse(const SkBitmap* bitmap);
+ bool prefetchAndMarkInUse(void* ownerToken, const SkBitmap* bitmap);
/**
- * Returns the texture associated with the specified bitmap. If the texture
- * cannot be found in the cache, a new texture is generated.
+ * Returns the texture associated with the specified bitmap from either within the cache, or
+ * the AssetAtlas. If the texture cannot be found in the cache, a new texture is generated.
*/
- Texture* get(const SkBitmap* bitmap);
+ Texture* get(const SkBitmap* bitmap) {
+ return get(bitmap, AtlasUsageType::Use);
+ }
+
+ /**
+ * Returns the texture associated with the specified bitmap. If the texture cannot be found in
+ * the cache, a new texture is generated, even if it resides in the AssetAtlas.
+ */
+ Texture* getAndBypassAtlas(const SkBitmap* bitmap) {
+ return get(bitmap, AtlasUsageType::Bypass);
+ }
/**
* Removes the texture associated with the specified pixelRef. This is meant
@@ -123,10 +133,15 @@ public:
void setAssetAtlas(AssetAtlas* assetAtlas);
private:
+ enum class AtlasUsageType {
+ Use,
+ Bypass,
+ };
bool canMakeTextureFromBitmap(const SkBitmap* bitmap);
- Texture* getCachedTexture(const SkBitmap* bitmap);
+ Texture* get(const SkBitmap* bitmap, AtlasUsageType atlasUsageType);
+ Texture* getCachedTexture(const SkBitmap* bitmap, AtlasUsageType atlasUsageType);
/**
* Generates the texture from a bitmap into the specified texture structure.