Add a linear variant of the stretch effect

Supports SurfaceViews & everything

Test: setprop debug.hwui.stretch_mode 1
Bug: 187718492
Change-Id: I9a222fa4c1a40e80a74cdaf75becb9524cbeed9b
diff --git a/libs/hwui/RenderNode.cpp b/libs/hwui/RenderNode.cpp
index fce2e1f..64abd94 100644
--- a/libs/hwui/RenderNode.cpp
+++ b/libs/hwui/RenderNode.cpp
@@ -477,6 +477,14 @@
             }
         }
     }
+
+    if (Properties::stretchEffectBehavior == StretchEffectBehavior::LinearScale) {
+        const StretchEffect& stretch = properties().layerProperties().getStretchEffect();
+        if (!stretch.isEmpty()) {
+            matrix.multiply(
+                    stretch.makeLinearStretch(properties().getWidth(), properties().getHeight()));
+        }
+    }
 }
 
 const SkPath* RenderNode::getClippedOutline(const SkRect& clipRect) const {