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 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 check start and end of each contour | 439 check start and end of each contour |
440 if not the same, record them | 440 if not the same, record them |
441 match them up | 441 match them up |
442 connect closest | 442 connect closest |
443 reassemble contour pieces into new path | 443 reassemble contour pieces into new path |
444 */ | 444 */ |
445 void Assemble(const SkPathWriter& path, SkPathWriter* simple) { | 445 void Assemble(const SkPathWriter& path, SkPathWriter* simple) { |
446 SkChunkAlloc allocator(4096); // FIXME: constant-ize, tune | 446 SkChunkAlloc allocator(4096); // FIXME: constant-ize, tune |
447 SkOpContour contour; | 447 SkOpContour contour; |
448 SkOpGlobalState globalState(NULL SkDEBUGPARAMS(&contour)); | 448 SkOpGlobalState globalState(NULL SkDEBUGPARAMS(&contour)); |
| 449 #if DEBUG_SHOW_TEST_NAME |
| 450 SkDebugf("</div>\n"); |
| 451 #endif |
449 #if DEBUG_PATH_CONSTRUCTION | 452 #if DEBUG_PATH_CONSTRUCTION |
450 SkDebugf("%s\n", __FUNCTION__); | 453 SkDebugf("%s\n", __FUNCTION__); |
451 #endif | 454 #endif |
452 SkOpEdgeBuilder builder(path, &contour, &allocator, &globalState); | 455 SkOpEdgeBuilder builder(path, &contour, &allocator, &globalState); |
453 builder.finish(&allocator); | 456 builder.finish(&allocator); |
454 SkTDArray<const SkOpContour* > runs; // indices of partial contours | 457 SkTDArray<const SkOpContour* > runs; // indices of partial contours |
455 const SkOpContour* eContour = builder.head(); | 458 const SkOpContour* eContour = builder.head(); |
456 do { | 459 do { |
457 if (!eContour->count()) { | 460 if (!eContour->count()) { |
458 continue; | 461 continue; |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
710 missingCoincidence(contourList, coincidence, allocator); | 713 missingCoincidence(contourList, coincidence, allocator); |
711 if (!coincidence->apply()) { | 714 if (!coincidence->apply()) { |
712 return false; | 715 return false; |
713 } | 716 } |
714 } | 717 } |
715 #if DEBUG_ACTIVE_SPANS | 718 #if DEBUG_ACTIVE_SPANS |
716 DebugShowActiveSpans(*contourList); | 719 DebugShowActiveSpans(*contourList); |
717 #endif | 720 #endif |
718 return true; | 721 return true; |
719 } | 722 } |
OLD | NEW |