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 |
11 #include "SkPathEffect.h" | 11 #include "SkPathEffect.h" |
12 #include "SkPath.h" | 12 #include "SkPath.h" |
13 | 13 |
14 class SkPathMeasure; | 14 class SkPathMeasure; |
15 | 15 |
16 // This class is not exported to java. | 16 // This class is not exported to java. |
17 class SK_API Sk1DPathEffect : public SkPathEffect { | 17 class SK_API Sk1DPathEffect : public SkPathEffect { |
| 18 typedef SkPathEffect INHERITED; |
| 19 |
18 public: | 20 public: |
19 virtual bool filterPath(SkPath* dst, const SkPath& src, | 21 virtual bool filterPath(SkPath* dst, const SkPath& src, |
20 SkStrokeRec*, const SkRect*) const SK_OVERRIDE; | 22 SkStrokeRec*, const SkRect*) const SK_OVERRIDE; |
21 | 23 |
22 protected: | 24 protected: |
23 /** Called at the start of each contour, returns the initial offset | 25 /** Called at the start of each contour, returns the initial offset |
24 into that contour. | 26 into that contour. |
25 */ | 27 */ |
26 virtual SkScalar begin(SkScalar contourLength) const = 0; | 28 virtual SkScalar begin(SkScalar contourLength) const = 0; |
27 /** Called with the current distance along the path, with the current matrix | 29 /** Called with the current distance along the path, with the current matrix |
28 for the point/tangent at the specified distance. | 30 for the point/tangent at the specified distance. |
29 Return the distance to travel for the next call. If return <= 0, then th
at | 31 Return the distance to travel for the next call. If return <= 0, then th
at |
30 contour is done. | 32 contour is done. |
31 */ | 33 */ |
32 virtual SkScalar next(SkPath* dst, SkScalar dist, SkPathMeasure&) const = 0; | 34 virtual SkScalar next(SkPath* dst, SkScalar dist, SkPathMeasure&) const = 0; |
33 | |
34 private: | |
35 typedef SkPathEffect INHERITED; | |
36 }; | 35 }; |
37 | 36 |
38 class SK_API SkPath1DPathEffect : public Sk1DPathEffect { | 37 class SK_API SkPath1DPathEffect : public Sk1DPathEffect { |
| 38 typedef Sk1DPathEffect INHERITED; |
| 39 |
39 public: | 40 public: |
40 enum Style { | 41 enum Style { |
41 kTranslate_Style, // translate the shape to each position | 42 kTranslate_Style, // translate the shape to each position |
42 kRotate_Style, // rotate the shape about its center | 43 kRotate_Style, // rotate the shape about its center |
43 kMorph_Style, // transform each point, and turn lines into curves | 44 kMorph_Style, // transform each point, and turn lines into curves |
44 | 45 |
45 kStyleCount | 46 kStyleCount |
46 }; | 47 }; |
47 | 48 |
48 /** Dash by replicating the specified path. | 49 /** Dash by replicating the specified path. |
(...skipping 16 matching lines...) Expand all Loading... |
65 | 66 |
66 // overrides from Sk1DPathEffect | 67 // overrides from Sk1DPathEffect |
67 virtual SkScalar begin(SkScalar contourLength) const SK_OVERRIDE; | 68 virtual SkScalar begin(SkScalar contourLength) const SK_OVERRIDE; |
68 virtual SkScalar next(SkPath*, SkScalar, SkPathMeasure&) const SK_OVERRIDE; | 69 virtual SkScalar next(SkPath*, SkScalar, SkPathMeasure&) const SK_OVERRIDE; |
69 | 70 |
70 private: | 71 private: |
71 SkPath fPath; // copied from constructor | 72 SkPath fPath; // copied from constructor |
72 SkScalar fAdvance; // copied from constructor | 73 SkScalar fAdvance; // copied from constructor |
73 SkScalar fInitialOffset; // computed from phase | 74 SkScalar fInitialOffset; // computed from phase |
74 Style fStyle; // copied from constructor | 75 Style fStyle; // copied from constructor |
75 | |
76 typedef Sk1DPathEffect INHERITED; | |
77 }; | 76 }; |
78 | 77 |
79 #endif | 78 #endif |
OLD | NEW |