diff options
author | 2021-05-10 22:12:48 +0000 | |
---|---|---|
committer | 2021-05-10 22:12:48 +0000 | |
commit | 020efbc1a8feda5670f1b7b7cd75e79dcacbaa94 (patch) | |
tree | 47343aebfbb96daff0bb9bf62ba458410d49ec12 /libs/hwui/Properties.cpp | |
parent | d825a07bc472f206a0066d6a11a32ac6deebe1f7 (diff) | |
parent | 8ed00dc56d5af7483ed053eb88c550cc1035b029 (diff) |
Merge "Add a linear variant of the stretch effect" into sc-dev
Diffstat (limited to 'libs/hwui/Properties.cpp')
-rw-r--r-- | libs/hwui/Properties.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libs/hwui/Properties.cpp b/libs/hwui/Properties.cpp index 7af0a221d228..c58c888b8a21 100644 --- a/libs/hwui/Properties.cpp +++ b/libs/hwui/Properties.cpp @@ -84,6 +84,8 @@ float Properties::defaultSdrWhitePoint = 200.f; bool Properties::useHintManager = true; int Properties::targetCpuTimePercentage = 70; +StretchEffectBehavior Properties::stretchEffectBehavior = StretchEffectBehavior::Shader; + bool Properties::load() { bool prevDebugLayersUpdates = debugLayersUpdates; bool prevDebugOverdraw = debugOverdraw; @@ -135,6 +137,10 @@ bool Properties::load() { targetCpuTimePercentage = base::GetIntProperty(PROPERTY_TARGET_CPU_TIME_PERCENTAGE, 70); if (targetCpuTimePercentage <= 0 || targetCpuTimePercentage > 100) targetCpuTimePercentage = 70; + int stretchType = base::GetIntProperty(PROPERTY_STRETCH_EFFECT_TYPE, 0); + stretchType = std::clamp(stretchType, 0, static_cast<int>(StretchEffectBehavior::LinearScale)); + stretchEffectBehavior = static_cast<StretchEffectBehavior>(stretchType); + return (prevDebugLayersUpdates != debugLayersUpdates) || (prevDebugOverdraw != debugOverdraw); } |