summaryrefslogtreecommitdiff
path: root/libs/hwui/Properties.cpp
diff options
context:
space:
mode:
author John Reck <jreck@google.com> 2021-05-10 13:09:27 -0400
committer Nader Jawad <njawad@google.com> 2021-05-10 11:33:20 -0700
commit8ed00dc56d5af7483ed053eb88c550cc1035b029 (patch)
treec940d7202f886357ce4e63a0d6be528b8097a426 /libs/hwui/Properties.cpp
parentbc341860f042edb649055042c955cb9e38fd65a6 (diff)
Add a linear variant of the stretch effect
Supports SurfaceViews & everything Test: setprop debug.hwui.stretch_mode 1 Bug: 187718492 Change-Id: I9a222fa4c1a40e80a74cdaf75becb9524cbeed9b
Diffstat (limited to 'libs/hwui/Properties.cpp')
-rw-r--r--libs/hwui/Properties.cpp6
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);
}