Add a layer (FBO) cache.
The cache is used to draw layers so that a new
texture does not have to be recreated every time
a call to saveLayer() happens.
The FBO cache used a KeyedVector, which is a bad
idea. The cache should be able to store several
FBOs of the same size (this happens a lot during
scrolling with fading edges for instance.) This
will be changed in a future CL.
Change-Id: Ic316189e625f0dbcf0d273a71cc981a433d48726
diff --git a/libs/hwui/TextureCache.h b/libs/hwui/TextureCache.h
index 250efc5..bed1191 100644
--- a/libs/hwui/TextureCache.h
+++ b/libs/hwui/TextureCache.h
@@ -39,7 +39,7 @@
* Used as a callback when an entry is removed from the cache.
* Do not invoke directly.
*/
- void operator()(SkBitmap* bitmap, Texture* texture);
+ void operator()(SkBitmap*& bitmap, Texture*& texture);
/**
* Returns the texture associated with the specified bitmap. If the texture
@@ -78,7 +78,7 @@
*/
void generateTexture(SkBitmap* bitmap, Texture* texture, bool regenerate = false);
- GenerationCache<SkBitmap, Texture> mCache;
+ GenerationCache<SkBitmap*, Texture*> mCache;
uint32_t mSize;
uint32_t mMaxSize;