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

Unified Diff: src/pathops/SkOpEdgeBuilder.cpp

Issue 52653002: pathops work in progress (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: add raster vs gpu test Created 7 years, 1 month 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/SkOpContour.cpp ('k') | src/pathops/SkOpSegment.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkOpEdgeBuilder.cpp
diff --git a/src/pathops/SkOpEdgeBuilder.cpp b/src/pathops/SkOpEdgeBuilder.cpp
index 676c34fb37971da3442eaa9ba81f7740b424d0c6..ae72e2938502240c84b82bd6c966788f1684b18e 100644
--- a/src/pathops/SkOpEdgeBuilder.cpp
+++ b/src/pathops/SkOpEdgeBuilder.cpp
@@ -42,16 +42,11 @@ bool SkOpEdgeBuilder::finish() {
}
void SkOpEdgeBuilder::closeContour(const SkPoint& curveEnd, const SkPoint& curveStart) {
- if ((!AlmostEqualUlps(curveEnd.fX, curveStart.fX)
- || !AlmostEqualUlps(curveEnd.fY, curveStart.fY))) {
+ if (!SkDPoint::ApproximatelyEqual(curveEnd, curveStart)) {
fPathVerbs.push_back(SkPath::kLine_Verb);
fPathPts.push_back_n(1, &curveStart);
} else {
- if (curveEnd.fX != curveStart.fX || curveEnd.fY != curveStart.fY) {
- fPathPts[fPathPts.count() - 1] = curveStart;
- } else {
- fPathPts[fPathPts.count() - 1] = curveStart;
- }
+ fPathPts[fPathPts.count() - 1] = curveStart;
}
fPathVerbs.push_back(SkPath::kClose_Verb);
}
@@ -82,9 +77,9 @@ int SkOpEdgeBuilder::preFetch() {
lastCurve = false;
continue;
case SkPath::kLine_Verb:
- if (AlmostEqualUlps(curve[0].fX, pts[1].fX)
- && AlmostEqualUlps(curve[0].fY, pts[1].fY)) {
- if (fPathVerbs.back() != SkPath::kLine_Verb) {
+ if (SkDPoint::ApproximatelyEqual(curve[0], pts[1])) {
+ uint8_t lastVerb = fPathVerbs.back();
+ if (lastVerb != SkPath::kLine_Verb && lastVerb != SkPath::kMove_Verb) {
fPathPts.back() = pts[1];
}
continue; // skip degenerate points
« no previous file with comments | « src/pathops/SkOpContour.cpp ('k') | src/pathops/SkOpSegment.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698