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.cpp b/libs/hwui/OpenGLRenderer.cpp
index 87ed84f..0c42b92 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -2148,6 +2148,7 @@
mState.restoreToCount(saveCount);
}
+
void OpenGLRenderer::translate(float dx, float dy, float dz) {
mState.translate(dx, dy, dz);
}
@@ -2168,6 +2169,11 @@
mState.setMatrix(matrix);
}
+void OpenGLRenderer::setLocalMatrix(const SkMatrix& matrix) {
+ mState.setMatrix(mBaseTransform);
+ mState.concatMatrix(matrix);
+}
+
void OpenGLRenderer::concatMatrix(const Matrix4& matrix) {
mState.concatMatrix(matrix);
}