OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 #ifndef SkPathOpsTypes_DEFINED | 7 #ifndef SkPathOpsTypes_DEFINED |
8 #define SkPathOpsTypes_DEFINED | 8 #define SkPathOpsTypes_DEFINED |
9 | 9 |
10 #include <float.h> // for FLT_EPSILON | 10 #include <float.h> // for FLT_EPSILON |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 int fDebugLoopCount[3]; | 176 int fDebugLoopCount[3]; |
177 SkPath::Verb fDebugWorstVerb[6]; | 177 SkPath::Verb fDebugWorstVerb[6]; |
178 SkPoint fDebugWorstPts[24]; | 178 SkPoint fDebugWorstPts[24]; |
179 float fDebugWorstWeight[6]; | 179 float fDebugWorstWeight[6]; |
180 #endif | 180 #endif |
181 #if DEBUG_COINCIDENCE | 181 #if DEBUG_COINCIDENCE |
182 bool fDebugCheckHealth; | 182 bool fDebugCheckHealth; |
183 #endif | 183 #endif |
184 }; | 184 }; |
185 | 185 |
| 186 #define SkOPASSERT(cond) SkASSERT(this->globalState()->debugSkipAssert() || cond
) |
| 187 #define SkOPOBJASSERT(obj, cond) SkASSERT((obj->debugGlobalState() && \ |
| 188 obj->debugGlobalState()->debugSkipAssert()) || cond) |
| 189 |
186 // Use Almost Equal when comparing coordinates. Use epsilon to compare T values. | 190 // Use Almost Equal when comparing coordinates. Use epsilon to compare T values. |
187 bool AlmostEqualUlps(float a, float b); | 191 bool AlmostEqualUlps(float a, float b); |
188 inline bool AlmostEqualUlps(double a, double b) { | 192 inline bool AlmostEqualUlps(double a, double b) { |
189 return AlmostEqualUlps(SkDoubleToScalar(a), SkDoubleToScalar(b)); | 193 return AlmostEqualUlps(SkDoubleToScalar(a), SkDoubleToScalar(b)); |
190 } | 194 } |
191 | 195 |
192 bool AlmostEqualUlpsNoNormalCheck(float a, float b); | 196 bool AlmostEqualUlpsNoNormalCheck(float a, float b); |
193 inline bool AlmostEqualUlpsNoNormalCheck(double a, double b) { | 197 inline bool AlmostEqualUlpsNoNormalCheck(double a, double b) { |
194 return AlmostEqualUlpsNoNormalCheck(SkDoubleToScalar(a), SkDoubleToScalar(b)
); | 198 return AlmostEqualUlpsNoNormalCheck(SkDoubleToScalar(a), SkDoubleToScalar(b)
); |
195 } | 199 } |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 */ | 572 */ |
569 inline int SkDSideBit(double x) { | 573 inline int SkDSideBit(double x) { |
570 return 1 << SKDSide(x); | 574 return 1 << SKDSide(x); |
571 } | 575 } |
572 | 576 |
573 inline double SkPinT(double t) { | 577 inline double SkPinT(double t) { |
574 return precisely_less_than_zero(t) ? 0 : precisely_greater_than_one(t) ? 1 :
t; | 578 return precisely_less_than_zero(t) ? 0 : precisely_greater_than_one(t) ? 1 :
t; |
575 } | 579 } |
576 | 580 |
577 #endif | 581 #endif |
OLD | NEW |