diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkLocalMatrixShader.cpp | 11 | ||||
-rw-r--r-- | src/core/SkLocalMatrixShader.h | 4 |
2 files changed, 12 insertions, 3 deletions
diff --git a/src/core/SkLocalMatrixShader.cpp b/src/core/SkLocalMatrixShader.cpp index 9d9e109fcb..22eb0fec93 100644 --- a/src/core/SkLocalMatrixShader.cpp +++ b/src/core/SkLocalMatrixShader.cpp @@ -51,6 +51,17 @@ SkShader::Context* SkLocalMatrixShader::onMakeContext( return fProxyShader->makeContext(newRec, alloc); } +SkImage* SkLocalMatrixShader::onIsAImage(SkMatrix* outMatrix, enum TileMode* mode) const { + SkMatrix imageMatrix; + SkImage* image = fProxyShader->isAImage(&imageMatrix, mode); + if (outMatrix) { + // Local matrix must be applied first so it is on the right side of the concat. + *outMatrix = SkMatrix::Concat(imageMatrix, this->getLocalMatrix()); + } + + return image; +} + bool SkLocalMatrixShader::onAppendStages(SkRasterPipeline* p, SkColorSpace* dst, SkArenaAlloc* scratch, diff --git a/src/core/SkLocalMatrixShader.h b/src/core/SkLocalMatrixShader.h index 5c0424053b..cba140906b 100644 --- a/src/core/SkLocalMatrixShader.h +++ b/src/core/SkLocalMatrixShader.h @@ -45,9 +45,7 @@ protected: Context* onMakeContext(const ContextRec&, SkArenaAlloc*) const override; - SkImage* onIsAImage(SkMatrix* matrix, TileMode* mode) const override { - return fProxyShader->isAImage(matrix, mode); - } + SkImage* onIsAImage(SkMatrix* matrix, TileMode* mode) const override; bool onAppendStages(SkRasterPipeline*, SkColorSpace*, SkArenaAlloc*, const SkMatrix&, const SkPaint&, const SkMatrix*) const override; |