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

Unified Diff: src/pathops/SkPathOpsPoint.h

Issue 15338003: path ops -- rewrite angle sort (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 6 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/SkPathOpsQuad.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkPathOpsPoint.h
===================================================================
--- src/pathops/SkPathOpsPoint.h (revision 9425)
+++ src/pathops/SkPathOpsPoint.h (working copy)
@@ -117,8 +117,8 @@
return true;
}
double inv = 1 / denom;
- return approximately_equal(fX * inv, a.fX * inv)
- && approximately_equal(fY * inv, a.fY * inv);
+ return approximately_equal_double(fX * inv, a.fX * inv)
+ && approximately_equal_double(fY * inv, a.fY * inv);
}
bool approximatelyEqualHalf(const SkDPoint& a) const {
@@ -151,6 +151,13 @@
return temp.lengthSquared();
}
+ static SkDPoint Mid(const SkDPoint& a, const SkDPoint& b) {
+ SkDPoint result;
+ result.fX = (a.fX + b.fX) / 2;
+ result.fY = (a.fY + b.fY) / 2;
+ return result;
+ }
+
double moreRoughlyEqual(const SkDPoint& a) const {
return more_roughly_equal(a.fY, fY) && more_roughly_equal(a.fX, fX);
}
« no previous file with comments | « src/pathops/SkPathOpsOp.cpp ('k') | src/pathops/SkPathOpsQuad.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698