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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 /** Returns true if the path specifies a rectangle. If so, and if rect is | 239 /** Returns true if the path specifies a rectangle. If so, and if rect is |
240 not null, set rect to the bounds of the path. If the path does not | 240 not null, set rect to the bounds of the path. If the path does not |
241 specify a rectangle, return false and ignore rect. | 241 specify a rectangle, return false and ignore rect. |
242 | 242 |
243 @param rect If not null, returns the bounds of the path if it specifies | 243 @param rect If not null, returns the bounds of the path if it specifies |
244 a rectangle | 244 a rectangle |
245 @return true if the path specifies a rectangle | 245 @return true if the path specifies a rectangle |
246 */ | 246 */ |
247 bool isRect(SkRect* rect) const; | 247 bool isRect(SkRect* rect) const; |
248 | 248 |
249 /** Returns true if the path specifies a pair of nested rectangles. If so, a
nd if | |
250 rect is not null, set rect[0] to the outer rectangle and rect[1] to the
inner | |
251 rectangle. If the path does not specify a pair of nested rectangles, ret
urn | |
252 false and ignore rect. | |
253 | |
254 @param rect If not null, returns the path as a pair of nested rectangles | |
255 @return true if the path describes a pair of nested rectangles | |
256 */ | |
257 bool isNestedRects(SkRect rect[2]) const; | |
258 | |
259 /** Return the number of points in the path | 249 /** Return the number of points in the path |
260 */ | 250 */ |
261 int countPoints() const; | 251 int countPoints() const; |
262 | 252 |
263 /** Return the point at the specified index. If the index is out of range | 253 /** Return the point at the specified index. If the index is out of range |
264 (i.e. is not 0 <= index < countPoints()) then the returned coordinates | 254 (i.e. is not 0 <= index < countPoints()) then the returned coordinates |
265 will be (0,0) | 255 will be (0,0) |
266 */ | 256 */ |
267 SkPoint getPoint(int index) const; | 257 SkPoint getPoint(int index) const; |
268 | 258 |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 not null, set isClosed to true if the path is closed. Also, if returning
true | 569 not null, set isClosed to true if the path is closed. Also, if returning
true |
580 and direction is not null, return the rect direction. If the path does n
ot | 570 and direction is not null, return the rect direction. If the path does n
ot |
581 specify a rectangle, return false and ignore isClosed and direction. | 571 specify a rectangle, return false and ignore isClosed and direction. |
582 | 572 |
583 @param isClosed If not null, set to true if the path is closed | 573 @param isClosed If not null, set to true if the path is closed |
584 @param direction If not null, set to the rectangle's direction | 574 @param direction If not null, set to the rectangle's direction |
585 @return true if the path specifies a rectangle | 575 @return true if the path specifies a rectangle |
586 */ | 576 */ |
587 bool isRect(bool* isClosed, Direction* direction) const; | 577 bool isRect(bool* isClosed, Direction* direction) const; |
588 | 578 |
| 579 /** Returns true if the path specifies a pair of nested rectangles. If so, a
nd if |
| 580 rect is not null, set rect[0] to the outer rectangle and rect[1] to the
inner |
| 581 rectangle. If so, and dirs is not null, set dirs[0] to the direction of |
| 582 the outer rectangle and dirs[1] to the direction of the inner rectangle.
If |
| 583 the path does not specify a pair of nested rectangles, return |
| 584 false and ignore rect and dirs. |
| 585 |
| 586 @param rect If not null, returns the path as a pair of nested rectangles |
| 587 @param dirs If not null, returns the direction of the rects |
| 588 @return true if the path describes a pair of nested rectangles |
| 589 */ |
| 590 bool isNestedRects(SkRect rect[2], Direction dirs[2] = NULL) const; |
| 591 |
589 /** | 592 /** |
590 * Add a closed rectangle contour to the path | 593 * Add a closed rectangle contour to the path |
591 * @param rect The rectangle to add as a closed contour to the path | 594 * @param rect The rectangle to add as a closed contour to the path |
592 * @param dir The direction to wind the rectangle's contour. Cannot be | 595 * @param dir The direction to wind the rectangle's contour. Cannot be |
593 * kUnknown_Direction. | 596 * kUnknown_Direction. |
594 */ | 597 */ |
595 void addRect(const SkRect& rect, Direction dir = kCW_Direction); | 598 void addRect(const SkRect& rect, Direction dir = kCW_Direction); |
596 | 599 |
597 /** | 600 /** |
598 * Add a closed rectangle contour to the path | 601 * Add a closed rectangle contour to the path |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
994 bool isRectContour(bool allowPartial, int* currVerb, const SkPoint** pts, | 997 bool isRectContour(bool allowPartial, int* currVerb, const SkPoint** pts, |
995 bool* isClosed, Direction* direction) const; | 998 bool* isClosed, Direction* direction) const; |
996 | 999 |
997 friend class SkAutoPathBoundsUpdate; | 1000 friend class SkAutoPathBoundsUpdate; |
998 friend class SkAutoDisableOvalCheck; | 1001 friend class SkAutoDisableOvalCheck; |
999 friend class SkAutoDisableDirectionCheck; | 1002 friend class SkAutoDisableDirectionCheck; |
1000 friend class SkBench_AddPathTest; // perf test pathTo/reversePathTo | 1003 friend class SkBench_AddPathTest; // perf test pathTo/reversePathTo |
1001 }; | 1004 }; |
1002 | 1005 |
1003 #endif | 1006 #endif |
OLD | NEW |