Index: src/pathops/SkPathOpsTypes.h |
diff --git a/src/pathops/SkPathOpsTypes.h b/src/pathops/SkPathOpsTypes.h |
index 4f8bd1534430ce8f3a7b0bca94dfdd1a967d00d1..96627842b3701a186792716bae400b6cfca0a639 100644 |
--- a/src/pathops/SkPathOpsTypes.h |
+++ b/src/pathops/SkPathOpsTypes.h |
@@ -91,6 +91,11 @@ const double DBL_EPSILON_ERR = DBL_EPSILON * 4; // FIXME: tune -- allow a few b |
const double DBL_EPSILON_SUBDIVIDE_ERR = DBL_EPSILON * 16; |
const double ROUGH_EPSILON = FLT_EPSILON * 64; |
const double MORE_ROUGH_EPSILON = FLT_EPSILON * 256; |
+const double WAY_ROUGH_EPSILON = FLT_EPSILON * 2048; |
+ |
+inline bool zero_or_one(double x) { |
+ return x == 0 || x == 1; |
+} |
inline bool approximately_zero(double x) { |
return fabs(x) < FLT_EPSILON; |
@@ -297,12 +302,16 @@ inline bool between(double a, double b, double c) { |
return (a - b) * (c - b) <= 0; |
} |
+inline bool roughly_equal(double x, double y) { |
+ return fabs(x - y) < ROUGH_EPSILON; |
+} |
+ |
inline bool more_roughly_equal(double x, double y) { |
return fabs(x - y) < MORE_ROUGH_EPSILON; |
} |
-inline bool roughly_equal(double x, double y) { |
- return fabs(x - y) < ROUGH_EPSILON; |
+inline bool way_roughly_equal(double x, double y) { |
+ return fabs(x - y) < WAY_ROUGH_EPSILON; |
} |
struct SkDPoint; |