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

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

Issue 1218863005: don't fix winding for empty paths (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/SkOpBuilder.cpp ('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 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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 272
273 void SkOpSpan::detach(SkOpPtT* kept) { 273 void SkOpSpan::detach(SkOpPtT* kept) {
274 SkASSERT(!final()); 274 SkASSERT(!final());
275 SkOpSpan* prev = this->prev(); 275 SkOpSpan* prev = this->prev();
276 SkASSERT(prev); 276 SkASSERT(prev);
277 SkOpSpanBase* next = this->next(); 277 SkOpSpanBase* next = this->next();
278 SkASSERT(next); 278 SkASSERT(next);
279 prev->setNext(next); 279 prev->setNext(next);
280 next->setPrev(prev); 280 next->setPrev(prev);
281 this->segment()->detach(this); 281 this->segment()->detach(this);
282 this->globalState()->coincidence()->fixUp(this->ptT(), kept); 282 SkOpCoincidence* coincidence = this->globalState()->coincidence();
283 if (coincidence) {
284 coincidence->fixUp(this->ptT(), kept);
285 }
283 this->ptT()->setDeleted(); 286 this->ptT()->setDeleted();
284 } 287 }
285 288
286 void SkOpSpan::init(SkOpSegment* segment, SkOpSpan* prev, double t, const SkPoin t& pt) { 289 void SkOpSpan::init(SkOpSegment* segment, SkOpSpan* prev, double t, const SkPoin t& pt) {
287 SkASSERT(t != 1); 290 SkASSERT(t != 1);
288 initBase(segment, prev, t, pt); 291 initBase(segment, prev, t, pt);
289 fCoincident = this; 292 fCoincident = this;
290 fToAngle = NULL; 293 fToAngle = NULL;
291 fWindSum = fOppSum = SK_MinS32; 294 fWindSum = fOppSum = SK_MinS32;
292 fWindValue = 1; 295 fWindValue = 1;
(...skipping 15 matching lines...) Expand all
308 311
309 void SkOpSpan::setWindSum(int windSum) { 312 void SkOpSpan::setWindSum(int windSum) {
310 SkASSERT(!final()); 313 SkASSERT(!final());
311 if (fWindSum != SK_MinS32 && fWindSum != windSum) { 314 if (fWindSum != SK_MinS32 && fWindSum != windSum) {
312 this->globalState()->setWindingFailed(); 315 this->globalState()->setWindingFailed();
313 return; 316 return;
314 } 317 }
315 SkASSERT(!DEBUG_LIMIT_WIND_SUM || abs(windSum) <= DEBUG_LIMIT_WIND_SUM); 318 SkASSERT(!DEBUG_LIMIT_WIND_SUM || abs(windSum) <= DEBUG_LIMIT_WIND_SUM);
316 fWindSum = windSum; 319 fWindSum = windSum;
317 } 320 }
OLDNEW
« no previous file with comments | « src/pathops/SkOpBuilder.cpp ('k') | tests/PathOpsBuilderTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698