Index: src/pathops/SkPathOpsTypes.cpp |
diff --git a/src/pathops/SkPathOpsTypes.cpp b/src/pathops/SkPathOpsTypes.cpp |
index dbed086fbd94d868d224eb97943f063599e0f562..2c8d778c69570b2e250ed54c5f7413b995ef20b4 100644 |
--- a/src/pathops/SkPathOpsTypes.cpp |
+++ b/src/pathops/SkPathOpsTypes.cpp |
@@ -102,6 +102,13 @@ bool AlmostDequalUlps(float a, float b) { |
return d_equal_ulps(a, b, UlpsEpsilon); |
} |
+bool AlmostDequalUlps(double a, double b) { |
+ if (SkScalarIsFinite(a) || SkScalarIsFinite(b)) { |
+ return AlmostDequalUlps(SkDoubleToScalar(a), SkDoubleToScalar(b)); |
+ } |
+ return fabs(a - b) / SkTMax(fabs(a), fabs(b)) < FLT_EPSILON * 16; |
+} |
+ |
bool AlmostEqualUlps(float a, float b) { |
const int UlpsEpsilon = 16; |
return equal_ulps(a, b, UlpsEpsilon, UlpsEpsilon); |