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 "SkAddIntersections.h" | 7 #include "SkAddIntersections.h" |
8 #include "SkOpEdgeBuilder.h" | 8 #include "SkOpEdgeBuilder.h" |
9 #include "SkPathOpsCommon.h" | 9 #include "SkPathOpsCommon.h" |
10 #include "SkPathWriter.h" | 10 #include "SkPathWriter.h" |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 AddSelfIntersectTs(current); | 178 AddSelfIntersectTs(current); |
179 } | 179 } |
180 SkOpContour* next; | 180 SkOpContour* next; |
181 do { | 181 do { |
182 next = *nextPtr++; | 182 next = *nextPtr++; |
183 } while (AddIntersectTs(current, next) && nextPtr != listEnd); | 183 } while (AddIntersectTs(current, next) && nextPtr != listEnd); |
184 } while (currentPtr != listEnd); | 184 } while (currentPtr != listEnd); |
185 // eat through coincident edges | 185 // eat through coincident edges |
186 CoincidenceCheck(&contourList, 0); | 186 CoincidenceCheck(&contourList, 0); |
187 FixOtherTIndex(&contourList); | 187 FixOtherTIndex(&contourList); |
| 188 CheckEnds(&contourList); |
188 SortSegments(&contourList); | 189 SortSegments(&contourList); |
189 #if DEBUG_ACTIVE_SPANS || DEBUG_ACTIVE_SPANS_FIRST_ONLY | 190 #if DEBUG_ACTIVE_SPANS || DEBUG_ACTIVE_SPANS_FIRST_ONLY |
190 DebugShowActiveSpans(contourList); | 191 DebugShowActiveSpans(contourList); |
191 #endif | 192 #endif |
192 // construct closed contours | 193 // construct closed contours |
193 SkPathWriter simple(*result); | 194 SkPathWriter simple(*result); |
194 if (builder.xorMask() == kWinding_PathOpsMask ? bridgeWinding(contourList, &
simple) | 195 if (builder.xorMask() == kWinding_PathOpsMask ? bridgeWinding(contourList, &
simple) |
195 : !bridgeXor(contourList, &simple)) | 196 : !bridgeXor(contourList, &simple)) |
196 { // if some edges could not be resolved, assemble remaining fragments | 197 { // if some edges could not be resolved, assemble remaining fragments |
197 SkPath temp; | 198 SkPath temp; |
198 temp.setFillType(fillType); | 199 temp.setFillType(fillType); |
199 SkPathWriter assembled(temp); | 200 SkPathWriter assembled(temp); |
200 Assemble(simple, &assembled); | 201 Assemble(simple, &assembled); |
201 *result = *assembled.nativePath(); | 202 *result = *assembled.nativePath(); |
202 result->setFillType(fillType); | 203 result->setFillType(fillType); |
203 } | 204 } |
204 return true; | 205 return true; |
205 } | 206 } |
OLD | NEW |