diff options
author | 2015-11-11 16:42:34 -0800 | |
---|---|---|
committer | 2015-11-12 13:05:35 -0800 | |
commit | 9fded232a9548a304e0145011df8849fba0dcda7 (patch) | |
tree | ffe48b03342817dd2681825498ecdf3799e01a0d /libs/hwui/Properties.cpp | |
parent | 8b8be50c640a13b98d364b3f36962d9cf185d6d9 (diff) |
Recycle OffscreenBuffers
Change-Id: Ia2e219026f211a5308ecf8209c5f986bb888aadd
Diffstat (limited to 'libs/hwui/Properties.cpp')
-rw-r--r-- | libs/hwui/Properties.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/libs/hwui/Properties.cpp b/libs/hwui/Properties.cpp index e81818679f3e..0669596b21ca 100644 --- a/libs/hwui/Properties.cpp +++ b/libs/hwui/Properties.cpp @@ -37,6 +37,7 @@ bool Properties::useBufferAge = true; bool Properties::enablePartialUpdates = true; float Properties::textGamma = DEFAULT_TEXT_GAMMA; +int Properties::layerPoolSize = DEFAULT_LAYER_CACHE_SIZE; DebugLevel Properties::debugLevel = kDebugDisabled; OverdrawColorSet Properties::overdrawColorSet = OverdrawColorSet::Default; @@ -52,10 +53,19 @@ int Properties::overrideSpotShadowStrength = -1; ProfileType Properties::sProfileType = ProfileType::None; bool Properties::sDisableProfileBars = false; +static int property_get_int(const char* key, int defaultValue) { + char buf[PROPERTY_VALUE_MAX] = {'\0',}; + + if (property_get(key, buf, "") > 0) { + return atoi(buf); + } + return defaultValue; +} + static float property_get_float(const char* key, float defaultValue) { char buf[PROPERTY_VALUE_MAX] = {'\0',}; - if (property_get(PROPERTY_PROFILE, buf, "") > 0) { + if (property_get(key, buf, "") > 0) { return atof(buf); } return defaultValue; @@ -114,16 +124,14 @@ bool Properties::load() { showDirtyRegions = property_get_bool(PROPERTY_DEBUG_SHOW_DIRTY_REGIONS, false); - debugLevel = kDebugDisabled; - if (property_get(PROPERTY_DEBUG, property, nullptr) > 0) { - debugLevel = (DebugLevel) atoi(property); - } + debugLevel = (DebugLevel) property_get_int(PROPERTY_DEBUG, kDebugDisabled); skipEmptyFrames = property_get_bool(PROPERTY_SKIP_EMPTY_DAMAGE, true); useBufferAge = property_get_bool(PROPERTY_USE_BUFFER_AGE, true); enablePartialUpdates = property_get_bool(PROPERTY_ENABLE_PARTIAL_UPDATES, true); textGamma = property_get_float(PROPERTY_TEXT_GAMMA, DEFAULT_TEXT_GAMMA); + layerPoolSize = MB(property_get_float(PROPERTY_LAYER_CACHE_SIZE, DEFAULT_LAYER_CACHE_SIZE)); return (prevDebugLayersUpdates != debugLayersUpdates) || (prevDebugOverdraw != debugOverdraw) |