diff options
| author | 2014-11-25 18:51:29 +0000 | |
|---|---|---|
| committer | 2014-11-25 18:51:29 +0000 | |
| commit | fb7ff703e0f5fbf16c7805a162a3c5f44de5914b (patch) | |
| tree | ca56e4c0d00eb8a465bb09547a29faad77002691 /libs/hwui/TextureCache.h | |
| parent | 82f5fde34c8a98ace75fbc0dab8ffb97485808e9 (diff) | |
| parent | 5ab86ba05decf12e8ee3f693aab6b265905049c6 (diff) | |
am 5ab86ba0: am 89a63f02: am 0c31d97a: Merge "Switch TextureCache to SkPixelRef::fStableId" into lmp-mr1-dev
* commit '5ab86ba05decf12e8ee3f693aab6b265905049c6':
Switch TextureCache to SkPixelRef::fStableId
Diffstat (limited to 'libs/hwui/TextureCache.h')
| -rw-r--r-- | libs/hwui/TextureCache.h | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/libs/hwui/TextureCache.h b/libs/hwui/TextureCache.h index 668defc716a5..1e2d7419c1ab 100644 --- a/libs/hwui/TextureCache.h +++ b/libs/hwui/TextureCache.h @@ -50,7 +50,7 @@ class Texture; * Any texture added to the cache causing the cache to grow beyond the maximum * allowed size will also cause the oldest texture to be kicked out. */ -class TextureCache: public OnEntryRemoved<const SkPixelRef*, Texture*> { +class TextureCache: public OnEntryRemoved<uint32_t, Texture*> { public: TextureCache(); TextureCache(uint32_t maxByteSize); @@ -60,7 +60,7 @@ public: * Used as a callback when an entry is removed from the cache. * Do not invoke directly. */ - void operator()(const SkPixelRef*& pixelRef, Texture*& texture); + void operator()(uint32_t&, Texture*& texture); /** * Resets all Textures to not be marked as in use @@ -84,16 +84,12 @@ public: * texture is not kept in the cache. The caller must destroy the texture. */ Texture* getTransient(const SkBitmap* bitmap); - /** - * Removes the texture associated with the specified bitmap. - * Upon remove the texture is freed. - */ - void remove(const SkBitmap* bitmap); + /** * Removes the texture associated with the specified bitmap. This is meant * to be called from threads that are not the EGL context thread. */ - void removeDeferred(const SkBitmap* bitmap); + void releaseTexture(const SkBitmap* bitmap); /** * Process deferred removals. */ @@ -148,7 +144,7 @@ private: void init(); - LruCache<const SkPixelRef*, Texture*> mCache; + LruCache<uint32_t, Texture*> mCache; uint32_t mSize; uint32_t mMaxSize; @@ -158,7 +154,7 @@ private: bool mDebugEnabled; - Vector<const SkBitmap*> mGarbage; + Vector<uint32_t> mGarbage; mutable Mutex mLock; }; // class TextureCache |