Loading libs/hwui/PathCache.cpp +12 −25 Original line number Diff line number Diff line Loading @@ -142,7 +142,7 @@ PathCache::PathCache(): char property[PROPERTY_VALUE_MAX]; if (property_get(PROPERTY_PATH_CACHE_SIZE, property, nullptr) > 0) { INIT_LOGD(" Setting %s cache size to %sMB", name, property); setMaxSize(MB(atof(property))); mMaxSize = MB(atof(property)); } else { INIT_LOGD(" Using default %s cache size of %.2fMB", name, DEFAULT_PATH_CACHE_SIZE); } Loading Loading @@ -172,13 +172,6 @@ uint32_t PathCache::getMaxSize() { return mMaxSize; } void PathCache::setMaxSize(uint32_t maxSize) { mMaxSize = maxSize; while (mSize > mMaxSize) { mCache.removeOldest(); } } /////////////////////////////////////////////////////////////////////////////// // Callbacks /////////////////////////////////////////////////////////////////////////////// Loading Loading @@ -267,8 +260,10 @@ void PathCache::generateTexture(const PathDescription& entry, SkBitmap* bitmap, PathTexture* texture, bool addToCache) { generateTexture(*bitmap, texture); // Note here that we upload to a texture even if it's bigger than mMaxSize. // Such an entry in mCache will only be temporary, since it will be evicted // immediately on trim, or on any other Path entering the cache. uint32_t size = texture->width * texture->height; if (size < mMaxSize) { mSize += size; PATH_LOGD("PathCache::get/create: name, size, mSize = %d, %d, %d", texture->id, size, mSize); Loading @@ -278,14 +273,6 @@ void PathCache::generateTexture(const PathDescription& entry, SkBitmap* bitmap, if (addToCache) { mCache.put(entry, texture); } } else { // It's okay to add a texture that's bigger than the cache since // we'll trim the cache later when addToCache is set to false if (!addToCache) { mSize += size; } texture->cleanup = true; } } void PathCache::clear() { Loading libs/hwui/PathCache.h +0 −4 Original line number Diff line number Diff line Loading @@ -185,10 +185,6 @@ public: */ void clear(); /** * Sets the maximum size of the cache in bytes. */ void setMaxSize(uint32_t maxSize); /** * Returns the maximum size of the cache in bytes. */ Loading Loading
libs/hwui/PathCache.cpp +12 −25 Original line number Diff line number Diff line Loading @@ -142,7 +142,7 @@ PathCache::PathCache(): char property[PROPERTY_VALUE_MAX]; if (property_get(PROPERTY_PATH_CACHE_SIZE, property, nullptr) > 0) { INIT_LOGD(" Setting %s cache size to %sMB", name, property); setMaxSize(MB(atof(property))); mMaxSize = MB(atof(property)); } else { INIT_LOGD(" Using default %s cache size of %.2fMB", name, DEFAULT_PATH_CACHE_SIZE); } Loading Loading @@ -172,13 +172,6 @@ uint32_t PathCache::getMaxSize() { return mMaxSize; } void PathCache::setMaxSize(uint32_t maxSize) { mMaxSize = maxSize; while (mSize > mMaxSize) { mCache.removeOldest(); } } /////////////////////////////////////////////////////////////////////////////// // Callbacks /////////////////////////////////////////////////////////////////////////////// Loading Loading @@ -267,8 +260,10 @@ void PathCache::generateTexture(const PathDescription& entry, SkBitmap* bitmap, PathTexture* texture, bool addToCache) { generateTexture(*bitmap, texture); // Note here that we upload to a texture even if it's bigger than mMaxSize. // Such an entry in mCache will only be temporary, since it will be evicted // immediately on trim, or on any other Path entering the cache. uint32_t size = texture->width * texture->height; if (size < mMaxSize) { mSize += size; PATH_LOGD("PathCache::get/create: name, size, mSize = %d, %d, %d", texture->id, size, mSize); Loading @@ -278,14 +273,6 @@ void PathCache::generateTexture(const PathDescription& entry, SkBitmap* bitmap, if (addToCache) { mCache.put(entry, texture); } } else { // It's okay to add a texture that's bigger than the cache since // we'll trim the cache later when addToCache is set to false if (!addToCache) { mSize += size; } texture->cleanup = true; } } void PathCache::clear() { Loading
libs/hwui/PathCache.h +0 −4 Original line number Diff line number Diff line Loading @@ -185,10 +185,6 @@ public: */ void clear(); /** * Sets the maximum size of the cache in bytes. */ void setMaxSize(uint32_t maxSize); /** * Returns the maximum size of the cache in bytes. */ Loading