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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 total += contourList[index]->segments().count(); | 292 total += contourList[index]->segments().count(); |
293 } | 293 } |
294 #if DEBUG_SHOW_WINDING | 294 #if DEBUG_SHOW_WINDING |
295 SkOpContour::debugShowWindingValues(contourList); | 295 SkOpContour::debugShowWindingValues(contourList); |
296 #endif | 296 #endif |
297 CoincidenceCheck(&contourList, total); | 297 CoincidenceCheck(&contourList, total); |
298 #if DEBUG_SHOW_WINDING | 298 #if DEBUG_SHOW_WINDING |
299 SkOpContour::debugShowWindingValues(contourList); | 299 SkOpContour::debugShowWindingValues(contourList); |
300 #endif | 300 #endif |
301 FixOtherTIndex(&contourList); | 301 FixOtherTIndex(&contourList); |
| 302 CheckEnds(&contourList); |
302 SortSegments(&contourList); | 303 SortSegments(&contourList); |
303 #if DEBUG_ACTIVE_SPANS || DEBUG_ACTIVE_SPANS_FIRST_ONLY | 304 #if DEBUG_ACTIVE_SPANS || DEBUG_ACTIVE_SPANS_FIRST_ONLY |
304 DebugShowActiveSpans(contourList); | 305 DebugShowActiveSpans(contourList); |
305 #endif | 306 #endif |
306 // construct closed contours | 307 // construct closed contours |
307 SkPathWriter wrapper(*result); | 308 SkPathWriter wrapper(*result); |
308 bridgeOp(contourList, op, xorMask, xorOpMask, &wrapper); | 309 bridgeOp(contourList, op, xorMask, xorOpMask, &wrapper); |
309 { // if some edges could not be resolved, assemble remaining fragments | 310 { // if some edges could not be resolved, assemble remaining fragments |
310 SkPath temp; | 311 SkPath temp; |
311 temp.setFillType(fillType); | 312 temp.setFillType(fillType); |
312 SkPathWriter assembled(temp); | 313 SkPathWriter assembled(temp); |
313 Assemble(wrapper, &assembled); | 314 Assemble(wrapper, &assembled); |
314 *result = *assembled.nativePath(); | 315 *result = *assembled.nativePath(); |
315 result->setFillType(fillType); | 316 result->setFillType(fillType); |
316 } | 317 } |
317 return true; | 318 return true; |
318 } | 319 } |
OLD | NEW |