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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 bool isLine(SkPoint line[2]) const; | 240 bool isLine(SkPoint line[2]) const; |
241 | 241 |
242 /** Returns true if the path specifies a rectangle. If so, and if rect is | 242 /** Returns true if the path specifies a rectangle. If so, and if rect is |
243 not null, set rect to the bounds of the path. If the path does not | 243 not null, set rect to the bounds of the path. If the path does not |
244 specify a rectangle, return false and ignore rect. | 244 specify a rectangle, return false and ignore rect. |
245 | 245 |
246 @param rect If not null, returns the bounds of the path if it specifies | 246 @param rect If not null, returns the bounds of the path if it specifies |
247 a rectangle | 247 a rectangle |
248 @return true if the path specifies a rectangle | 248 @return true if the path specifies a rectangle |
249 */ | 249 */ |
250 bool isRect(SkRect* rect) const; | 250 bool isRect(SkRect* rect) const { return this->isRect(rect, NULL, NULL); } |
251 | 251 |
252 /** Return the number of points in the path | 252 /** Return the number of points in the path |
253 */ | 253 */ |
254 int countPoints() const; | 254 int countPoints() const; |
255 | 255 |
256 /** Return the point at the specified index. If the index is out of range | 256 /** Return the point at the specified index. If the index is out of range |
257 (i.e. is not 0 <= index < countPoints()) then the returned coordinates | 257 (i.e. is not 0 <= index < countPoints()) then the returned coordinates |
258 will be (0,0) | 258 will be (0,0) |
259 */ | 259 */ |
260 SkPoint getPoint(int index) const; | 260 SkPoint getPoint(int index) const; |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
594 | 594 |
595 /** Returns true if the path specifies a rectangle. If so, and if isClosed i
s | 595 /** Returns true if the path specifies a rectangle. If so, and if isClosed i
s |
596 not null, set isClosed to true if the path is closed. Also, if returning
true | 596 not null, set isClosed to true if the path is closed. Also, if returning
true |
597 and direction is not null, return the rect direction. If the path does n
ot | 597 and direction is not null, return the rect direction. If the path does n
ot |
598 specify a rectangle, return false and ignore isClosed and direction. | 598 specify a rectangle, return false and ignore isClosed and direction. |
599 | 599 |
600 @param isClosed If not null, set to true if the path is closed | 600 @param isClosed If not null, set to true if the path is closed |
601 @param direction If not null, set to the rectangle's direction | 601 @param direction If not null, set to the rectangle's direction |
602 @return true if the path specifies a rectangle | 602 @return true if the path specifies a rectangle |
603 */ | 603 */ |
604 bool isRect(bool* isClosed, Direction* direction) const; | 604 bool isRect(bool* isClosed, Direction* direction) const { |
| 605 return this->isRect(NULL, isClosed, direction); |
| 606 } |
| 607 |
| 608 /** |
| 609 * Returns true if the path specifies a rectangle. |
| 610 * |
| 611 * If this returns false, then all output parameters are ignored, and left |
| 612 * unchanged. If this returns true, then each of the output parameters |
| 613 * are checked for NULL. If they are not, they return their value. |
| 614 * |
| 615 * @param rect If not null, set to the bounds of the rectangle |
| 616 * @param isClosed If not null, set to true if the path is closed |
| 617 * @param direction If not null, set to the rectangle's direction |
| 618 * @return true if the path specifies a rectangle |
| 619 */ |
| 620 bool isRect(SkRect* rect, bool* isClosed, Direction* direction) const; |
605 | 621 |
606 /** Returns true if the path specifies a pair of nested rectangles. If so, a
nd if | 622 /** Returns true if the path specifies a pair of nested rectangles. If so, a
nd if |
607 rect is not null, set rect[0] to the outer rectangle and rect[1] to the
inner | 623 rect is not null, set rect[0] to the outer rectangle and rect[1] to the
inner |
608 rectangle. If so, and dirs is not null, set dirs[0] to the direction of | 624 rectangle. If so, and dirs is not null, set dirs[0] to the direction of |
609 the outer rectangle and dirs[1] to the direction of the inner rectangle.
If | 625 the outer rectangle and dirs[1] to the direction of the inner rectangle.
If |
610 the path does not specify a pair of nested rectangles, return | 626 the path does not specify a pair of nested rectangles, return |
611 false and ignore rect and dirs. | 627 false and ignore rect and dirs. |
612 | 628 |
613 @param rect If not null, returns the path as a pair of nested rectangles | 629 @param rect If not null, returns the path as a pair of nested rectangles |
614 @param dirs If not null, returns the direction of the rects | 630 @param dirs If not null, returns the direction of the rects |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1060 } | 1076 } |
1061 | 1077 |
1062 friend class SkAutoPathBoundsUpdate; | 1078 friend class SkAutoPathBoundsUpdate; |
1063 friend class SkAutoDisableOvalCheck; | 1079 friend class SkAutoDisableOvalCheck; |
1064 friend class SkAutoDisableDirectionCheck; | 1080 friend class SkAutoDisableDirectionCheck; |
1065 friend class SkBench_AddPathTest; // perf test reversePathTo | 1081 friend class SkBench_AddPathTest; // perf test reversePathTo |
1066 friend class PathTest_Private; // unit test reversePathTo | 1082 friend class PathTest_Private; // unit test reversePathTo |
1067 }; | 1083 }; |
1068 | 1084 |
1069 #endif | 1085 #endif |
OLD | NEW |