diff options
author | robertphillips <robertphillips@google.com> | 2014-10-22 05:33:52 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-22 05:33:52 -0700 |
commit | 9e6835da41e344ef3c4c35036fabfdb0a4146c33 (patch) | |
tree | 0dffa73275ac2426b99b8960aff262ca8a6022b0 /src/gpu/GrPictureUtils.cpp | |
parent | f802f326f46aebd9fbad5ffe63450f0dcad948bb (diff) |
Track nested picture xform state for layer hoisting
The accumulated matrix state of any enclosing SkPictures must be stored separate from the picture-local CTM. Any setMatrix calls inside a layer need to replace the picture-local CTM but concatenate with the enclosing SkPicture transform state (and the transform state needed to translate the layer to the correct location in the cached GrTexture).
Review URL: https://codereview.chromium.org/639863005
Diffstat (limited to 'src/gpu/GrPictureUtils.cpp')
-rw-r--r-- | src/gpu/GrPictureUtils.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gpu/GrPictureUtils.cpp b/src/gpu/GrPictureUtils.cpp index a215a0e7a6..e91980fa10 100644 --- a/src/gpu/GrPictureUtils.cpp +++ b/src/gpu/GrPictureUtils.cpp @@ -124,8 +124,9 @@ private: dst.fPicture = src.fPicture ? src.fPicture : static_cast<const SkPicture*>(dp.picture); dst.fPicture->ref(); dst.fBounds = newClip; - dst.fOriginXform = src.fOriginXform; - dst.fOriginXform.postConcat(*fCTM); + dst.fLocalMat = src.fLocalMat; + dst.fPreMat = src.fPreMat; + dst.fPreMat.preConcat(*fCTM); if (src.fPaint) { dst.fPaint = SkNEW_ARGS(SkPaint, (*src.fPaint)); } @@ -180,7 +181,8 @@ private: SkASSERT(NULL == slInfo.fPicture); // This layer is in the top-most picture slInfo.fBounds = si.fBounds; - slInfo.fOriginXform = *fCTM; + slInfo.fLocalMat = *fCTM; + slInfo.fPreMat = SkMatrix::I(); if (si.fPaint) { slInfo.fPaint = SkNEW_ARGS(SkPaint, (*si.fPaint)); } |