| 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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 SkOpCoincidence coincidence; | 192 SkOpCoincidence coincidence; |
| 193 SkOpContour contour; | 193 SkOpContour contour; |
| 194 SkOpGlobalState globalState(&coincidence SkDEBUGPARAMS(&contour)); | 194 SkOpGlobalState globalState(&coincidence SkDEBUGPARAMS(&contour)); |
| 195 #if DEBUG_SORT || DEBUG_SWAP_TOP | 195 #if DEBUG_SORT || DEBUG_SWAP_TOP |
| 196 SkPathOpsDebug::gSortCount = SkPathOpsDebug::gSortCountDefault; | 196 SkPathOpsDebug::gSortCount = SkPathOpsDebug::gSortCountDefault; |
| 197 #endif | 197 #endif |
| 198 SkOpEdgeBuilder builder(path, &contour, &allocator, &globalState); | 198 SkOpEdgeBuilder builder(path, &contour, &allocator, &globalState); |
| 199 if (!builder.finish(&allocator)) { | 199 if (!builder.finish(&allocator)) { |
| 200 return false; | 200 return false; |
| 201 } | 201 } |
| 202 #if !FORCE_RELEASE | 202 #if DEBUG_DUMP_SEGMENTS |
| 203 contour.dumpSegments((SkPathOp) -1); | 203 contour.dumpSegments((SkPathOp) -1); |
| 204 #endif | 204 #endif |
| 205 SkTDArray<SkOpContour* > contourList; | 205 SkTDArray<SkOpContour* > contourList; |
| 206 MakeContourList(&contour, contourList, false, false); | 206 MakeContourList(&contour, contourList, false, false); |
| 207 SkOpContour** currentPtr = contourList.begin(); | 207 SkOpContour** currentPtr = contourList.begin(); |
| 208 if (!currentPtr) { | 208 if (!currentPtr) { |
| 209 result->reset(); | 209 result->reset(); |
| 210 result->setFillType(fillType); | 210 result->setFillType(fillType); |
| 211 return true; | 211 return true; |
| 212 } | 212 } |
| (...skipping 28 matching lines...) Expand all Loading... |
| 241 { // if some edges could not be resolved, assemble remaining fragments | 241 { // if some edges could not be resolved, assemble remaining fragments |
| 242 SkPath temp; | 242 SkPath temp; |
| 243 temp.setFillType(fillType); | 243 temp.setFillType(fillType); |
| 244 SkPathWriter assembled(temp); | 244 SkPathWriter assembled(temp); |
| 245 Assemble(wrapper, &assembled); | 245 Assemble(wrapper, &assembled); |
| 246 *result = *assembled.nativePath(); | 246 *result = *assembled.nativePath(); |
| 247 result->setFillType(fillType); | 247 result->setFillType(fillType); |
| 248 } | 248 } |
| 249 return true; | 249 return true; |
| 250 } | 250 } |
| OLD | NEW |