OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef Sk1DPathEffect_DEFINED | 8 #ifndef Sk1DPathEffect_DEFINED |
9 #define Sk1DPathEffect_DEFINED | 9 #define Sk1DPathEffect_DEFINED |
10 | 10 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 kLastEnum_Style = kMorph_Style, | 49 kLastEnum_Style = kMorph_Style, |
50 }; | 50 }; |
51 | 51 |
52 /** Dash by replicating the specified path. | 52 /** Dash by replicating the specified path. |
53 @param path The path to replicate (dash) | 53 @param path The path to replicate (dash) |
54 @param advance The space between instances of path | 54 @param advance The space between instances of path |
55 @param phase distance (mod advance) along path for its initial position | 55 @param phase distance (mod advance) along path for its initial position |
56 @param style how to transform path at each point (based on the current | 56 @param style how to transform path at each point (based on the current |
57 position and tangent) | 57 position and tangent) |
58 */ | 58 */ |
59 static SkPathEffect* Create(const SkPath& path, SkScalar advance, SkScalar p
hase, Style); | 59 static sk_sp<SkPathEffect> Make(const SkPath& path, SkScalar advance, SkScal
ar phase, Style); |
| 60 |
| 61 #ifdef SK_SUPPORT_LEGACY_PATHEFFECT_PTR |
| 62 static SkPathEffect* Create(const SkPath& path, SkScalar advance, SkScalar p
hase, Style s) { |
| 63 return Make(path, advance, phase, s).release(); |
| 64 } |
| 65 #endif |
60 | 66 |
61 virtual bool filterPath(SkPath*, const SkPath&, | 67 virtual bool filterPath(SkPath*, const SkPath&, |
62 SkStrokeRec*, const SkRect*) const override; | 68 SkStrokeRec*, const SkRect*) const override; |
63 | 69 |
64 SK_TO_STRING_OVERRIDE() | 70 SK_TO_STRING_OVERRIDE() |
65 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPath1DPathEffect) | 71 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPath1DPathEffect) |
66 | 72 |
67 protected: | 73 protected: |
68 SkPath1DPathEffect(const SkPath& path, SkScalar advance, SkScalar phase, Sty
le); | 74 SkPath1DPathEffect(const SkPath& path, SkScalar advance, SkScalar phase, Sty
le); |
69 void flatten(SkWriteBuffer&) const override; | 75 void flatten(SkWriteBuffer&) const override; |
70 | 76 |
71 // overrides from Sk1DPathEffect | 77 // overrides from Sk1DPathEffect |
72 SkScalar begin(SkScalar contourLength) const override; | 78 SkScalar begin(SkScalar contourLength) const override; |
73 SkScalar next(SkPath*, SkScalar, SkPathMeasure&) const override; | 79 SkScalar next(SkPath*, SkScalar, SkPathMeasure&) const override; |
74 | 80 |
75 private: | 81 private: |
76 SkPath fPath; // copied from constructor | 82 SkPath fPath; // copied from constructor |
77 SkScalar fAdvance; // copied from constructor | 83 SkScalar fAdvance; // copied from constructor |
78 SkScalar fInitialOffset; // computed from phase | 84 SkScalar fInitialOffset; // computed from phase |
79 Style fStyle; // copied from constructor | 85 Style fStyle; // copied from constructor |
80 | 86 |
81 typedef Sk1DPathEffect INHERITED; | 87 typedef Sk1DPathEffect INHERITED; |
82 }; | 88 }; |
83 | 89 |
84 #endif | 90 #endif |
OLD | NEW |