aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkLocalMatrixShader.cpp
diff options
context:
space:
mode:
authorGravatar Matt Sarett <msarett@google.com>2017-04-12 10:21:30 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-04-12 15:11:03 +0000
commite5efa51b2acc86d1993132348d5b465855a653cc (patch)
tree4f8431dc47f3764f80d529c28e0d2e34828d2e42 /src/core/SkLocalMatrixShader.cpp
parent5d884b562828ceb13ccacb71bc4581d2020e62bb (diff)
Fix SkLocalMatrixShader::isAImage() to respect local matrix and image local matrix
Fixes cts tests. b/37161109 b/37237678 Bug: skia: Change-Id: Ida9ac5e4261e8a6b22e8cdc0e585e0e7929dbbfd Reviewed-on: https://skia-review.googlesource.com/13249 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'src/core/SkLocalMatrixShader.cpp')
-rw-r--r--src/core/SkLocalMatrixShader.cpp11
1 files changed, 11 insertions, 0 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,