OLD | NEW |
---|---|
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #ifndef SkPath_DEFINED | 10 #ifndef SkPath_DEFINED |
(...skipping 22 matching lines...) Expand all Loading... | |
33 /** \class SkPath | 33 /** \class SkPath |
34 | 34 |
35 The SkPath class encapsulates compound (multiple contour) geometric paths | 35 The SkPath class encapsulates compound (multiple contour) geometric paths |
36 consisting of straight line segments, quadratic curves, and cubic curves. | 36 consisting of straight line segments, quadratic curves, and cubic curves. |
37 */ | 37 */ |
38 class SK_API SkPath { | 38 class SK_API SkPath { |
39 public: | 39 public: |
40 SK_DECLARE_INST_COUNT_ROOT(SkPath); | 40 SK_DECLARE_INST_COUNT_ROOT(SkPath); |
41 | 41 |
42 SkPath(); | 42 SkPath(); |
43 SkPath(const SkPath&); | 43 SkPath(const SkPath&); // Copies fGenerationID on Android. |
44 SkPath& operator=(const SkPath&); // Increments fGenerationID on Android. | |
reed1
2013/08/06 21:15:09
:( nit: Skia mostly likes only constructors/destru
mtklein
2013/08/06 21:18:47
Done.
| |
44 ~SkPath(); | 45 ~SkPath(); |
45 | 46 |
46 SkPath& operator=(const SkPath&); | |
47 | |
48 friend SK_API bool operator==(const SkPath&, const SkPath&); | 47 friend SK_API bool operator==(const SkPath&, const SkPath&); |
49 friend bool operator!=(const SkPath& a, const SkPath& b) { | 48 friend bool operator!=(const SkPath& a, const SkPath& b) { |
50 return !(a == b); | 49 return !(a == b); |
51 } | 50 } |
52 | 51 |
53 enum FillType { | 52 enum FillType { |
54 /** Specifies that "inside" is computed by a non-zero sum of signed | 53 /** Specifies that "inside" is computed by a non-zero sum of signed |
55 edge crossings | 54 edge crossings |
56 */ | 55 */ |
57 kWinding_FillType, | 56 kWinding_FillType, |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
160 * | 159 * |
161 * @return true if this path is an oval. | 160 * @return true if this path is an oval. |
162 * Tracking whether a path is an oval is considered an | 161 * Tracking whether a path is an oval is considered an |
163 * optimization for performance and so some paths that are in | 162 * optimization for performance and so some paths that are in |
164 * fact ovals can report false. | 163 * fact ovals can report false. |
165 */ | 164 */ |
166 bool isOval(SkRect* rect) const; | 165 bool isOval(SkRect* rect) const; |
167 | 166 |
168 /** Clear any lines and curves from the path, making it empty. This frees up | 167 /** Clear any lines and curves from the path, making it empty. This frees up |
169 internal storage associated with those segments. | 168 internal storage associated with those segments. |
170 This does NOT change the fill-type setting nor isConvex | |
reed1
2013/08/06 21:15:09
Were these comments wrong or misleading?
mtklein
2013/08/06 21:18:47
Yes, wrong. The same CL that caused the bug chang
| |
171 */ | 169 */ |
172 void reset(); | 170 void reset(); |
173 | 171 |
174 /** Similar to reset(), in that all lines and curves are removed from the | 172 /** Similar to reset(), in that all lines and curves are removed from the |
175 path. However, any internal storage for those lines/curves is retained, | 173 path. However, any internal storage for those lines/curves is retained, |
176 making reuse of the path potentially faster. | 174 making reuse of the path potentially faster. |
177 This does NOT change the fill-type setting nor isConvex | |
178 */ | 175 */ |
179 void rewind(); | 176 void rewind(); |
180 | 177 |
181 /** Returns true if the path is empty (contains no lines or curves) | 178 /** Returns true if the path is empty (contains no lines or curves) |
182 | 179 |
183 @return true if the path is empty (contains no lines or curves) | 180 @return true if the path is empty (contains no lines or curves) |
184 */ | 181 */ |
185 bool isEmpty() const; | 182 bool isEmpty() const; |
186 | 183 |
187 /** | 184 /** |
(...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
958 #endif | 955 #endif |
959 | 956 |
960 /** Resets all fields other than fPathRef to their initial 'empty' values. | 957 /** Resets all fields other than fPathRef to their initial 'empty' values. |
961 * Assumes the caller has already emptied fPathRef. | 958 * Assumes the caller has already emptied fPathRef. |
962 * On Android increments fGenerationID without reseting it. | 959 * On Android increments fGenerationID without reseting it. |
963 */ | 960 */ |
964 void resetFields(); | 961 void resetFields(); |
965 | 962 |
966 /** Sets all fields other than fPathRef to the values in 'that'. | 963 /** Sets all fields other than fPathRef to the values in 'that'. |
967 * Assumes the caller has already set fPathRef. | 964 * Assumes the caller has already set fPathRef. |
968 * On Android increments fGenerationID without copying it. | 965 * Doesn't change fGenerationID or fSourcePath on Android. |
969 * On Android sets fSourcePath to NULL. | |
970 */ | 966 */ |
971 void copyFields(const SkPath& that); | 967 void copyFields(const SkPath& that); |
972 | 968 |
973 // called, if dirty, by getBounds() | 969 // called, if dirty, by getBounds() |
974 void computeBounds() const; | 970 void computeBounds() const; |
975 | 971 |
976 friend class Iter; | 972 friend class Iter; |
977 | 973 |
978 friend class SkPathStroker; | 974 friend class SkPathStroker; |
979 /* Append the first contour of path, ignoring path's initial point. If no | 975 /* Append the first contour of path, ignoring path's initial point. If no |
(...skipping 23 matching lines...) Expand all Loading... | |
1003 bool isRectContour(bool allowPartial, int* currVerb, const SkPoint** pts, | 999 bool isRectContour(bool allowPartial, int* currVerb, const SkPoint** pts, |
1004 bool* isClosed, Direction* direction) const; | 1000 bool* isClosed, Direction* direction) const; |
1005 | 1001 |
1006 friend class SkAutoPathBoundsUpdate; | 1002 friend class SkAutoPathBoundsUpdate; |
1007 friend class SkAutoDisableOvalCheck; | 1003 friend class SkAutoDisableOvalCheck; |
1008 friend class SkAutoDisableDirectionCheck; | 1004 friend class SkAutoDisableDirectionCheck; |
1009 friend class SkBench_AddPathTest; // perf test pathTo/reversePathTo | 1005 friend class SkBench_AddPathTest; // perf test pathTo/reversePathTo |
1010 }; | 1006 }; |
1011 | 1007 |
1012 #endif | 1008 #endif |
OLD | NEW |