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

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

Issue 1250293002: fix path ops fuzz buster (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: corrupting bug kaput Created 5 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.h » ('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 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 continue; 608 continue;
609 } 609 }
610 double testDistSq = testPt.distanceSquared(i.pt(index)); 610 double testDistSq = testPt.distanceSquared(i.pt(index));
611 if (closestDistSq > testDistSq) { 611 if (closestDistSq > testDistSq) {
612 closestDistSq = testDistSq; 612 closestDistSq = testDistSq;
613 } 613 }
614 } 614 }
615 return closestDistSq; 615 return closestDistSq;
616 } 616 }
617 617
618 void SkOpSegment::findCollapsed() {
619 if (fHead.contains(&fTail)) {
620 markAllDone();
621 // move start and end to the same point
622 fHead.alignEnd(0, fHead.pt());
623 fTail.setAligned();
624 }
625 }
626
618 /* 627 /*
619 The M and S variable name parts stand for the operators. 628 The M and S variable name parts stand for the operators.
620 Mi stands for Minuend (see wiki subtraction, analogous to difference) 629 Mi stands for Minuend (see wiki subtraction, analogous to difference)
621 Su stands for Subtrahend 630 Su stands for Subtrahend
622 The Opp variable name part designates that the value is for the Opposite operat or. 631 The Opp variable name part designates that the value is for the Opposite operat or.
623 Opposite values result from combining coincident spans. 632 Opposite values result from combining coincident spans.
624 */ 633 */
625 SkOpSegment* SkOpSegment::findNextOp(SkTDArray<SkOpSpanBase*>* chase, SkOpSpanBa se** nextStart, 634 SkOpSegment* SkOpSegment::findNextOp(SkTDArray<SkOpSpanBase*>* chase, SkOpSpanBa se** nextStart,
626 SkOpSpanBase** nextEnd, bool* unsortable, SkPathOp op, int xorMiMask, in t xorSuMask) { 635 SkOpSpanBase** nextEnd, bool* unsortable, SkPathOp op, int xorMiMask, in t xorSuMask) {
627 SkOpSpanBase* start = *nextStart; 636 SkOpSpanBase* start = *nextStart;
(...skipping 1140 matching lines...) Expand 10 before | Expand all | Expand 10 after
1768 int absOut = abs(outerWinding); 1777 int absOut = abs(outerWinding);
1769 int absIn = abs(innerWinding); 1778 int absIn = abs(innerWinding);
1770 bool result = absOut == absIn ? outerWinding < 0 : absOut < absIn; 1779 bool result = absOut == absIn ? outerWinding < 0 : absOut < absIn;
1771 return result; 1780 return result;
1772 } 1781 }
1773 1782
1774 int SkOpSegment::windSum(const SkOpAngle* angle) const { 1783 int SkOpSegment::windSum(const SkOpAngle* angle) const {
1775 const SkOpSpan* minSpan = angle->start()->starter(angle->end()); 1784 const SkOpSpan* minSpan = angle->start()->starter(angle->end());
1776 return minSpan->windSum(); 1785 return minSpan->windSum();
1777 } 1786 }
OLDNEW
« no previous file with comments | « src/pathops/SkOpSegment.h ('k') | src/pathops/SkOpSpan.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698