Pass CTM to path effects (experimental)

Add an overload to SkPathEffect that can be used when the CTM is known
at the callsite. GPU callsites are not handled here, that will be
tackled in a separate CL.

Path effects must implement the filterPath virtual that accepts the CTM,
although they are not obligated to use it. If a path effect does
use the CTM, the output geometry must be in the original coordinate
space, not device space.

Bug: skia:11957
Change-Id: I01615985599fe2736de954bb10dac881b0554ae7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/420239
Commit-Queue: Tyler Denniston <tdenniston@google.com>
Reviewed-by: Mike Reed <reed@google.com>
diff --git a/src/gpu/GrStyle.cpp b/src/gpu/GrStyle.cpp
index caf361b..1d5a48b 100644
--- a/src/gpu/GrStyle.cpp
+++ b/src/gpu/GrStyle.cpp
@@ -130,10 +130,15 @@
     if (!fPathEffect) {
         return false;
     }
+
+    // TODO: [skbug.com/11957] Plumb CTM callers and pass it to filterPath().
+    SkASSERT(!fPathEffect->needsCTM());
+
     if (SkPathEffect::kDash_DashType == fDashInfo.fType) {
         // We apply the dash ourselves here rather than using the path effect. This is so that
         // we can control whether the dasher applies the strokeRec for special cases. Our keying
         // depends on the strokeRec being applied separately.
+        SkASSERT(!fPathEffect->needsCTM());  // Make sure specified PE doesn't need CTM
         SkScalar phase = fDashInfo.fPhase;
         const SkScalar* intervals = fDashInfo.fIntervals.get();
         int intervalCnt = fDashInfo.fIntervals.count();