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

Unified Diff: src/pathops/SkPathOpsPoint.h

Issue 18058007: path ops work in progress (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: try try again Created 7 years, 5 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/SkPathOpsOp.cpp ('k') | src/pathops/SkPathOpsTypes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkPathOpsPoint.h
diff --git a/src/pathops/SkPathOpsPoint.h b/src/pathops/SkPathOpsPoint.h
index 534154f199ccd2994026e6d286600e96cdbfc97b..ad959b6669988fd12818286a5ad15f4b3e00d7bd 100644
--- a/src/pathops/SkPathOpsPoint.h
+++ b/src/pathops/SkPathOpsPoint.h
@@ -111,14 +111,8 @@ struct SkDPoint {
}
bool approximatelyEqual(const SkPoint& a) const {
- double denom = SkTMax(fabs(fX), SkTMax(fabs(fY),
- SkScalarToDouble(SkTMax(fabsf(a.fX), fabsf(a.fY)))));
- if (denom == 0) {
- return true;
- }
- double inv = 1 / denom;
- return approximately_equal_double(fX * inv, a.fX * inv)
- && approximately_equal_double(fY * inv, a.fY * inv);
+ return AlmostEqualUlps(SkDoubleToScalar(fX), a.fX)
+ && AlmostEqualUlps(SkDoubleToScalar(fY), a.fY);
}
bool approximatelyEqualHalf(const SkDPoint& a) const {
« no previous file with comments | « src/pathops/SkPathOpsOp.cpp ('k') | src/pathops/SkPathOpsTypes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698