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

Unified Diff: src/pathops/SkOpEdgeBuilder.cpp

Issue 2276503002: fix pathops fuzz (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 4 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/SkOpContour.h ('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 95152a7ffa3dfec8b5833c73dcf68afc8fe36496..118f78d6c7801822d71fb70e145c6fca54f556bd 100644
--- a/src/pathops/SkOpEdgeBuilder.cpp
+++ b/src/pathops/SkOpEdgeBuilder.cpp
@@ -221,8 +221,14 @@ bool SkOpEdgeBuilder::walk() {
for (int index = 0; index < SkPathOpsVerbToPoints(v2); ++index) {
force_small_to_zero(&curve2[index]);
}
- fCurrentContour->addCurve(v1, curve1);
- fCurrentContour->addCurve(v2, curve2);
+ if (SkPath::kLine_Verb != v1 ||
+ !SkDPoint::ApproximatelyEqual(curve1[0], curve1[1])) {
+ fCurrentContour->addCurve(v1, curve1);
+ }
+ if (SkPath::kLine_Verb != v2 ||
+ !SkDPoint::ApproximatelyEqual(curve2[0], curve2[1])) {
+ fCurrentContour->addCurve(v2, curve2);
+ }
} else {
fCurrentContour->addCubic(pointsPtr);
}
« no previous file with comments | « src/pathops/SkOpContour.h ('k') | src/pathops/SkOpSegment.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698