Mike Reed | 0ef539a | 2018-07-18 13:28:42 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2018 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #ifndef SkOpPathEffect_DEFINED |
| 9 | #define SkOpPathEffect_DEFINED |
| 10 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 11 | #include "include/core/SkPaint.h" |
| 12 | #include "include/core/SkPathEffect.h" |
| 13 | #include "include/pathops/SkPathOps.h" |
Mike Reed | 0ef539a | 2018-07-18 13:28:42 -0400 | [diff] [blame] | 14 | |
Martin Vejdarski | 8842799 | 2019-04-04 23:32:22 +0700 | [diff] [blame] | 15 | class SK_API SkMergePathEffect { |
Mike Reed | 0ef539a | 2018-07-18 13:28:42 -0400 | [diff] [blame] | 16 | public: |
| 17 | /* Defers to two other patheffects, and then combines their outputs using the specified op. |
| 18 | * e.g. |
| 19 | * result = output_one op output_two |
| 20 | * |
| 21 | * If either one or two is nullptr, then the original path is passed through to the op. |
| 22 | */ |
| 23 | static sk_sp<SkPathEffect> Make(sk_sp<SkPathEffect> one, sk_sp<SkPathEffect> two, SkPathOp op); |
| 24 | }; |
| 25 | |
Martin Vejdarski | 8842799 | 2019-04-04 23:32:22 +0700 | [diff] [blame] | 26 | class SK_API SkMatrixPathEffect { |
Mike Reed | 0ef539a | 2018-07-18 13:28:42 -0400 | [diff] [blame] | 27 | public: |
| 28 | static sk_sp<SkPathEffect> MakeTranslate(SkScalar dx, SkScalar dy); |
| 29 | static sk_sp<SkPathEffect> Make(const SkMatrix&); |
| 30 | }; |
| 31 | |
Martin Vejdarski | 8842799 | 2019-04-04 23:32:22 +0700 | [diff] [blame] | 32 | class SK_API SkStrokePathEffect { |
Mike Reed | 0ef539a | 2018-07-18 13:28:42 -0400 | [diff] [blame] | 33 | public: |
| 34 | static sk_sp<SkPathEffect> Make(SkScalar width, SkPaint::Join, SkPaint::Cap, |
| 35 | SkScalar miter = 4); |
| 36 | }; |
| 37 | |
| 38 | #endif |