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/PatchCache.cpp b/libs/hwui/PatchCache.cpp
index 9881280..bd6feb9 100644
--- a/libs/hwui/PatchCache.cpp
+++ b/libs/hwui/PatchCache.cpp
@@ -32,20 +32,12 @@
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();