diff options
author | 2019-04-11 16:11:24 -0700 | |
---|---|---|
committer | 2019-04-18 14:20:56 -0700 | |
commit | cf185f5b0d30516ecb34350a585aed7f7d4e0672 (patch) | |
tree | 4235b69aa096175a3e01db7ea62e7c1bcab30603 /libs/hwui/Properties.cpp | |
parent | c4a3f5c3777da82d6f452d26f684a65e97ed963c (diff) |
Dynamically adjust renderahead
Tracks refresh rate changes and adjusts renderahead
based off of the active refresh rate.
Default is 60hz = 0 render ahead & > 70hz is render ahead 1
Bug: 127822449
Test: systraced stuff
Change-Id: I9849aa065262f21f7602d44cd1761373279dc28d
Diffstat (limited to 'libs/hwui/Properties.cpp')
-rw-r--r-- | libs/hwui/Properties.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libs/hwui/Properties.cpp b/libs/hwui/Properties.cpp index 99988542d619..19f509ce8fd7 100644 --- a/libs/hwui/Properties.cpp +++ b/libs/hwui/Properties.cpp @@ -67,7 +67,7 @@ bool Properties::debuggingEnabled = false; bool Properties::isolatedProcess = false; int Properties::contextPriority = 0; -uint32_t Properties::defaultRenderAhead = 0; +int Properties::defaultRenderAhead = -1; static int property_get_int(const char* key, int defaultValue) { char buf[PROPERTY_VALUE_MAX] = { @@ -130,9 +130,8 @@ bool Properties::load() { enableForceDarkSupport = property_get_bool(PROPERTY_ENABLE_FORCE_DARK, true); - defaultRenderAhead = - std::max(0u, std::min(2u, static_cast<uint32_t>(property_get_int( - PROPERTY_RENDERAHEAD, render_ahead().value_or(0))))); + defaultRenderAhead = std::max(-1, std::min(2, property_get_int(PROPERTY_RENDERAHEAD, + render_ahead().value_or(0)))); return (prevDebugLayersUpdates != debugLayersUpdates) || (prevDebugOverdraw != debugOverdraw); } |