Loading libs/hwui/FboCache.cpp +2 −9 Original line number Diff line number Diff line Loading @@ -27,15 +27,8 @@ namespace uirenderer { // Constructors/destructor /////////////////////////////////////////////////////////////////////////////// FboCache::FboCache(): mMaxSize(DEFAULT_FBO_CACHE_SIZE) { char property[PROPERTY_VALUE_MAX]; if (property_get(PROPERTY_FBO_CACHE_SIZE, property, nullptr) > 0) { INIT_LOGD(" Setting fbo cache size to %s", property); mMaxSize = atoi(property); } else { INIT_LOGD(" Using default fbo cache size of %d", DEFAULT_FBO_CACHE_SIZE); } } FboCache::FboCache() : mMaxSize(Properties::fboCacheSize) {} FboCache::~FboCache() { clear(); Loading libs/hwui/GradientCache.cpp +1 −16 Original line number Diff line number Diff line Loading @@ -65,17 +65,9 @@ int GradientCacheEntry::compare(const GradientCacheEntry& lhs, const GradientCac GradientCache::GradientCache(Extensions& extensions) : mCache(LruCache<GradientCacheEntry, Texture*>::kUnlimitedCapacity) , mSize(0) , mMaxSize(MB(DEFAULT_GRADIENT_CACHE_SIZE)) , mMaxSize(Properties::gradientCacheSize) , mUseFloatTexture(extensions.hasFloatTextures()) , mHasNpot(extensions.hasNPot()){ char property[PROPERTY_VALUE_MAX]; if (property_get(PROPERTY_GRADIENT_CACHE_SIZE, property, nullptr) > 0) { INIT_LOGD(" Setting gradient cache size to %sMB", property); setMaxSize(MB(atof(property))); } else { INIT_LOGD(" Using default gradient cache size of %.2fMB", DEFAULT_GRADIENT_CACHE_SIZE); } glGetIntegerv(GL_MAX_TEXTURE_SIZE, &mMaxTextureSize); mCache.setOnEntryRemovedListener(this); Loading @@ -97,13 +89,6 @@ uint32_t GradientCache::getMaxSize() { return mMaxSize; } void GradientCache::setMaxSize(uint32_t maxSize) { mMaxSize = maxSize; while (mSize > mMaxSize) { mCache.removeOldest(); } } /////////////////////////////////////////////////////////////////////////////// // Callbacks /////////////////////////////////////////////////////////////////////////////// Loading libs/hwui/GradientCache.h +1 −5 Original line number Diff line number Diff line Loading @@ -122,10 +122,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 @@ -177,7 +173,7 @@ private: LruCache<GradientCacheEntry, Texture*> mCache; uint32_t mSize; uint32_t mMaxSize; const uint32_t mMaxSize; GLint mMaxTextureSize; bool mUseFloatTexture; Loading libs/hwui/PatchCache.cpp +2 −10 Original line number Diff line number Diff line Loading @@ -32,20 +32,12 @@ namespace uirenderer { PatchCache::PatchCache(RenderState& renderState) : mRenderState(renderState) , mMaxSize(Properties::patchCacheSize) , mSize(0) , mCache(LruCache<PatchDescription, Patch*>::kUnlimitedCapacity) , mMeshBuffer(0) , mFreeBlocks(nullptr) , mGenerationId(0) { char property[PROPERTY_VALUE_MAX]; if (property_get(PROPERTY_PATCH_CACHE_SIZE, property, nullptr) > 0) { INIT_LOGD(" Setting patch cache size to %skB", property); mMaxSize = KB(atoi(property)); } else { INIT_LOGD(" Using default patch cache size of %.2fkB", DEFAULT_PATCH_CACHE_SIZE); mMaxSize = KB(DEFAULT_PATCH_CACHE_SIZE); } } , mGenerationId(0) {} PatchCache::~PatchCache() { clear(); Loading libs/hwui/PatchCache.h +1 −1 Original line number Diff line number Diff line Loading @@ -169,7 +169,7 @@ private: #endif RenderState& mRenderState; uint32_t mMaxSize; const uint32_t mMaxSize; uint32_t mSize; LruCache<PatchDescription, Patch*> mCache; Loading Loading
libs/hwui/FboCache.cpp +2 −9 Original line number Diff line number Diff line Loading @@ -27,15 +27,8 @@ namespace uirenderer { // Constructors/destructor /////////////////////////////////////////////////////////////////////////////// FboCache::FboCache(): mMaxSize(DEFAULT_FBO_CACHE_SIZE) { char property[PROPERTY_VALUE_MAX]; if (property_get(PROPERTY_FBO_CACHE_SIZE, property, nullptr) > 0) { INIT_LOGD(" Setting fbo cache size to %s", property); mMaxSize = atoi(property); } else { INIT_LOGD(" Using default fbo cache size of %d", DEFAULT_FBO_CACHE_SIZE); } } FboCache::FboCache() : mMaxSize(Properties::fboCacheSize) {} FboCache::~FboCache() { clear(); Loading
libs/hwui/GradientCache.cpp +1 −16 Original line number Diff line number Diff line Loading @@ -65,17 +65,9 @@ int GradientCacheEntry::compare(const GradientCacheEntry& lhs, const GradientCac GradientCache::GradientCache(Extensions& extensions) : mCache(LruCache<GradientCacheEntry, Texture*>::kUnlimitedCapacity) , mSize(0) , mMaxSize(MB(DEFAULT_GRADIENT_CACHE_SIZE)) , mMaxSize(Properties::gradientCacheSize) , mUseFloatTexture(extensions.hasFloatTextures()) , mHasNpot(extensions.hasNPot()){ char property[PROPERTY_VALUE_MAX]; if (property_get(PROPERTY_GRADIENT_CACHE_SIZE, property, nullptr) > 0) { INIT_LOGD(" Setting gradient cache size to %sMB", property); setMaxSize(MB(atof(property))); } else { INIT_LOGD(" Using default gradient cache size of %.2fMB", DEFAULT_GRADIENT_CACHE_SIZE); } glGetIntegerv(GL_MAX_TEXTURE_SIZE, &mMaxTextureSize); mCache.setOnEntryRemovedListener(this); Loading @@ -97,13 +89,6 @@ uint32_t GradientCache::getMaxSize() { return mMaxSize; } void GradientCache::setMaxSize(uint32_t maxSize) { mMaxSize = maxSize; while (mSize > mMaxSize) { mCache.removeOldest(); } } /////////////////////////////////////////////////////////////////////////////// // Callbacks /////////////////////////////////////////////////////////////////////////////// Loading
libs/hwui/GradientCache.h +1 −5 Original line number Diff line number Diff line Loading @@ -122,10 +122,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 @@ -177,7 +173,7 @@ private: LruCache<GradientCacheEntry, Texture*> mCache; uint32_t mSize; uint32_t mMaxSize; const uint32_t mMaxSize; GLint mMaxTextureSize; bool mUseFloatTexture; Loading
libs/hwui/PatchCache.cpp +2 −10 Original line number Diff line number Diff line Loading @@ -32,20 +32,12 @@ namespace uirenderer { PatchCache::PatchCache(RenderState& renderState) : mRenderState(renderState) , mMaxSize(Properties::patchCacheSize) , mSize(0) , mCache(LruCache<PatchDescription, Patch*>::kUnlimitedCapacity) , mMeshBuffer(0) , mFreeBlocks(nullptr) , mGenerationId(0) { char property[PROPERTY_VALUE_MAX]; if (property_get(PROPERTY_PATCH_CACHE_SIZE, property, nullptr) > 0) { INIT_LOGD(" Setting patch cache size to %skB", property); mMaxSize = KB(atoi(property)); } else { INIT_LOGD(" Using default patch cache size of %.2fkB", DEFAULT_PATCH_CACHE_SIZE); mMaxSize = KB(DEFAULT_PATCH_CACHE_SIZE); } } , mGenerationId(0) {} PatchCache::~PatchCache() { clear(); Loading
libs/hwui/PatchCache.h +1 −1 Original line number Diff line number Diff line Loading @@ -169,7 +169,7 @@ private: #endif RenderState& mRenderState; uint32_t mMaxSize; const uint32_t mMaxSize; uint32_t mSize; LruCache<PatchDescription, Patch*> mCache; Loading