summaryrefslogtreecommitdiffstats
path: root/libs/hwui/TextureCache.h
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2014-12-10 16:47:36 -0800
committerJohn Reck <jreck@google.com>2014-12-10 17:07:41 -0800
commitebd52610cfeff6e557fde284a7e1efc5e6438285 (patch)
tree6e371646828e9074579fe91f869954a67f48e93a /libs/hwui/TextureCache.h
parentfa3f43145ac1af62ed063d3cd7ba1c30a81bb3fd (diff)
downloadframeworks_base-ebd52610cfeff6e557fde284a7e1efc5e6438285.zip
frameworks_base-ebd52610cfeff6e557fde284a7e1efc5e6438285.tar.gz
frameworks_base-ebd52610cfeff6e557fde284a7e1efc5e6438285.tar.bz2
Don't preload textures for AssetAtlas
Bug: 18317479 RenderNode::prepareSubTree calls prefetchAndMarkInUse on every bitmapResoruce in the DisplayList. However, this resulted in textures being uploaded for bitmaps that would be drawn from the AssetAtlas instead. To fix this we teach TextureCache about the AssetAtlas so that calls to TextureCache return the Texture from AssetAtlas if it exists. Thus usage of AssetAtlas is now purely to allow for further optimizations via draw merging instead of a requirement to get any benefit at all. Change-Id: I65282fa05bac46f4e93822b3467ffa0261ccf200
Diffstat (limited to 'libs/hwui/TextureCache.h')
-rw-r--r--libs/hwui/TextureCache.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/libs/hwui/TextureCache.h b/libs/hwui/TextureCache.h
index 3e94d1f..cf8d134 100644
--- a/libs/hwui/TextureCache.h
+++ b/libs/hwui/TextureCache.h
@@ -44,6 +44,8 @@ namespace uirenderer {
// Classes
///////////////////////////////////////////////////////////////////////////////
+class AssetAtlas;
+
/**
* A simple LRU texture cache. The cache has a maximum size expressed in bytes.
* Any texture added to the cache causing the cache to grow beyond the maximum
@@ -123,6 +125,8 @@ public:
*/
void setFlushRate(float flushRate);
+ void setAssetAtlas(AssetAtlas* assetAtlas);
+
private:
bool canMakeTextureFromBitmap(const SkBitmap* bitmap);
@@ -155,6 +159,8 @@ private:
Vector<uint32_t> mGarbage;
mutable Mutex mLock;
+
+ AssetAtlas* mAssetAtlas;
}; // class TextureCache
}; // namespace uirenderer