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 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
695 * this->moveTo(pts[0]); | 695 * this->moveTo(pts[0]); |
696 * for (int i = 1; i < count; ++i) { | 696 * for (int i = 1; i < count; ++i) { |
697 * this->lineTo(pts[i]); | 697 * this->lineTo(pts[i]); |
698 * } | 698 * } |
699 * if (close) { | 699 * if (close) { |
700 * this->close(); | 700 * this->close(); |
701 * } | 701 * } |
702 */ | 702 */ |
703 void addPoly(const SkPoint pts[], int count, bool close); | 703 void addPoly(const SkPoint pts[], int count, bool close); |
704 | 704 |
705 enum AddPathMode { | |
706 /** Source path contours are added as new contours. | |
707 */ | |
708 kAppend_AddPathMode, | |
709 /** Path is added by extending the last contour of the destination path | |
710 with the first contour of the source path. | |
711 */ | |
712 kJoin_AddPathMode | |
reed1
2014/02/07 18:05:50
How about kExtend_, esp. since that is the word yo
| |
713 }; | |
714 | |
705 /** Add a copy of src to the path, offset by (dx,dy) | 715 /** Add a copy of src to the path, offset by (dx,dy) |
706 @param src The path to add as a new contour | 716 @param src The path to add as a new contour |
707 @param dx The amount to translate the path in X as it is added | 717 @param dx The amount to translate the path in X as it is added |
708 @param dx The amount to translate the path in Y as it is added | 718 @param dx The amount to translate the path in Y as it is added |
709 */ | 719 */ |
710 void addPath(const SkPath& src, SkScalar dx, SkScalar dy); | 720 void addPath(const SkPath& src, SkScalar dx, SkScalar dy, |
721 AddPathMode mode = kAppend_AddPathMode); | |
711 | 722 |
712 /** Add a copy of src to the path | 723 /** Add a copy of src to the path |
713 */ | 724 */ |
714 void addPath(const SkPath& src) { | 725 void addPath(const SkPath& src, AddPathMode mode = kAppend_AddPathMode) { |
715 SkMatrix m; | 726 SkMatrix m; |
716 m.reset(); | 727 m.reset(); |
717 this->addPath(src, m); | 728 this->addPath(src, m, mode); |
718 } | 729 } |
719 | 730 |
720 /** Add a copy of src to the path, transformed by matrix | 731 /** Add a copy of src to the path, transformed by matrix |
721 @param src The path to add as a new contour | 732 @param src The path to add as a new contour |
733 @param matrix Transform applied to src | |
734 @param mode Determines how path is added | |
722 */ | 735 */ |
723 void addPath(const SkPath& src, const SkMatrix& matrix); | 736 void addPath(const SkPath& src, const SkMatrix& matrix, AddPathMode mode = k Append_AddPathMode); |
724 | 737 |
725 /** | 738 /** |
726 * Same as addPath(), but reverses the src input | 739 * Same as addPath(), but reverses the src input |
727 */ | 740 */ |
728 void reverseAddPath(const SkPath& src); | 741 void reverseAddPath(const SkPath& src); |
729 | 742 |
730 /** Offset the path by (dx,dy), returning true on success | 743 /** Offset the path by (dx,dy), returning true on success |
731 | 744 |
732 @param dx The amount in the X direction to offset the entire path | 745 @param dx The amount in the X direction to offset the entire path |
733 @param dy The amount in the Y direction to offset the entire path | 746 @param dy The amount in the Y direction to offset the entire path |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1024 } | 1037 } |
1025 | 1038 |
1026 friend class SkAutoPathBoundsUpdate; | 1039 friend class SkAutoPathBoundsUpdate; |
1027 friend class SkAutoDisableOvalCheck; | 1040 friend class SkAutoDisableOvalCheck; |
1028 friend class SkAutoDisableDirectionCheck; | 1041 friend class SkAutoDisableDirectionCheck; |
1029 friend class SkBench_AddPathTest; // perf test reversePathTo | 1042 friend class SkBench_AddPathTest; // perf test reversePathTo |
1030 friend class PathTest_Private; // unit test reversePathTo | 1043 friend class PathTest_Private; // unit test reversePathTo |
1031 }; | 1044 }; |
1032 | 1045 |
1033 #endif | 1046 #endif |
OLD | NEW |