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

Unified Diff: src/pathops/SkPathWriter.cpp

Issue 2426173002: fix fuzzers (Closed)
Patch Set: fix dm Created 4 years, 2 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/SkPathWriter.h ('k') | tests/PathOpsAngleIdeas.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkPathWriter.cpp
diff --git a/src/pathops/SkPathWriter.cpp b/src/pathops/SkPathWriter.cpp
index 1f6dddd137f03a1cfc289880b7a074b88bf41be4..c94809e8ecc183784f8cd0337953df7c76b74b17 100644
--- a/src/pathops/SkPathWriter.cpp
+++ b/src/pathops/SkPathWriter.cpp
@@ -48,23 +48,26 @@ void SkPathWriter::cubicTo(const SkPoint& pt1, const SkPoint& pt2, const SkOpPtT
fCurrent.cubicTo(pt1, pt2, pt3->fPt);
}
-void SkPathWriter::deferredLine(const SkOpPtT* pt) {
+bool SkPathWriter::deferredLine(const SkOpPtT* pt) {
SkASSERT(fFirstPtT);
SkASSERT(fDefer[0]);
if (fDefer[0] == pt) {
// FIXME: why we're adding a degenerate line? Caller should have preflighted this.
- return;
+ return true;
}
if (pt->contains(fDefer[0])) {
// FIXME: why we're adding a degenerate line?
- return;
+ return true;
+ }
+ if (this->matchedLast(pt)) {
+ return false;
}
- SkASSERT(!this->matchedLast(pt));
if (fDefer[1] && this->changedSlopes(pt)) {
this->lineTo();
fDefer[0] = fDefer[1];
}
fDefer[1] = pt;
+ return true;
}
void SkPathWriter::deferredMove(const SkOpPtT* pt) {
« no previous file with comments | « src/pathops/SkPathWriter.h ('k') | tests/PathOpsAngleIdeas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698