diff options
Diffstat (limited to 'libs/hwui/TextureCache.h')
-rw-r--r-- | libs/hwui/TextureCache.h | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/libs/hwui/TextureCache.h b/libs/hwui/TextureCache.h index 27693df..f7707f7 100644 --- a/libs/hwui/TextureCache.h +++ b/libs/hwui/TextureCache.h @@ -19,6 +19,8 @@ #include <SkBitmap.h> +#include <utils/Vector.h> + #include "Debug.h" #include "Texture.h" #include "utils/GenerationCache.h" @@ -64,11 +66,21 @@ public: */ Texture* get(SkBitmap* bitmap); /** - * Removes the texture associated with the specified bitmap. Returns NULL - * if the texture cannot be found. Upon remove the texture is freed. + * Removes the texture associated with the specified bitmap. + * Upon remove the texture is freed. */ void remove(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(SkBitmap* bitmap); + /** + * Process deferred removals. + */ + void clearGarbage(); + + /** * Clears the cache. This causes all textures to be deleted. */ void clear(); @@ -109,10 +121,7 @@ private: bool mDebugEnabled; - /** - * Used to access mCache and mSize. All methods are accessed from a single - * thread except for remove(). - */ + Vector<SkBitmap*> mGarbage; mutable Mutex mLock; }; // class TextureCache |