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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 if (!HandleCoincidence(contourList, &coincidence, &allocator)) { | 209 if (!HandleCoincidence(contourList, &coincidence, &allocator)) { |
210 return false; | 210 return false; |
211 } | 211 } |
212 #if DEBUG_DUMP_ALIGNMENT | 212 #if DEBUG_DUMP_ALIGNMENT |
213 contour.dumpSegments("aligned"); | 213 contour.dumpSegments("aligned"); |
214 #endif | 214 #endif |
215 // construct closed contours | 215 // construct closed contours |
216 result->reset(); | 216 result->reset(); |
217 result->setFillType(fillType); | 217 result->setFillType(fillType); |
218 SkPathWriter wrapper(*result); | 218 SkPathWriter wrapper(*result); |
219 bool closable; | 219 bool closable SK_INIT_TO_AVOID_WARNING; |
220 if (builder.xorMask() == kWinding_PathOpsMask | 220 if (builder.xorMask() == kWinding_PathOpsMask |
221 ? !bridgeWinding(contourList, &wrapper, &allocator, &closable) | 221 ? !bridgeWinding(contourList, &wrapper, &allocator, &closable) |
222 : !bridgeXor(contourList, &wrapper, &allocator, &closable)) { | 222 : !bridgeXor(contourList, &wrapper, &allocator, &closable)) { |
223 return false; | 223 return false; |
224 } | 224 } |
225 if (!closable) | 225 if (!closable) |
226 { // if some edges could not be resolved, assemble remaining fragments | 226 { // if some edges could not be resolved, assemble remaining fragments |
227 SkPath temp; | 227 SkPath temp; |
228 temp.setFillType(fillType); | 228 temp.setFillType(fillType); |
229 SkPathWriter assembled(temp); | 229 SkPathWriter assembled(temp); |
230 Assemble(wrapper, &assembled); | 230 Assemble(wrapper, &assembled); |
231 *result = *assembled.nativePath(); | 231 *result = *assembled.nativePath(); |
232 result->setFillType(fillType); | 232 result->setFillType(fillType); |
233 } | 233 } |
234 return true; | 234 return true; |
235 } | 235 } |
236 | 236 |
OLD | NEW |