Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(786)

Unified Diff: src/pathops/SkPathOpsTypes.cpp

Issue 266063003: cubicline intersection binary search (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: typing cleanup Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/pathops/SkPathOpsTypes.h ('k') | tests/PathOpsCubicLineIntersectionIdeas.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « src/pathops/SkPathOpsTypes.h ('k') | tests/PathOpsCubicLineIntersectionIdeas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698