From 22158e139a3d6c6a9787ca0de224e9368f643284 Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Fri, 6 Aug 2010 11:18:34 -0700 Subject: Automatically cleanup textures that don't fit in the cache. Change-Id: I4f29ed96ea11118b391fb957e1e4d1b8fcef1537 --- libs/hwui/PathCache.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libs/hwui/PathCache.cpp') diff --git a/libs/hwui/PathCache.cpp b/libs/hwui/PathCache.cpp index 67a5f923d598..fa6ea2591cc8 100644 --- a/libs/hwui/PathCache.cpp +++ b/libs/hwui/PathCache.cpp @@ -88,7 +88,6 @@ PathTexture* PathCache::get(SkPath* path, SkPaint* paint) { texture = addTexture(entry, path, paint); } - // TODO: Do something to destroy the texture object if it's too big for the cache return texture; } @@ -129,6 +128,8 @@ PathTexture* PathCache::addTexture(const PathCacheEntry& entry, if (size < mMaxSize) { mSize += size; mCache.put(entry, texture); + } else { + texture->cleanup = true; } return texture; -- cgit v1.2.3-59-g8ed1b