New setLocalMatrix() operation for HWUI

Concats any matrix passed through from DisplayListCanvas with the
initialTransform of the containing RenderNode.

BUG:22189925

Change-Id: I5ea54a6e2a29520c79a8860bde7682694e8595d2
diff --git a/libs/hwui/OpenGLRenderer.h b/libs/hwui/OpenGLRenderer.h
index 800a9f9..402f6ed 100755
--- a/libs/hwui/OpenGLRenderer.h
+++ b/libs/hwui/OpenGLRenderer.h
@@ -368,6 +368,7 @@
 
     void getMatrix(SkMatrix* outMatrix) const { mState.getMatrix(outMatrix); }
     void setMatrix(const SkMatrix& matrix) { mState.setMatrix(matrix); }
+    void setLocalMatrix(const SkMatrix& matrix);
     void concatMatrix(const SkMatrix& matrix) { mState.concatMatrix(matrix); }
 
     void translate(float dx, float dy, float dz = 0.0f);
@@ -418,6 +419,8 @@
         return returnPath;
     }
 
+    void setBaseTransform(const Matrix4& matrix) { mBaseTransform = matrix; }
+
 protected:
     /**
      * Perform the setup specific to a frame. This method does not
@@ -877,6 +880,16 @@
     // Paths kept alive for the duration of the frame
     std::vector<std::unique_ptr<SkPath>> mTempPaths;
 
+    /**
+     * Initial transform for a rendering pass; transform from global device
+     * coordinates to the current RenderNode's drawing content coordinates,
+     * with the RenderNode's RenderProperty transforms already applied.
+     * Calling setMatrix(mBaseTransform) will result in drawing at the origin
+     * of the DisplayList's recorded surface prior to any Canvas
+     * transformation.
+     */
+    Matrix4 mBaseTransform;
+
     friend class Layer;
     friend class TextDrawFunctor;
     friend class DrawBitmapOp;