diff options
author | 2010-08-06 11:18:34 -0700 | |
---|---|---|
committer | 2010-08-06 11:18:34 -0700 | |
commit | 22158e139a3d6c6a9787ca0de224e9368f643284 (patch) | |
tree | fac1da337f6fd11ef0761bd0a776af7f184b0ec7 /libs/hwui/TextureCache.cpp | |
parent | ff0f973442d22ba6bb1231fb6e97e5f3051a7f48 (diff) |
Automatically cleanup textures that don't fit in the cache.
Change-Id: I4f29ed96ea11118b391fb957e1e4d1b8fcef1537
Diffstat (limited to 'libs/hwui/TextureCache.cpp')
-rw-r--r-- | libs/hwui/TextureCache.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libs/hwui/TextureCache.cpp b/libs/hwui/TextureCache.cpp index 4975edb46789..59903b70a6a1 100644 --- a/libs/hwui/TextureCache.cpp +++ b/libs/hwui/TextureCache.cpp @@ -93,11 +93,13 @@ Texture* TextureCache::get(SkBitmap* bitmap) { if (size < mMaxSize) { mSize += size; mCache.put(bitmap, texture); + } else { + texture->cleanup = true; } } else if (bitmap->getGenerationID() != texture->generation) { generateTexture(bitmap, texture, true); } - // TODO: Do something to destroy the texture object if it's too big for the cache + return texture; } |