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 "SkIntersections.h" | 7 #include "SkIntersections.h" |
8 #include "SkPathOpsLine.h" | 8 #include "SkPathOpsLine.h" |
9 | 9 |
10 void SkIntersections::cleanUpParallelLines(bool parallel) { | 10 void SkIntersections::cleanUpParallelLines(bool parallel) { |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 if (nearCount != 2 || aNotB[0] == aNotB[1]) { | 145 if (nearCount != 2 || aNotB[0] == aNotB[1]) { |
146 for (int iA = 0; iA < 2; ++iA) { | 146 for (int iA = 0; iA < 2; ++iA) { |
147 if (!aNotB[iA]) { | 147 if (!aNotB[iA]) { |
148 continue; | 148 continue; |
149 } | 149 } |
150 int nearer = aNearB[iA] > 0.5; | 150 int nearer = aNearB[iA] > 0.5; |
151 if (!bNotA[nearer]) { | 151 if (!bNotA[nearer]) { |
152 continue; | 152 continue; |
153 } | 153 } |
154 SkASSERT(a[iA] != b[nearer]); | 154 SkASSERT(a[iA] != b[nearer]); |
155 SkASSERT(iA == (bNearA[nearer] > 0.5)); | 155 SkOPASSERT(iA == (bNearA[nearer] > 0.5)); |
156 insertNear(iA, nearer, a[iA], b[nearer]); | 156 insertNear(iA, nearer, a[iA], b[nearer]); |
157 aNearB[iA] = -1; | 157 aNearB[iA] = -1; |
158 bNearA[nearer] = -1; | 158 bNearA[nearer] = -1; |
159 nearCount -= 2; | 159 nearCount -= 2; |
160 } | 160 } |
161 } | 161 } |
162 if (nearCount > 0) { | 162 if (nearCount > 0) { |
163 for (int iA = 0; iA < 2; ++iA) { | 163 for (int iA = 0; iA < 2; ++iA) { |
164 if (aNearB[iA] >= 0) { | 164 if (aNearB[iA] >= 0) { |
165 insert(iA, aNearB[iA], a[iA]); | 165 insert(iA, aNearB[iA], a[iA]); |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 insert((double) index, flipped ? 1 - t : t, line[index]); | 324 insert((double) index, flipped ? 1 - t : t, line[index]); |
325 } | 325 } |
326 } | 326 } |
327 } | 327 } |
328 } | 328 } |
329 cleanUpParallelLines(result == 2); | 329 cleanUpParallelLines(result == 2); |
330 SkASSERT(fUsed <= 2); | 330 SkASSERT(fUsed <= 2); |
331 return fUsed; | 331 return fUsed; |
332 } | 332 } |
333 | 333 |
OLD | NEW |