Add support to toggle different shader
behaviors

Updated HWUI to toggle overscroll stretch
implementation based on whether the
device supports high end graphics
or not

Bug: 187718492
Test: manual
Change-Id: I13a91a8861c07bec8af43268ba22d0f5b7060b4f
diff --git a/libs/hwui/Properties.h b/libs/hwui/Properties.h
index 9964254..f5fd003 100644
--- a/libs/hwui/Properties.h
+++ b/libs/hwui/Properties.h
@@ -171,8 +171,6 @@
  */
 #define PROPERTY_TARGET_CPU_TIME_PERCENTAGE "debug.hwui.target_cpu_time_percent"
 
-#define PROPERTY_STRETCH_EFFECT_TYPE "debug.hwui.stretch_mode"
-
 /**
  * Property for whether this is running in the emulator.
  */
@@ -278,9 +276,26 @@
     static bool useHintManager;
     static int targetCpuTimePercentage;
 
-    static StretchEffectBehavior stretchEffectBehavior;
+    static StretchEffectBehavior getStretchEffectBehavior() {
+        return stretchEffectBehavior;
+    }
+
+    static void setIsHighEndGfx(bool isHighEndGfx) {
+        stretchEffectBehavior = isHighEndGfx ?
+            StretchEffectBehavior::ShaderHWUI :
+            StretchEffectBehavior::UniformScale;
+    }
+
+    /**
+     * Used for testing. Typical configuration of stretch behavior is done
+     * through setIsHighEndGfx
+     */
+    static void setStretchEffectBehavior(StretchEffectBehavior behavior) {
+        stretchEffectBehavior = behavior;
+    }
 
 private:
+    static StretchEffectBehavior stretchEffectBehavior;
     static ProfileType sProfileType;
     static bool sDisableProfileBars;
     static RenderPipelineType sRenderPipelineType;