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

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

Issue 2300203002: interpolation of coincidence must be local to a single span (Closed)
Patch Set: fix another warning 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/SkOpCoincidence.cpp ('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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 if (this->contains(newT)) { 251 if (this->contains(newT)) {
252 return true; 252 return true;
253 } 253 }
254 this->globalState()->resetAllocatedOpSpan(); 254 this->globalState()->resetAllocatedOpSpan();
255 SkOpPtT* newPtT = this->addT(newT); 255 SkOpPtT* newPtT = this->addT(newT);
256 *startOver |= this->globalState()->allocatedOpSpan(); 256 *startOver |= this->globalState()->allocatedOpSpan();
257 if (!newPtT) { 257 if (!newPtT) {
258 return false; 258 return false;
259 } 259 }
260 newPtT->fPt = this->ptAtT(newT); 260 newPtT->fPt = this->ptAtT(newT);
261 // const cast away to change linked list; pt/t values stays unchanged
262 SkOpPtT* oppPrev = test->ptT()->oppPrev(newPtT); 261 SkOpPtT* oppPrev = test->ptT()->oppPrev(newPtT);
263 if (oppPrev) { 262 if (oppPrev) {
263 // const cast away to change linked list; pt/t values stays unchanged
264 SkOpSpanBase* writableTest = const_cast<SkOpSpanBase*>(test); 264 SkOpSpanBase* writableTest = const_cast<SkOpSpanBase*>(test);
265 writableTest->mergeMatches(newPtT->span()); 265 writableTest->mergeMatches(newPtT->span());
266 writableTest->ptT()->addOpp(newPtT, oppPrev); 266 writableTest->ptT()->addOpp(newPtT, oppPrev);
267 writableTest->checkForCollapsedCoincidence(); 267 writableTest->checkForCollapsedCoincidence();
268 } 268 }
269 return true; 269 return true;
270 } 270 }
271 271
272 // Please keep this in sync with debugAddT() 272 // Please keep this in sync with debugAddT()
273 SkOpPtT* SkOpSegment::addT(double t) { 273 SkOpPtT* SkOpSegment::addT(double t) {
(...skipping 1498 matching lines...) Expand 10 before | Expand all | Expand 10 after
1772 int absOut = SkTAbs(outerWinding); 1772 int absOut = SkTAbs(outerWinding);
1773 int absIn = SkTAbs(innerWinding); 1773 int absIn = SkTAbs(innerWinding);
1774 bool result = absOut == absIn ? outerWinding < 0 : absOut < absIn; 1774 bool result = absOut == absIn ? outerWinding < 0 : absOut < absIn;
1775 return result; 1775 return result;
1776 } 1776 }
1777 1777
1778 int SkOpSegment::windSum(const SkOpAngle* angle) const { 1778 int SkOpSegment::windSum(const SkOpAngle* angle) const {
1779 const SkOpSpan* minSpan = angle->start()->starter(angle->end()); 1779 const SkOpSpan* minSpan = angle->start()->starter(angle->end());
1780 return minSpan->windSum(); 1780 return minSpan->windSum();
1781 } 1781 }
OLDNEW
« no previous file with comments | « src/pathops/SkOpCoincidence.cpp ('k') | src/pathops/SkOpSpan.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698