Chromium Code Reviews| 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 178 | 178 |
| 179 /** | 179 /** |
| 180 * Returns true if all of the points in this path are finite, meaning there | 180 * Returns true if all of the points in this path are finite, meaning there |
| 181 * are no infinities and no NaNs. | 181 * are no infinities and no NaNs. |
| 182 */ | 182 */ |
| 183 bool isFinite() const { | 183 bool isFinite() const { |
| 184 SkDEBUGCODE(this->validate();) | 184 SkDEBUGCODE(this->validate();) |
| 185 return fPathRef->isFinite(); | 185 return fPathRef->isFinite(); |
| 186 } | 186 } |
| 187 | 187 |
| 188 /** Returns true if the path is volatile (i.e. should not be cached by devic es.) | |
| 189 */ | |
| 190 bool isVolatile() const { | |
| 191 return fIsVolatile; | |
| 192 } | |
| 193 | |
| 194 /** Specify whether this path is volatile. Paths are not volatile by | |
| 195 default. Temporary paths that are discarded after use should be | |
|
bsalomon
2014/10/23 17:54:08
discarded or modified?
jvanverth1
2014/10/23 20:06:18
Done.
| |
| 196 marked as volatile. This provides a hint to the device that the path | |
| 197 should not be cached. Providing this hint when appropriate can | |
| 198 improve performance by avoiding unnecessary overhead and resource | |
| 199 consumption on the device. | |
| 200 */ | |
| 201 void setIsVolatile(bool isVolatile) { | |
| 202 fIsVolatile = isVolatile; | |
| 203 } | |
| 204 | |
| 188 /** Test a line for zero length | 205 /** Test a line for zero length |
| 189 | 206 |
| 190 @return true if the line is of zero length; otherwise false. | 207 @return true if the line is of zero length; otherwise false. |
| 191 */ | 208 */ |
| 192 static bool IsLineDegenerate(const SkPoint& p1, const SkPoint& p2) { | 209 static bool IsLineDegenerate(const SkPoint& p1, const SkPoint& p2) { |
| 193 return p1.equalsWithinTolerance(p2); | 210 return p1.equalsWithinTolerance(p2); |
| 194 } | 211 } |
| 195 | 212 |
| 196 /** Test a quad for zero length | 213 /** Test a quad for zero length |
| 197 | 214 |
| (...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 977 kFillType_SerializationShift = 8, // requires 8 bits | 994 kFillType_SerializationShift = 8, // requires 8 bits |
| 978 // 8 free bits at 0 | 995 // 8 free bits at 0 |
| 979 }; | 996 }; |
| 980 | 997 |
| 981 SkAutoTUnref<SkPathRef> fPathRef; | 998 SkAutoTUnref<SkPathRef> fPathRef; |
| 982 | 999 |
| 983 int fLastMoveToIndex; | 1000 int fLastMoveToIndex; |
| 984 uint8_t fFillType; | 1001 uint8_t fFillType; |
| 985 mutable uint8_t fConvexity; | 1002 mutable uint8_t fConvexity; |
| 986 mutable uint8_t fDirection; | 1003 mutable uint8_t fDirection; |
| 1004 mutable SkBool8 fIsVolatile; | |
| 987 #ifdef SK_BUILD_FOR_ANDROID | 1005 #ifdef SK_BUILD_FOR_ANDROID |
| 988 const SkPath* fSourcePath; | 1006 const SkPath* fSourcePath; |
| 989 #endif | 1007 #endif |
| 990 | 1008 |
| 991 /** Resets all fields other than fPathRef to their initial 'empty' values. | 1009 /** Resets all fields other than fPathRef to their initial 'empty' values. |
| 992 * Assumes the caller has already emptied fPathRef. | 1010 * Assumes the caller has already emptied fPathRef. |
| 993 * On Android increments fGenerationID without reseting it. | 1011 * On Android increments fGenerationID without reseting it. |
| 994 */ | 1012 */ |
| 995 void resetFields(); | 1013 void resetFields(); |
| 996 | 1014 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1042 } | 1060 } |
| 1043 | 1061 |
| 1044 friend class SkAutoPathBoundsUpdate; | 1062 friend class SkAutoPathBoundsUpdate; |
| 1045 friend class SkAutoDisableOvalCheck; | 1063 friend class SkAutoDisableOvalCheck; |
| 1046 friend class SkAutoDisableDirectionCheck; | 1064 friend class SkAutoDisableDirectionCheck; |
| 1047 friend class SkBench_AddPathTest; // perf test reversePathTo | 1065 friend class SkBench_AddPathTest; // perf test reversePathTo |
| 1048 friend class PathTest_Private; // unit test reversePathTo | 1066 friend class PathTest_Private; // unit test reversePathTo |
| 1049 }; | 1067 }; |
| 1050 | 1068 |
| 1051 #endif | 1069 #endif |
| OLD | NEW |