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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 | 266 |
267 @param verbs If not null, receives up to max verbs | 267 @param verbs If not null, receives up to max verbs |
268 @param max The maximum number of verbs to copy into verbs | 268 @param max The maximum number of verbs to copy into verbs |
269 @return the actual number of verbs in the path | 269 @return the actual number of verbs in the path |
270 */ | 270 */ |
271 int getVerbs(uint8_t verbs[], int max) const; | 271 int getVerbs(uint8_t verbs[], int max) const; |
272 | 272 |
273 //! Swap contents of this and other. Guaranteed not to throw | 273 //! Swap contents of this and other. Guaranteed not to throw |
274 void swap(SkPath& other); | 274 void swap(SkPath& other); |
275 | 275 |
276 /** Returns the bounds of the path's points. If the path contains 0 or 1 | 276 /** |
277 points, the bounds is set to (0,0,0,0), and isEmpty() will return true. | 277 * Returns the bounds of the path's points. If the path contains zero point
s/verbs, this |
278 Note: this bounds may be larger than the actual shape, since curves | 278 * will return the "empty" rect [0, 0, 0, 0]. |
279 do not extend as far as their control points. Additionally this bound | 279 * Note: this bounds may be larger than the actual shape, since curves |
280 can contain trailing MoveTo points (cf. isRect). | 280 * do not extend as far as their control points. Additionally this bound en
compases all points, |
| 281 * even isolated moveTos either preceeding or following the last non-degene
rate contour. |
281 */ | 282 */ |
282 const SkRect& getBounds() const { | 283 const SkRect& getBounds() const { |
283 return fPathRef->getBounds(); | 284 return fPathRef->getBounds(); |
284 } | 285 } |
285 | 286 |
286 /** Calling this will, if the internal cache of the bounds is out of date, | 287 /** Calling this will, if the internal cache of the bounds is out of date, |
287 update it so that subsequent calls to getBounds will be instantaneous. | 288 update it so that subsequent calls to getBounds will be instantaneous. |
288 This also means that any copies or simple transformations of the path | 289 This also means that any copies or simple transformations of the path |
289 will inherit the cached bounds. | 290 will inherit the cached bounds. |
290 */ | 291 */ |
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1001 void setPt(int index, SkScalar x, SkScalar y); | 1002 void setPt(int index, SkScalar x, SkScalar y); |
1002 | 1003 |
1003 friend class SkAutoPathBoundsUpdate; | 1004 friend class SkAutoPathBoundsUpdate; |
1004 friend class SkAutoDisableOvalCheck; | 1005 friend class SkAutoDisableOvalCheck; |
1005 friend class SkAutoDisableDirectionCheck; | 1006 friend class SkAutoDisableDirectionCheck; |
1006 friend class SkBench_AddPathTest; // perf test reversePathTo | 1007 friend class SkBench_AddPathTest; // perf test reversePathTo |
1007 friend class PathTest_Private; // unit test reversePathTo | 1008 friend class PathTest_Private; // unit test reversePathTo |
1008 }; | 1009 }; |
1009 | 1010 |
1010 #endif | 1011 #endif |
OLD | NEW |