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

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

Issue 2425733002: fix some fuzz (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/SkOpCoincidence.cpp ('k') | src/pathops/SkPathOpsCommon.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 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 bool SkOpSpan::insertCoincidence(const SkOpSegment* segment, bool flipped, bool ordered) { 400 bool SkOpSpan::insertCoincidence(const SkOpSegment* segment, bool flipped, bool ordered) {
401 if (this->containsCoincidence(segment)) { 401 if (this->containsCoincidence(segment)) {
402 return true; 402 return true;
403 } 403 }
404 SkOpPtT* next = &fPtT; 404 SkOpPtT* next = &fPtT;
405 while ((next = next->next()) != &fPtT) { 405 while ((next = next->next()) != &fPtT) {
406 if (next->segment() == segment) { 406 if (next->segment() == segment) {
407 SkOpSpan* span; 407 SkOpSpan* span;
408 SkOpSpanBase* base = next->span(); 408 SkOpSpanBase* base = next->span();
409 if (!ordered) { 409 if (!ordered) {
410 const SkOpSpanBase* spanEnd = fNext->contains(segment)->span(); 410 const SkOpPtT* spanEndPtT = fNext->contains(segment);
411 FAIL_IF(!spanEndPtT);
412 const SkOpSpanBase* spanEnd = spanEndPtT->span();
411 const SkOpPtT* start = base->ptT()->starter(spanEnd->ptT()); 413 const SkOpPtT* start = base->ptT()->starter(spanEnd->ptT());
412 FAIL_IF(!start->span()->upCastable()); 414 FAIL_IF(!start->span()->upCastable());
413 span = const_cast<SkOpSpan*>(start->span()->upCast()); 415 span = const_cast<SkOpSpan*>(start->span()->upCast());
414 } else if (flipped) { 416 } else if (flipped) {
415 span = base->prev(); 417 span = base->prev();
416 FAIL_IF(!span); 418 FAIL_IF(!span);
417 } else { 419 } else {
418 FAIL_IF(!base->upCastable()); 420 FAIL_IF(!base->upCastable());
419 span = base->upCast(); 421 span = base->upCast();
420 } 422 }
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 468
467 void SkOpSpan::setWindSum(int windSum) { 469 void SkOpSpan::setWindSum(int windSum) {
468 SkASSERT(!final()); 470 SkASSERT(!final());
469 if (fWindSum != SK_MinS32 && fWindSum != windSum) { 471 if (fWindSum != SK_MinS32 && fWindSum != windSum) {
470 this->globalState()->setWindingFailed(); 472 this->globalState()->setWindingFailed();
471 return; 473 return;
472 } 474 }
473 SkASSERT(!DEBUG_LIMIT_WIND_SUM || SkTAbs(windSum) <= DEBUG_LIMIT_WIND_SUM); 475 SkASSERT(!DEBUG_LIMIT_WIND_SUM || SkTAbs(windSum) <= DEBUG_LIMIT_WIND_SUM);
474 fWindSum = windSum; 476 fWindSum = windSum;
475 } 477 }
OLDNEW
« no previous file with comments | « src/pathops/SkOpCoincidence.cpp ('k') | src/pathops/SkPathOpsCommon.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698