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

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

Issue 1129193006: fix winding for path ops builder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix compile bug 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/SkPathOpsTypes.h ('k') | tests/PathOpsBuilderTest.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 2015 Google Inc. 2 * Copyright 2015 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 7
8 // given a prospective edge, compute its initial winding by projecting a ray 8 // given a prospective edge, compute its initial winding by projecting a ray
9 // if the ray hits another edge 9 // if the ray hits another edge
10 // if the edge doesn't have a winding yet, hop up to that edge and start ove r 10 // if the edge doesn't have a winding yet, hop up to that edge and start ove r
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 if (oSpanSum == SK_MinS32) { 335 if (oSpanSum == SK_MinS32) {
336 span->setOppSum(oppSum); 336 span->setOppSum(oppSum);
337 } else { 337 } else {
338 #if 0 338 #if 0
339 SkASSERT(hitSegment->oppXor() ? (oppSum & 1) == (oSpanSum & 1) : opp Sum == oSpanSum 339 SkASSERT(hitSegment->oppXor() ? (oppSum & 1) == (oSpanSum & 1) : opp Sum == oSpanSum
340 || (abs(oppWind) == abs(lastOpp) 340 || (abs(oppWind) == abs(lastOpp)
341 && (oppSum ^ oppWind ^ lastOpp) == oSpanSum)); 341 && (oppSum ^ oppWind ^ lastOpp) == oSpanSum));
342 #endif 342 #endif
343 } 343 }
344 if (sumSet) { 344 if (sumSet) {
345 (void) hitSegment->markAndChaseWinding(span, span->next(), windSum, oppSum, NULL); 345 if (this->globalState()->phase() == SkOpGlobalState::kFixWinding) {
346 (void) hitSegment->markAndChaseWinding(span->next(), span, windSum, oppSum, NULL); 346 hitSegment->contour()->setCcw(ccw);
347 } else {
348 (void) hitSegment->markAndChaseWinding(span, span->next(), windS um, oppSum, NULL);
349 (void) hitSegment->markAndChaseWinding(span->next(), span, windS um, oppSum, NULL);
350 }
347 } 351 }
348 if (operand) { 352 if (operand) {
349 SkTSwap(wind, oppWind); 353 SkTSwap(wind, oppWind);
350 } 354 }
351 last = &hit->fPt; 355 last = &hit->fPt;
352 } 356 }
353 return true; 357 return true;
354 } 358 }
355 359
356 SkOpSpan* SkOpSegment::findSortableTop(SkOpContour* contourHead) { 360 SkOpSpan* SkOpSegment::findSortableTop(SkOpContour* contourHead) {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 continue; 397 continue;
394 } 398 }
395 SkOpSpan* result = contour->findSortableTop(contourHead); 399 SkOpSpan* result = contour->findSortableTop(contourHead);
396 if (result) { 400 if (result) {
397 return result; 401 return result;
398 } 402 }
399 } while ((contour = contour->next())); 403 } while ((contour = contour->next()));
400 } 404 }
401 return NULL; 405 return NULL;
402 } 406 }
OLDNEW
« no previous file with comments | « src/pathops/SkPathOpsTypes.h ('k') | tests/PathOpsBuilderTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698