diff options
| author | 2011-11-04 15:12:29 -0700 | |
|---|---|---|
| committer | 2011-11-04 16:23:47 -0700 | |
| commit | eca0ca2424afc1e98912405906edfc32f7733e16 (patch) | |
| tree | 9f49527f35d77b0de3ee49f76e1b7bc99fac3ac6 /libs/hwui/TextureCache.h | |
| parent | 650ee281ae9e007ce82ea79ff18bab9ef49503de (diff) | |
Memory optimizations for libhwui
Bug #5566149
Lazily initialize font renderers
Keep 60% of the texture cache when an app goes to the background
Delete least used font renderer when going to the background
Delete all font renderers on full memory trim
Change-Id: I3c2454d46dc1107ec0f0f72a9ce69cbbcc8825e7
Diffstat (limited to 'libs/hwui/TextureCache.h')
| -rw-r--r-- | libs/hwui/TextureCache.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libs/hwui/TextureCache.h b/libs/hwui/TextureCache.h index f7707f7ae8e8..ce924b4cbb6f 100644 --- a/libs/hwui/TextureCache.h +++ b/libs/hwui/TextureCache.h @@ -98,6 +98,17 @@ public: */ uint32_t getSize(); + /** + * Partially flushes the cache. The amount of memory freed by a flush + * is defined by the flush rate. + */ + void flush(); + /** + * Indicates the percentage of the cache to retain when a + * memory trim is requested (see Caches::flush). + */ + void setFlushRate(float flushRate); + private: /** * Generates the texture from a bitmap into the specified texture structure. @@ -119,6 +130,8 @@ private: uint32_t mMaxSize; GLint mMaxTextureSize; + float mFlushRate; + bool mDebugEnabled; Vector<SkBitmap*> mGarbage; |