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

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

Issue 1140813002: deal more consistently with unsortable edges (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix linux warning Created 5 years, 7 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/SkOpSpan.h ('k') | src/pathops/SkPathOpsCommon.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 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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 } 242 }
243 compare = nextC; 243 compare = nextC;
244 } 244 }
245 spanPtT->insert(remainder); 245 spanPtT->insert(remainder);
246 tryNextRemainder: 246 tryNextRemainder:
247 remainder = next; 247 remainder = next;
248 } 248 }
249 fSpanAdds += span->fSpanAdds; 249 fSpanAdds += span->fSpanAdds;
250 } 250 }
251 251
252 int SkOpSpan::computeWindSum() {
253 SkOpGlobalState* globals = this->globalState();
254 SkOpContour* contourHead = globals->contourHead();
255 int windTry = 0;
256 while (!this->sortableTop(contourHead) && ++windTry < SkOpGlobalState::kMaxW indingTries) {
257 ;
258 }
259 return this->windSum();
260 }
261
252 bool SkOpSpan::containsCoincidence(const SkOpSegment* segment) const { 262 bool SkOpSpan::containsCoincidence(const SkOpSegment* segment) const {
253 SkASSERT(this->segment() != segment); 263 SkASSERT(this->segment() != segment);
254 const SkOpSpan* next = fCoincident; 264 const SkOpSpan* next = fCoincident;
255 do { 265 do {
256 if (next->segment() == segment) { 266 if (next->segment() == segment) {
257 return true; 267 return true;
258 } 268 }
259 } while ((next = next->fCoincident) != this); 269 } while ((next = next->fCoincident) != this);
260 return false; 270 return false;
261 } 271 }
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 308
299 void SkOpSpan::setWindSum(int windSum) { 309 void SkOpSpan::setWindSum(int windSum) {
300 SkASSERT(!final()); 310 SkASSERT(!final());
301 if (fWindSum != SK_MinS32 && fWindSum != windSum) { 311 if (fWindSum != SK_MinS32 && fWindSum != windSum) {
302 this->globalState()->setWindingFailed(); 312 this->globalState()->setWindingFailed();
303 return; 313 return;
304 } 314 }
305 SkASSERT(!DEBUG_LIMIT_WIND_SUM || abs(windSum) <= DEBUG_LIMIT_WIND_SUM); 315 SkASSERT(!DEBUG_LIMIT_WIND_SUM || abs(windSum) <= DEBUG_LIMIT_WIND_SUM);
306 fWindSum = windSum; 316 fWindSum = windSum;
307 } 317 }
OLDNEW
« no previous file with comments | « src/pathops/SkOpSpan.h ('k') | src/pathops/SkPathOpsCommon.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698