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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 return false; | 295 return false; |
296 } | 296 } |
297 // mark spans of coincident segments as coincident | 297 // mark spans of coincident segments as coincident |
298 coincidence->mark(DEBUG_COIN_ONLY_PARAMS()); | 298 coincidence->mark(DEBUG_COIN_ONLY_PARAMS()); |
299 // look for coincidence lines and curves undetected by intersection | 299 // look for coincidence lines and curves undetected by intersection |
300 if (missing_coincidence(contourList DEBUG_COIN_PARAMS())) { | 300 if (missing_coincidence(contourList DEBUG_COIN_PARAMS())) { |
301 (void) coincidence->expand(DEBUG_PHASE_ONLY_PARAMS(kIntersecting)); | 301 (void) coincidence->expand(DEBUG_PHASE_ONLY_PARAMS(kIntersecting)); |
302 if (!coincidence->addExpanded(DEBUG_COIN_ONLY_PARAMS())) { | 302 if (!coincidence->addExpanded(DEBUG_COIN_ONLY_PARAMS())) { |
303 return false; | 303 return false; |
304 } | 304 } |
305 coincidence->mark(DEBUG_PHASE_ONLY_PARAMS(kWalking)); | 305 if (!coincidence->mark(DEBUG_PHASE_ONLY_PARAMS(kWalking))) { |
| 306 return false; |
| 307 } |
306 } else { | 308 } else { |
307 (void) coincidence->expand(DEBUG_COIN_ONLY_PARAMS()); | 309 (void) coincidence->expand(DEBUG_COIN_ONLY_PARAMS()); |
308 } | 310 } |
309 (void) coincidence->expand(DEBUG_COIN_ONLY_PARAMS()); | 311 (void) coincidence->expand(DEBUG_COIN_ONLY_PARAMS()); |
310 | 312 |
311 SkOpCoincidence overlaps(globalState); | 313 SkOpCoincidence overlaps(globalState); |
312 safetyHatch = SAFETY_COUNT; | 314 safetyHatch = SAFETY_COUNT; |
313 do { | 315 do { |
314 SkOpCoincidence* pairs = overlaps.isEmpty() ? coincidence : &overlaps; | 316 SkOpCoincidence* pairs = overlaps.isEmpty() ? coincidence : &overlaps; |
315 // adjust the winding value to account for coincident edges | 317 // adjust the winding value to account for coincident edges |
(...skipping 12 matching lines...) Expand all Loading... |
328 sort_angles(contourList); | 330 sort_angles(contourList); |
329 #if DEBUG_COINCIDENCE_VERBOSE | 331 #if DEBUG_COINCIDENCE_VERBOSE |
330 coincidence->debugShowCoincidence(); | 332 coincidence->debugShowCoincidence(); |
331 #endif | 333 #endif |
332 #if DEBUG_COINCIDENCE | 334 #if DEBUG_COINCIDENCE |
333 coincidence->debugValidate(); | 335 coincidence->debugValidate(); |
334 #endif | 336 #endif |
335 SkPathOpsDebug::ShowActiveSpans(contourList); | 337 SkPathOpsDebug::ShowActiveSpans(contourList); |
336 return true; | 338 return true; |
337 } | 339 } |
OLD | NEW |