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

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

Issue 2169863002: fix fuzzer bug (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 5 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/SkOpSegment.h ('k') | src/pathops/SkOpSpan.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 2012 Google Inc. 2 * Copyright 2012 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 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 spanBase = spanBase->upCast()->next(); 534 spanBase = spanBase->upCast()->next();
535 } while (true); 535 } while (true);
536 return false; 536 return false;
537 } 537 }
538 538
539 void SkOpSegment::release(const SkOpSpan* span) { 539 void SkOpSegment::release(const SkOpSpan* span) {
540 if (span->done()) { 540 if (span->done()) {
541 --fDoneCount; 541 --fDoneCount;
542 } 542 }
543 --fCount; 543 --fCount;
544 SkASSERT(this->globalState()->debugSkipAssert() || fCount >= fDoneCount); 544 SkOPASSERT(fCount >= fDoneCount);
545 } 545 }
546 546
547 double SkOpSegment::distSq(double t, const SkOpAngle* oppAngle) const { 547 double SkOpSegment::distSq(double t, const SkOpAngle* oppAngle) const {
548 SkDPoint testPt = this->dPtAtT(t); 548 SkDPoint testPt = this->dPtAtT(t);
549 SkDLine testPerp = {{ testPt, testPt }}; 549 SkDLine testPerp = {{ testPt, testPt }};
550 SkDVector slope = this->dSlopeAtT(t); 550 SkDVector slope = this->dSlopeAtT(t);
551 testPerp[1].fX += slope.fY; 551 testPerp[1].fX += slope.fY;
552 testPerp[1].fY -= slope.fX; 552 testPerp[1].fY -= slope.fX;
553 SkIntersections i; 553 SkIntersections i;
554 const SkOpSegment* oppSegment = oppAngle->segment(); 554 const SkOpSegment* oppSegment = oppAngle->segment();
(...skipping 1249 matching lines...) Expand 10 before | Expand all | Expand 10 after
1804 int absOut = SkTAbs(outerWinding); 1804 int absOut = SkTAbs(outerWinding);
1805 int absIn = SkTAbs(innerWinding); 1805 int absIn = SkTAbs(innerWinding);
1806 bool result = absOut == absIn ? outerWinding < 0 : absOut < absIn; 1806 bool result = absOut == absIn ? outerWinding < 0 : absOut < absIn;
1807 return result; 1807 return result;
1808 } 1808 }
1809 1809
1810 int SkOpSegment::windSum(const SkOpAngle* angle) const { 1810 int SkOpSegment::windSum(const SkOpAngle* angle) const {
1811 const SkOpSpan* minSpan = angle->start()->starter(angle->end()); 1811 const SkOpSpan* minSpan = angle->start()->starter(angle->end());
1812 return minSpan->windSum(); 1812 return minSpan->windSum();
1813 } 1813 }
OLDNEW
« no previous file with comments | « src/pathops/SkOpSegment.h ('k') | src/pathops/SkOpSpan.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698