aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pdf/SkPDFUtils.h
diff options
context:
space:
mode:
authorGravatar Hal Canary <halcanary@google.com>2017-05-26 17:01:16 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-06-05 19:22:46 +0000
commitd12a67626da4f5919b48c513fee80974f603473e (patch)
treee991cd2a37219732937291cf1a76fb2eca34214d /src/pdf/SkPDFUtils.h
parentf36031b68aa5b92204187c154fc5bc717db20a3a (diff)
SkPDF: Draw paths with mask filters; color filter.
Also: - drawPaint, drawPath w/ perspective shaders - text with mask filters, stroking, path effect. - SkPDFUtils::GetShaderLocalMatrix BUG=skia:237 BUG=skia:238 BUG=skia:5607 Change-Id: Iffeaf2d7abbde13fd2577ce9feaa178657f48364 Reviewed-on: https://skia-review.googlesource.com/18200 Commit-Queue: Hal Canary <halcanary@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
Diffstat (limited to 'src/pdf/SkPDFUtils.h')
-rw-r--r--src/pdf/SkPDFUtils.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/pdf/SkPDFUtils.h b/src/pdf/SkPDFUtils.h
index 00c4b72b7b..c1d9a72250 100644
--- a/src/pdf/SkPDFUtils.h
+++ b/src/pdf/SkPDFUtils.h
@@ -11,6 +11,7 @@
#include "SkPaint.h"
#include "SkPath.h"
+#include "SkShader.h"
#include "SkStream.h"
#include "SkUtils.h"
@@ -111,6 +112,14 @@ static sk_sp<T> GetCachedT(sk_sp<T>* cachedT, sk_sp<T> (*makeNewT)()) {
*cachedT = (*makeNewT)();
return *cachedT;
}
+
+inline SkMatrix GetShaderLocalMatrix(const SkShader* shader) {
+ SkMatrix localMatrix;
+ if (sk_sp<SkShader> s = shader->makeAsALocalMatrixShader(&localMatrix)) {
+ return SkMatrix::Concat(s->getLocalMatrix(), localMatrix);
+ }
+ return shader->getLocalMatrix();
+}
} // namespace SkPDFUtils
#endif