SkShaderBase::isAPicture()
motivation: will be used by SkPDF backend in later CL.
Bug: chromium:967418
Change-Id: I1002c290f70245cce7ae2cf759d3eaf54cb8cd81
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/216873
Commit-Queue: Hal Canary <halcanary@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Auto-Submit: Hal Canary <halcanary@google.com>
diff --git a/src/shaders/SkLocalMatrixShader.cpp b/src/shaders/SkLocalMatrixShader.cpp
index 4f120fe..be9a6fa 100644
--- a/src/shaders/SkLocalMatrixShader.cpp
+++ b/src/shaders/SkLocalMatrixShader.cpp
@@ -62,6 +62,17 @@
return image;
}
+SkPicture* SkLocalMatrixShader::isAPicture(SkMatrix* matrix,
+ SkTileMode tileModes[2],
+ SkRect* tile) const {
+ SkMatrix proxyMatrix;
+ SkPicture* picture = as_SB(fProxyShader)->isAPicture(&proxyMatrix, tileModes, tile);
+ if (picture && matrix) {
+ *matrix = SkMatrix::Concat(proxyMatrix, this->getLocalMatrix());
+ }
+ return picture;
+}
+
bool SkLocalMatrixShader::onAppendStages(const SkStageRec& rec) const {
SkTCopyOnFirstWrite<SkMatrix> lm(this->getLocalMatrix());
if (rec.fLocalM) {