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 "SkOpCoincidence.h" | 8 #include "SkOpCoincidence.h" |
9 #include "SkOpEdgeBuilder.h" | 9 #include "SkOpEdgeBuilder.h" |
10 #include "SkPathOpsCommon.h" | 10 #include "SkPathOpsCommon.h" |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 // turn path into list of segments | 291 // turn path into list of segments |
292 SkOpEdgeBuilder builder(*minuend, &contour, &allocator, &globalState); | 292 SkOpEdgeBuilder builder(*minuend, &contour, &allocator, &globalState); |
293 if (builder.unparseable()) { | 293 if (builder.unparseable()) { |
294 return false; | 294 return false; |
295 } | 295 } |
296 const int xorMask = builder.xorMask(); | 296 const int xorMask = builder.xorMask(); |
297 builder.addOperand(*subtrahend); | 297 builder.addOperand(*subtrahend); |
298 if (!builder.finish(&allocator)) { | 298 if (!builder.finish(&allocator)) { |
299 return false; | 299 return false; |
300 } | 300 } |
301 #if !FORCE_RELEASE | 301 #if DEBUG_DUMP_SEGMENTS |
302 contour.dumpSegments(op); | 302 contour.dumpSegments(op); |
303 #endif | 303 #endif |
304 | 304 |
305 const int xorOpMask = builder.xorMask(); | 305 const int xorOpMask = builder.xorMask(); |
306 SkTDArray<SkOpContour* > contourList; | 306 SkTDArray<SkOpContour* > contourList; |
307 MakeContourList(&contour, contourList, xorMask == kEvenOdd_PathOpsMask, | 307 MakeContourList(&contour, contourList, xorMask == kEvenOdd_PathOpsMask, |
308 xorOpMask == kEvenOdd_PathOpsMask); | 308 xorOpMask == kEvenOdd_PathOpsMask); |
309 SkOpContour** currentPtr = contourList.begin(); | 309 SkOpContour** currentPtr = contourList.begin(); |
310 if (!currentPtr) { | 310 if (!currentPtr) { |
311 result->reset(); | 311 result->reset(); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 { // if some edges could not be resolved, assemble remaining fragments | 343 { // if some edges could not be resolved, assemble remaining fragments |
344 SkPath temp; | 344 SkPath temp; |
345 temp.setFillType(fillType); | 345 temp.setFillType(fillType); |
346 SkPathWriter assembled(temp); | 346 SkPathWriter assembled(temp); |
347 Assemble(wrapper, &assembled); | 347 Assemble(wrapper, &assembled); |
348 *result = *assembled.nativePath(); | 348 *result = *assembled.nativePath(); |
349 result->setFillType(fillType); | 349 result->setFillType(fillType); |
350 } | 350 } |
351 return true; | 351 return true; |
352 } | 352 } |
OLD | NEW |