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

Side by Side Diff: src/pathops/SkOpSpan.cpp

Issue 2358043002: fix skia pathops fuzzers (Closed)
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « src/pathops/SkDQuadLineIntersection.cpp ('k') | tests/PathOpsOpTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 #include "SkOpCoincidence.h" 7 #include "SkOpCoincidence.h"
8 #include "SkOpContour.h" 8 #include "SkOpContour.h"
9 #include "SkOpSegment.h" 9 #include "SkOpSegment.h"
10 #include "SkPathWriter.h" 10 #include "SkPathWriter.h"
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 return true; 464 return true;
465 } 465 }
466 SkOpPtT* next = &fPtT; 466 SkOpPtT* next = &fPtT;
467 while ((next = next->next()) != &fPtT) { 467 while ((next = next->next()) != &fPtT) {
468 if (next->segment() == segment) { 468 if (next->segment() == segment) {
469 SkOpSpan* span; 469 SkOpSpan* span;
470 SkOpSpanBase* base = next->span(); 470 SkOpSpanBase* base = next->span();
471 if (!ordered) { 471 if (!ordered) {
472 const SkOpSpanBase* spanEnd = fNext->contains(segment)->span(); 472 const SkOpSpanBase* spanEnd = fNext->contains(segment)->span();
473 const SkOpPtT* start = base->ptT()->starter(spanEnd->ptT()); 473 const SkOpPtT* start = base->ptT()->starter(spanEnd->ptT());
474 FAIL_IF(!start->span()->upCastable());
474 span = const_cast<SkOpSpan*>(start->span()->upCast()); 475 span = const_cast<SkOpSpan*>(start->span()->upCast());
475 } else if (flipped) { 476 } else if (flipped) {
476 span = base->prev(); 477 span = base->prev();
477 FAIL_IF(!span); 478 FAIL_IF(!span);
478 } else { 479 } else {
479 FAIL_IF(!base->upCastable()); 480 FAIL_IF(!base->upCastable());
480 span = base->upCast(); 481 span = base->upCast();
481 } 482 }
482 this->insertCoincidence(span); 483 this->insertCoincidence(span);
483 return true; 484 return true;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 528
528 void SkOpSpan::setWindSum(int windSum) { 529 void SkOpSpan::setWindSum(int windSum) {
529 SkASSERT(!final()); 530 SkASSERT(!final());
530 if (fWindSum != SK_MinS32 && fWindSum != windSum) { 531 if (fWindSum != SK_MinS32 && fWindSum != windSum) {
531 this->globalState()->setWindingFailed(); 532 this->globalState()->setWindingFailed();
532 return; 533 return;
533 } 534 }
534 SkASSERT(!DEBUG_LIMIT_WIND_SUM || SkTAbs(windSum) <= DEBUG_LIMIT_WIND_SUM); 535 SkASSERT(!DEBUG_LIMIT_WIND_SUM || SkTAbs(windSum) <= DEBUG_LIMIT_WIND_SUM);
535 fWindSum = windSum; 536 fWindSum = windSum;
536 } 537 }
OLDNEW
« no previous file with comments | « src/pathops/SkDQuadLineIntersection.cpp ('k') | tests/PathOpsOpTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698