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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 next = *nextPtr++; | 297 next = *nextPtr++; |
298 } while (AddIntersectTs(current, next) && nextPtr != listEnd); | 298 } while (AddIntersectTs(current, next) && nextPtr != listEnd); |
299 } while (currentPtr != listEnd); | 299 } while (currentPtr != listEnd); |
300 // eat through coincident edges | 300 // eat through coincident edges |
301 | 301 |
302 int total = 0; | 302 int total = 0; |
303 int index; | 303 int index; |
304 for (index = 0; index < contourList.count(); ++index) { | 304 for (index = 0; index < contourList.count(); ++index) { |
305 total += contourList[index]->segments().count(); | 305 total += contourList[index]->segments().count(); |
306 } | 306 } |
307 #if DEBUG_SHOW_WINDING | 307 HandleCoincidence(&contourList, total); |
308 SkOpContour::debugShowWindingValues(contourList); | |
309 #endif | |
310 CoincidenceCheck(&contourList, total); | |
311 #if DEBUG_SHOW_WINDING | |
312 SkOpContour::debugShowWindingValues(contourList); | |
313 #endif | |
314 FixOtherTIndex(&contourList); | |
315 CheckEnds(&contourList); | |
316 CheckTiny(&contourList); | |
317 SortSegments(&contourList); | |
318 #if DEBUG_ACTIVE_SPANS || DEBUG_ACTIVE_SPANS_FIRST_ONLY | |
319 DebugShowActiveSpans(contourList); | |
320 #endif | |
321 // construct closed contours | 308 // construct closed contours |
322 SkPathWriter wrapper(*result); | 309 SkPathWriter wrapper(*result); |
323 bridgeOp(contourList, op, xorMask, xorOpMask, &wrapper); | 310 bridgeOp(contourList, op, xorMask, xorOpMask, &wrapper); |
324 { // if some edges could not be resolved, assemble remaining fragments | 311 { // if some edges could not be resolved, assemble remaining fragments |
325 SkPath temp; | 312 SkPath temp; |
326 temp.setFillType(fillType); | 313 temp.setFillType(fillType); |
327 SkPathWriter assembled(temp); | 314 SkPathWriter assembled(temp); |
328 Assemble(wrapper, &assembled); | 315 Assemble(wrapper, &assembled); |
329 *result = *assembled.nativePath(); | 316 *result = *assembled.nativePath(); |
330 result->setFillType(fillType); | 317 result->setFillType(fillType); |
331 } | 318 } |
332 return true; | 319 return true; |
333 } | 320 } |
OLD | NEW |