diff options
author | 2015-08-19 13:32:12 -0700 | |
---|---|---|
committer | 2015-08-19 13:32:15 -0700 | |
commit | 6daa13c5fa7577fa1d8371deca446f6ca911f38f (patch) | |
tree | fa5d3ed346371a41ea6335676f77750cb0f733fc /libs/hwui/OpenGLRenderer.cpp | |
parent | e264f9a51ef2158df345c3c4b19dd6098e959141 (diff) |
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
Diffstat (limited to 'libs/hwui/OpenGLRenderer.cpp')
-rw-r--r-- | libs/hwui/OpenGLRenderer.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
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) { |