| 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
|
|
|