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 SkPath_DEFINED | 8 #ifndef SkPath_DEFINED |
9 #define SkPath_DEFINED | 9 #define SkPath_DEFINED |
10 | 10 |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 * @param dir is the oval CCW (or CW if false). | 176 * @param dir is the oval CCW (or CW if false). |
177 * @param start indicates where the contour starts on the oval (see | 177 * @param start indicates where the contour starts on the oval (see |
178 * SkPath::addOval for intepretation of the index). | 178 * SkPath::addOval for intepretation of the index). |
179 * @return true if this path is an oval. | 179 * @return true if this path is an oval. |
180 * Tracking whether a path is an oval is considered an | 180 * Tracking whether a path is an oval is considered an |
181 * optimization for performance and so some paths that are in | 181 * optimization for performance and so some paths that are in |
182 * fact ovals can report false. | 182 * fact ovals can report false. |
183 */ | 183 */ |
184 bool isOval(SkRect* rect, Direction* dir = nullptr, | 184 bool isOval(SkRect* rect, Direction* dir = nullptr, |
185 unsigned* start = nullptr) const { | 185 unsigned* start = nullptr) const { |
186 bool isCCW; | 186 bool isCCW = false; |
187 bool result = fPathRef->isOval(rect, &isCCW, start); | 187 bool result = fPathRef->isOval(rect, &isCCW, start); |
188 if (dir && result) { | 188 if (dir && result) { |
189 *dir = isCCW ? kCCW_Direction : kCW_Direction; | 189 *dir = isCCW ? kCCW_Direction : kCW_Direction; |
190 } | 190 } |
191 return result; | 191 return result; |
192 } | 192 } |
193 | 193 |
194 /** Returns true if the path is a round rect. | 194 /** Returns true if the path is a round rect. |
195 * | 195 * |
196 * @param rrect Returns the bounding rect and radii of this round rect. | 196 * @param rrect Returns the bounding rect and radii of this round rect. |
197 * @param dir is the rrect CCW (or CW if false). | 197 * @param dir is the rrect CCW (or CW if false). |
198 * @param start indicates where the contour starts on the rrect (see | 198 * @param start indicates where the contour starts on the rrect (see |
199 * SkPath::addRRect for intepretation of the index). | 199 * SkPath::addRRect for intepretation of the index). |
200 * | 200 * |
201 * @return true if this path is a round rect. | 201 * @return true if this path is a round rect. |
202 * Tracking whether a path is a round rect is considered an | 202 * Tracking whether a path is a round rect is considered an |
203 * optimization for performance and so some paths that are in | 203 * optimization for performance and so some paths that are in |
204 * fact round rects can report false. | 204 * fact round rects can report false. |
205 */ | 205 */ |
206 bool isRRect(SkRRect* rrect, Direction* dir = nullptr, | 206 bool isRRect(SkRRect* rrect, Direction* dir = nullptr, |
207 unsigned* start = nullptr) const { | 207 unsigned* start = nullptr) const { |
208 bool isCCW; | 208 bool isCCW = false; |
209 bool result = fPathRef->isRRect(rrect, &isCCW, start); | 209 bool result = fPathRef->isRRect(rrect, &isCCW, start); |
210 if (dir && result) { | 210 if (dir && result) { |
211 *dir = isCCW ? kCCW_Direction : kCW_Direction; | 211 *dir = isCCW ? kCCW_Direction : kCW_Direction; |
212 } | 212 } |
213 return result; | 213 return result; |
214 } | 214 } |
215 | 215 |
216 /** Clear any lines and curves from the path, making it empty. This frees up | 216 /** Clear any lines and curves from the path, making it empty. This frees up |
217 internal storage associated with those segments. | 217 internal storage associated with those segments. |
218 On Android, does not change fSourcePath. | 218 On Android, does not change fSourcePath. |
(...skipping 970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1189 | 1189 |
1190 friend class SkAutoPathBoundsUpdate; | 1190 friend class SkAutoPathBoundsUpdate; |
1191 friend class SkAutoDisableOvalCheck; | 1191 friend class SkAutoDisableOvalCheck; |
1192 friend class SkAutoDisableDirectionCheck; | 1192 friend class SkAutoDisableDirectionCheck; |
1193 friend class SkBench_AddPathTest; // perf test reversePathTo | 1193 friend class SkBench_AddPathTest; // perf test reversePathTo |
1194 friend class PathTest_Private; // unit test reversePathTo | 1194 friend class PathTest_Private; // unit test reversePathTo |
1195 friend class ForceIsRRect_Private; // unit test isRRect | 1195 friend class ForceIsRRect_Private; // unit test isRRect |
1196 }; | 1196 }; |
1197 | 1197 |
1198 #endif | 1198 #endif |
OLD | NEW |