| 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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 | 214 |
| 215 #ifdef SK_DEBUG | 215 #ifdef SK_DEBUG |
| 216 #if DEBUG_COINCIDENCE | 216 #if DEBUG_COINCIDENCE |
| 217 #define SkOPASSERT(cond) SkASSERT((this->globalState() && \ | 217 #define SkOPASSERT(cond) SkASSERT((this->globalState() && \ |
| 218 (this->globalState()->debugCheckHealth() || \ | 218 (this->globalState()->debugCheckHealth() || \ |
| 219 this->globalState()->debugSkipAssert())) || (cond)) | 219 this->globalState()->debugSkipAssert())) || (cond)) |
| 220 #else | 220 #else |
| 221 #define SkOPASSERT(cond) SkASSERT((this->globalState() && \ | 221 #define SkOPASSERT(cond) SkASSERT((this->globalState() && \ |
| 222 this->globalState()->debugSkipAssert()) || (cond)) | 222 this->globalState()->debugSkipAssert()) || (cond)) |
| 223 #endif | 223 #endif |
| 224 #define SkOPOBJASSERT(obj, cond) SkASSERT((obj->debugGlobalState() && \ | 224 #define SkOPOBJASSERT(obj, cond) SkASSERT((obj->globalState() && \ |
| 225 obj->debugGlobalState()->debugSkipAssert()) || (cond)) | 225 obj->globalState()->debugSkipAssert()) || (cond)) |
| 226 #else | 226 #else |
| 227 #define SkOPASSERT(cond) | 227 #define SkOPASSERT(cond) |
| 228 #define SkOPOBJASSERT(obj, cond) | 228 #define SkOPOBJASSERT(obj, cond) |
| 229 #endif | 229 #endif |
| 230 | 230 |
| 231 // Use Almost Equal when comparing coordinates. Use epsilon to compare T values. | 231 // Use Almost Equal when comparing coordinates. Use epsilon to compare T values. |
| 232 bool AlmostEqualUlps(float a, float b); | 232 bool AlmostEqualUlps(float a, float b); |
| 233 inline bool AlmostEqualUlps(double a, double b) { | 233 inline bool AlmostEqualUlps(double a, double b) { |
| 234 return AlmostEqualUlps(SkDoubleToScalar(a), SkDoubleToScalar(b)); | 234 return AlmostEqualUlps(SkDoubleToScalar(a), SkDoubleToScalar(b)); |
| 235 } | 235 } |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 609 */ | 609 */ |
| 610 inline int SkDSideBit(double x) { | 610 inline int SkDSideBit(double x) { |
| 611 return 1 << SKDSide(x); | 611 return 1 << SKDSide(x); |
| 612 } | 612 } |
| 613 | 613 |
| 614 inline double SkPinT(double t) { | 614 inline double SkPinT(double t) { |
| 615 return precisely_less_than_zero(t) ? 0 : precisely_greater_than_one(t) ? 1 :
t; | 615 return precisely_less_than_zero(t) ? 0 : precisely_greater_than_one(t) ? 1 :
t; |
| 616 } | 616 } |
| 617 | 617 |
| 618 #endif | 618 #endif |
| OLD | NEW |