Move several property queries to Properties class
bug:17478770
This removes a lot of redundant property query code, and puts the
queries all in one place, so defining them automatically will be simpler
in the future.
Change-Id: I0428550e6081f07bc6554ffdf73b22284325abb8
diff --git a/libs/hwui/TessellationCache.cpp b/libs/hwui/TessellationCache.cpp
index fd9fb852..14c8f392 100644
--- a/libs/hwui/TessellationCache.cpp
+++ b/libs/hwui/TessellationCache.cpp
@@ -265,18 +265,9 @@
///////////////////////////////////////////////////////////////////////////////
TessellationCache::TessellationCache()
- : mSize(0)
- , mMaxSize(MB(DEFAULT_VERTEX_CACHE_SIZE))
+ : mMaxSize(Properties::tessellationCacheSize)
, mCache(LruCache<Description, Buffer*>::kUnlimitedCapacity)
, mShadowCache(LruCache<ShadowDescription, Task<vertexBuffer_pair_t*>*>::kUnlimitedCapacity) {
- char property[PROPERTY_VALUE_MAX];
- if (property_get(PROPERTY_VERTEX_CACHE_SIZE, property, nullptr) > 0) {
- INIT_LOGD(" Setting tessellation cache size to %sMB", property);
- setMaxSize(MB(atof(property)));
- } else {
- INIT_LOGD(" Using default tessellation cache size of %.2fMB", DEFAULT_VERTEX_CACHE_SIZE);
- }
-
mCache.setOnEntryRemovedListener(&mBufferRemovedListener);
mShadowCache.setOnEntryRemovedListener(&mBufferPairRemovedListener);
mDebugEnabled = Properties::debugLevel & kDebugCaches;
@@ -303,13 +294,6 @@
return mMaxSize;
}
-void TessellationCache::setMaxSize(uint32_t maxSize) {
- mMaxSize = maxSize;
- while (mSize > mMaxSize) {
- mCache.removeOldest();
- }
-}
-
///////////////////////////////////////////////////////////////////////////////
// Caching
///////////////////////////////////////////////////////////////////////////////