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

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

Issue 2273293004: path ops stream-lining (Closed)
Patch Set: remove commented out code Created 4 years, 3 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/SkPathOpsDebug.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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 173
174 void SkOpPtT::setDeleted() { 174 void SkOpPtT::setDeleted() {
175 SkASSERT(this->span()->debugDeleted() || this->span()->ptT() != this); 175 SkASSERT(this->span()->debugDeleted() || this->span()->ptT() != this);
176 SkOPASSERT(!fDeleted); 176 SkOPASSERT(!fDeleted);
177 fDeleted = true; 177 fDeleted = true;
178 } 178 }
179 179
180 // please keep this in sync with debugAddOppAndMerge 180 // please keep this in sync with debugAddOppAndMerge
181 // If the added points envelop adjacent spans, merge them in. 181 // If the added points envelop adjacent spans, merge them in.
182 void SkOpSpanBase::addOppAndMerge(SkOpSpanBase* opp) { 182 void SkOpSpanBase::addOppAndMerge(SkOpSpanBase* opp) {
183 if (this->ptT()->addOpp(opp->ptT())) { 183 SkOpPtT* oppPrev = this->ptT()->oppPrev(opp->ptT());
184 if (oppPrev) {
185 this->ptT()->addOpp(opp->ptT(), oppPrev);
184 this->checkForCollapsedCoincidence(); 186 this->checkForCollapsedCoincidence();
185 } 187 }
186 // compute bounds of points in span 188 // compute bounds of points in span
187 SkPathOpsBounds bounds; 189 SkPathOpsBounds bounds;
188 bounds.set(SK_ScalarMax, SK_ScalarMax, SK_ScalarMin, SK_ScalarMin); 190 bounds.set(SK_ScalarMax, SK_ScalarMax, SK_ScalarMin, SK_ScalarMin);
189 const SkOpPtT* head = this->ptT(); 191 const SkOpPtT* head = this->ptT();
190 const SkOpPtT* nextPt = head; 192 const SkOpPtT* nextPt = head;
191 do { 193 do {
192 bounds.add(nextPt->fPt); 194 bounds.add(nextPt->fPt);
193 } while ((nextPt = nextPt->next()) != head); 195 } while ((nextPt = nextPt->next()) != head);
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 450
449 void SkOpSpan::setWindSum(int windSum) { 451 void SkOpSpan::setWindSum(int windSum) {
450 SkASSERT(!final()); 452 SkASSERT(!final());
451 if (fWindSum != SK_MinS32 && fWindSum != windSum) { 453 if (fWindSum != SK_MinS32 && fWindSum != windSum) {
452 this->globalState()->setWindingFailed(); 454 this->globalState()->setWindingFailed();
453 return; 455 return;
454 } 456 }
455 SkASSERT(!DEBUG_LIMIT_WIND_SUM || SkTAbs(windSum) <= DEBUG_LIMIT_WIND_SUM); 457 SkASSERT(!DEBUG_LIMIT_WIND_SUM || SkTAbs(windSum) <= DEBUG_LIMIT_WIND_SUM);
456 fWindSum = windSum; 458 fWindSum = windSum;
457 } 459 }
OLDNEW
« no previous file with comments | « src/pathops/SkOpSpan.h ('k') | src/pathops/SkPathOpsDebug.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698