From 6daa13c5fa7577fa1d8371deca446f6ca911f38f Mon Sep 17 00:00:00 2001 From: Chris Craik Date: Wed, 19 Aug 2015 13:32:12 -0700 Subject: Change setMatrix behavior to only affect canvas-local matrix bug:22189925 This makes setMatrix(getMatrix()) work as expected, and makes setMatrix() much more useful without changing behavior relative to a View's parent hierarchy. Change-Id: I608613bd27c1b9052ae583f8fd2119cf37a2f6d7 --- libs/hwui/OpenGLRenderer.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'libs/hwui/OpenGLRenderer.cpp') diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index 7a56d42b65e2..827404fc22d4 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -1151,7 +1151,7 @@ bool OpenGLRenderer::storeDisplayState(DeferredDisplayState& state, int stateDef } void OpenGLRenderer::restoreDisplayState(const DeferredDisplayState& state, bool skipClipRestore) { - setMatrix(state.mMatrix); + setGlobalMatrix(state.mMatrix); writableSnapshot()->alpha = state.mAlpha; writableSnapshot()->roundRectClipState = state.mRoundRectClipState; writableSnapshot()->projectionPathMask = state.mProjectionPathMask; @@ -2098,8 +2098,9 @@ void OpenGLRenderer::skew(float sx, float sy) { mState.skew(sx, sy); } -void OpenGLRenderer::setMatrix(const Matrix4& matrix) { - mState.setMatrix(matrix); +void OpenGLRenderer::setLocalMatrix(const Matrix4& matrix) { + mState.setMatrix(mBaseTransform); + mState.concatMatrix(matrix); } void OpenGLRenderer::setLocalMatrix(const SkMatrix& matrix) { -- cgit v1.2.3-59-g8ed1b