| 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 935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 946 * 0 if there was not enough memory available | 946 * 0 if there was not enough memory available |
| 947 */ | 947 */ |
| 948 size_t readFromMemory(const void* buffer, size_t length); | 948 size_t readFromMemory(const void* buffer, size_t length); |
| 949 | 949 |
| 950 /** Returns a non-zero, globally unique value corresponding to the set of ve
rbs | 950 /** Returns a non-zero, globally unique value corresponding to the set of ve
rbs |
| 951 and points in the path (but not the fill type [except on Android skbug.c
om/1762]). | 951 and points in the path (but not the fill type [except on Android skbug.c
om/1762]). |
| 952 Each time the path is modified, a different generation ID will be return
ed. | 952 Each time the path is modified, a different generation ID will be return
ed. |
| 953 */ | 953 */ |
| 954 uint32_t getGenerationID() const; | 954 uint32_t getGenerationID() const; |
| 955 | 955 |
| 956 #ifdef SK_BUILD_FOR_ANDROID | 956 #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK |
| 957 static const int kPathRefGenIDBitCnt = 30; // leave room for the fill type (
skbug.com/1762) | 957 static const int kPathRefGenIDBitCnt = 30; // leave room for the fill type (
skbug.com/1762) |
| 958 const SkPath* getSourcePath() const; | |
| 959 void setSourcePath(const SkPath* path); | |
| 960 #else | 958 #else |
| 961 static const int kPathRefGenIDBitCnt = 32; | 959 static const int kPathRefGenIDBitCnt = 32; |
| 962 #endif | 960 #endif |
| 963 | 961 |
| 964 SkDEBUGCODE(void validate() const;) | 962 SkDEBUGCODE(void validate() const;) |
| 965 | 963 |
| 966 private: | 964 private: |
| 967 enum SerializationOffsets { | 965 enum SerializationOffsets { |
| 968 // 1 free bit at 29 | 966 // 1 free bit at 29 |
| 969 kUnused1_SerializationShift = 28, // 1 free bit | 967 kUnused1_SerializationShift = 28, // 1 free bit |
| 970 kDirection_SerializationShift = 26, // requires 2 bits | 968 kDirection_SerializationShift = 26, // requires 2 bits |
| 971 kIsVolatile_SerializationShift = 25, // requires 1 bit | 969 kIsVolatile_SerializationShift = 25, // requires 1 bit |
| 972 // 1 free bit at 24 | 970 // 1 free bit at 24 |
| 973 kConvexity_SerializationShift = 16, // requires 8 bits | 971 kConvexity_SerializationShift = 16, // requires 8 bits |
| 974 kFillType_SerializationShift = 8, // requires 8 bits | 972 kFillType_SerializationShift = 8, // requires 8 bits |
| 975 // 8 free bits at 0 | 973 // 8 free bits at 0 |
| 976 }; | 974 }; |
| 977 | 975 |
| 978 SkAutoTUnref<SkPathRef> fPathRef; | 976 SkAutoTUnref<SkPathRef> fPathRef; |
| 979 | 977 |
| 980 int fLastMoveToIndex; | 978 int fLastMoveToIndex; |
| 981 uint8_t fFillType; | 979 uint8_t fFillType; |
| 982 mutable uint8_t fConvexity; | 980 mutable uint8_t fConvexity; |
| 983 mutable uint8_t fDirection; | 981 mutable uint8_t fDirection; |
| 984 mutable SkBool8 fIsVolatile; | 982 mutable SkBool8 fIsVolatile; |
| 985 #ifdef SK_BUILD_FOR_ANDROID | |
| 986 const SkPath* fSourcePath; | |
| 987 #endif | |
| 988 | 983 |
| 989 /** Resets all fields other than fPathRef to their initial 'empty' values. | 984 /** Resets all fields other than fPathRef to their initial 'empty' values. |
| 990 * Assumes the caller has already emptied fPathRef. | 985 * Assumes the caller has already emptied fPathRef. |
| 991 * On Android increments fGenerationID without reseting it. | 986 * On Android increments fGenerationID without reseting it. |
| 992 */ | 987 */ |
| 993 void resetFields(); | 988 void resetFields(); |
| 994 | 989 |
| 995 /** Sets all fields other than fPathRef to the values in 'that'. | 990 /** Sets all fields other than fPathRef to the values in 'that'. |
| 996 * Assumes the caller has already set fPathRef. | 991 * Assumes the caller has already set fPathRef. |
| 997 * Doesn't change fGenerationID or fSourcePath on Android. | 992 * Doesn't change fGenerationID or fSourcePath on Android. |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1040 } | 1035 } |
| 1041 | 1036 |
| 1042 friend class SkAutoPathBoundsUpdate; | 1037 friend class SkAutoPathBoundsUpdate; |
| 1043 friend class SkAutoDisableOvalCheck; | 1038 friend class SkAutoDisableOvalCheck; |
| 1044 friend class SkAutoDisableDirectionCheck; | 1039 friend class SkAutoDisableDirectionCheck; |
| 1045 friend class SkBench_AddPathTest; // perf test reversePathTo | 1040 friend class SkBench_AddPathTest; // perf test reversePathTo |
| 1046 friend class PathTest_Private; // unit test reversePathTo | 1041 friend class PathTest_Private; // unit test reversePathTo |
| 1047 }; | 1042 }; |
| 1048 | 1043 |
| 1049 #endif | 1044 #endif |
| OLD | NEW |