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 960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
971 kDirection_SerializationShift = 26, // requires 2 bits | 971 kDirection_SerializationShift = 26, // requires 2 bits |
972 kUnused2_SerializationShift = 25, // 1 free bit | 972 kUnused2_SerializationShift = 25, // 1 free bit |
973 // 1 free bit at 24 | 973 // 1 free bit at 24 |
974 kConvexity_SerializationShift = 16, // requires 8 bits | 974 kConvexity_SerializationShift = 16, // requires 8 bits |
975 kFillType_SerializationShift = 8, // requires 8 bits | 975 kFillType_SerializationShift = 8, // requires 8 bits |
976 // 8 free bits at 0 | 976 // 8 free bits at 0 |
977 }; | 977 }; |
978 | 978 |
979 SkAutoTUnref<SkPathRef> fPathRef; | 979 SkAutoTUnref<SkPathRef> fPathRef; |
980 | 980 |
| 981 int fLastMoveToIndex; |
981 uint8_t fFillType; | 982 uint8_t fFillType; |
982 mutable uint8_t fConvexity; | 983 mutable uint8_t fConvexity; |
983 mutable uint8_t fDirection; | 984 mutable uint8_t fDirection; |
984 #ifdef SK_BUILD_FOR_ANDROID | 985 #ifdef SK_BUILD_FOR_ANDROID |
985 const SkPath* fSourcePath; | 986 const SkPath* fSourcePath; |
986 #endif | 987 #endif |
987 | 988 |
988 /** Resets all fields other than fPathRef to their initial 'empty' values. | 989 /** Resets all fields other than fPathRef to their initial 'empty' values. |
989 * Assumes the caller has already emptied fPathRef. | 990 * Assumes the caller has already emptied fPathRef. |
990 * On Android increments fGenerationID without reseting it. | 991 * On Android increments fGenerationID without reseting it. |
(...skipping 15 matching lines...) Expand all Loading... |
1006 first point is automatically set to (0,0). | 1007 first point is automatically set to (0,0). |
1007 */ | 1008 */ |
1008 void reversePathTo(const SkPath&); | 1009 void reversePathTo(const SkPath&); |
1009 | 1010 |
1010 // called before we add points for lineTo, quadTo, cubicTo, checking to see | 1011 // called before we add points for lineTo, quadTo, cubicTo, checking to see |
1011 // if we need to inject a leading moveTo first | 1012 // if we need to inject a leading moveTo first |
1012 // | 1013 // |
1013 // SkPath path; path.lineTo(...); <--- need a leading moveTo(0, 0) | 1014 // SkPath path; path.lineTo(...); <--- need a leading moveTo(0, 0) |
1014 // SkPath path; ... path.close(); path.lineTo(...) <-- need a moveTo(previou
s moveTo) | 1015 // SkPath path; ... path.close(); path.lineTo(...) <-- need a moveTo(previou
s moveTo) |
1015 // | 1016 // |
1016 void injectMoveToIfNeeded() { | 1017 inline void injectMoveToIfNeeded(); |
1017 SkPathRef::Editor ed(&fPathRef); | |
1018 ed.injectMoveToIfNeeded(); | |
1019 } | |
1020 | 1018 |
1021 inline bool hasOnlyMoveTos() const; | 1019 inline bool hasOnlyMoveTos() const; |
1022 | 1020 |
1023 Convexity internalGetConvexity() const; | 1021 Convexity internalGetConvexity() const; |
1024 | 1022 |
1025 bool isRectContour(bool allowPartial, int* currVerb, const SkPoint** pts, | 1023 bool isRectContour(bool allowPartial, int* currVerb, const SkPoint** pts, |
1026 bool* isClosed, Direction* direction) const; | 1024 bool* isClosed, Direction* direction) const; |
1027 | 1025 |
1028 /** Returns if the path can return a bound at no cost (true) or will have to | 1026 /** Returns if the path can return a bound at no cost (true) or will have to |
1029 perform some computation (false). | 1027 perform some computation (false). |
(...skipping 12 matching lines...) Expand all Loading... |
1042 } | 1040 } |
1043 | 1041 |
1044 friend class SkAutoPathBoundsUpdate; | 1042 friend class SkAutoPathBoundsUpdate; |
1045 friend class SkAutoDisableOvalCheck; | 1043 friend class SkAutoDisableOvalCheck; |
1046 friend class SkAutoDisableDirectionCheck; | 1044 friend class SkAutoDisableDirectionCheck; |
1047 friend class SkBench_AddPathTest; // perf test reversePathTo | 1045 friend class SkBench_AddPathTest; // perf test reversePathTo |
1048 friend class PathTest_Private; // unit test reversePathTo | 1046 friend class PathTest_Private; // unit test reversePathTo |
1049 }; | 1047 }; |
1050 | 1048 |
1051 #endif | 1049 #endif |
OLD | NEW |