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 11 #include "include/core/SkPaint.h" 12 #include "include/core/SkRefCnt.h" 13 #include "include/core/SkScalar.h" 14 #include "include/core/SkTypes.h" 15 #include "include/pathops/SkPathOps.h" 16 17 class SkMatrix; 18 class SkPathEffect; 19 20 class SK_API SkMergePathEffect { 21 public: 22 /* Defers to two other patheffects, and then combines their outputs using the specified op. 23 * e.g. 24 * result = output_one op output_two 25 * 26 * If either one or two is nullptr, then the original path is passed through to the op. 27 */ 28 static sk_sp<SkPathEffect> Make(sk_sp<SkPathEffect> one, sk_sp<SkPathEffect> two, SkPathOp op); 29 }; 30 31 class SK_API SkMatrixPathEffect { 32 public: 33 static sk_sp<SkPathEffect> MakeTranslate(SkScalar dx, SkScalar dy); 34 static sk_sp<SkPathEffect> Make(const SkMatrix&); 35 }; 36 37 class SK_API SkStrokePathEffect { 38 public: 39 static sk_sp<SkPathEffect> Make(SkScalar width, SkPaint::Join, SkPaint::Cap, 40 SkScalar miter = 4); 41 }; 42 43 #endif 44