OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |