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

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

Issue 2360083006: don't close a contour with a line if nothing's there (Closed)
Patch Set: Created 4 years, 2 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 | « no previous file | tests/PathOpsOpTest.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 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 "SkOpSpan.h" 7 #include "SkOpSpan.h"
8 #include "SkPathOpsPoint.h" 8 #include "SkPathOpsPoint.h"
9 #include "SkPathWriter.h" 9 #include "SkPathWriter.h"
10 #include "SkTSort.h" 10 #include "SkTSort.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 } 74 }
75 SkASSERT(fDefer[0]); 75 SkASSERT(fDefer[0]);
76 if (!this->matchedLast(pt)) { 76 if (!this->matchedLast(pt)) {
77 this->finishContour(); 77 this->finishContour();
78 fFirstPtT = fDefer[0] = pt; 78 fFirstPtT = fDefer[0] = pt;
79 } 79 }
80 } 80 }
81 81
82 void SkPathWriter::finishContour() { 82 void SkPathWriter::finishContour() {
83 if (!this->matchedLast(fDefer[0])) { 83 if (!this->matchedLast(fDefer[0])) {
84 if (!fDefer[1]) {
85 return;
86 }
84 this->lineTo(); 87 this->lineTo();
85 } 88 }
86 if (fCurrent.isEmpty()) { 89 if (fCurrent.isEmpty()) {
87 return; 90 return;
88 } 91 }
89 if (this->isClosed()) { 92 if (this->isClosed()) {
90 this->close(); 93 this->close();
91 } else { 94 } else {
92 SkASSERT(fDefer[1]); 95 SkASSERT(fDefer[1]);
93 fEndPtTs.push(fFirstPtT); 96 fEndPtTs.push(fFirstPtT);
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 } 353 }
351 } while (rIndex < linkCount); 354 } while (rIndex < linkCount);
352 #if DEBUG_ASSEMBLE 355 #if DEBUG_ASSEMBLE
353 for (rIndex = 0; rIndex < linkCount; ++rIndex) { 356 for (rIndex = 0; rIndex < linkCount; ++rIndex) {
354 SkASSERT(sLink[rIndex] == SK_MaxS32); 357 SkASSERT(sLink[rIndex] == SK_MaxS32);
355 SkASSERT(eLink[rIndex] == SK_MaxS32); 358 SkASSERT(eLink[rIndex] == SK_MaxS32);
356 } 359 }
357 #endif 360 #endif
358 return; 361 return;
359 } 362 }
OLDNEW
« no previous file with comments | « no previous file | tests/PathOpsOpTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698