aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/effects/SkTrimPathEffect.h
diff options
context:
space:
mode:
authorGravatar Florin Malita <fmalita@chromium.org>2018-03-09 16:08:58 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-12 14:07:28 +0000
commit827af667bbe8e057f9ee08e9f9b598add232b491 (patch)
tree5e324fbfcb83944332f11834342dfd188f0c5c09 /include/effects/SkTrimPathEffect.h
parent8e03f6930f8e033f3cabfda1a7fba9a6013e3d19 (diff)
Extend SkTrimPathEffect semantics
Add support for multiple contours, and an explicit "inverted" mode. Bug: skia: Change-Id: Iafadbbe9d4692f2467a4ef8585f7fcd9cee9566a Reviewed-on: https://skia-review.googlesource.com/113270 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org>
Diffstat (limited to 'include/effects/SkTrimPathEffect.h')
-rw-r--r--include/effects/SkTrimPathEffect.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/include/effects/SkTrimPathEffect.h b/include/effects/SkTrimPathEffect.h
index d40c9e2bbf..e96b94f83e 100644
--- a/include/effects/SkTrimPathEffect.h
+++ b/include/effects/SkTrimPathEffect.h
@@ -12,6 +12,11 @@
class SK_API SkTrimPathEffect {
public:
+ enum class Mode {
+ kNormal, // return the subset path [start,stop]
+ kInverted, // return the complement/subset paths [0,start] + [stop,1]
+ };
+
/**
* Take start and stop "t" values (values between 0...1), and return a path that is that
* subset of the original path.
@@ -26,11 +31,11 @@ public:
* startT and stopT must be 0..1 inclusive. If they are outside of that interval, they will
* be pinned to the nearest legal value. If either is NaN, null will be returned.
*
- * Note: if startT < stopT, this will return one (logical) segment (even if it is spread
- * across multiple contours). If startT > stopT, then this will return 2 logical
+ * Note: for Mode::kNormal, this will return one (logical) segment (even if it is spread
+ * across multiple contours). For Mode::kInverted, this will return 2 logical
* segments: 0...stopT and startT...1
*/
- static sk_sp<SkPathEffect> Make(SkScalar startT, SkScalar stopT);
+ static sk_sp<SkPathEffect> Make(SkScalar startT, SkScalar stopT, Mode = Mode::kNormal);
};
#endif