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 "SkOpEdgeBuilder.h" | 7 #include "SkOpEdgeBuilder.h" |
8 #include "SkPathOpsCommon.h" | 8 #include "SkPathOpsCommon.h" |
9 #include "SkPathWriter.h" | 9 #include "SkPathWriter.h" |
10 #include "SkTSort.h" | 10 #include "SkTSort.h" |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 match them up | 392 match them up |
393 connect closest | 393 connect closest |
394 reassemble contour pieces into new path | 394 reassemble contour pieces into new path |
395 */ | 395 */ |
396 void Assemble(const SkPathWriter& path, SkPathWriter* simple) { | 396 void Assemble(const SkPathWriter& path, SkPathWriter* simple) { |
397 #if DEBUG_PATH_CONSTRUCTION | 397 #if DEBUG_PATH_CONSTRUCTION |
398 SkDebugf("%s\n", __FUNCTION__); | 398 SkDebugf("%s\n", __FUNCTION__); |
399 #endif | 399 #endif |
400 SkTArray<SkOpContour> contours; | 400 SkTArray<SkOpContour> contours; |
401 SkOpEdgeBuilder builder(path, contours); | 401 SkOpEdgeBuilder builder(path, contours); |
| 402 builder.setAllowOpenContours(true); |
402 builder.finish(); | 403 builder.finish(); |
403 int count = contours.count(); | 404 int count = contours.count(); |
404 int outer; | 405 int outer; |
405 SkTDArray<int> runs; // indices of partial contours | 406 SkTDArray<int> runs; // indices of partial contours |
406 for (outer = 0; outer < count; ++outer) { | 407 for (outer = 0; outer < count; ++outer) { |
407 const SkOpContour& eContour = contours[outer]; | 408 const SkOpContour& eContour = contours[outer]; |
408 const SkPoint& eStart = eContour.start(); | 409 const SkPoint& eStart = eContour.start(); |
409 const SkPoint& eEnd = eContour.end(); | 410 const SkPoint& eEnd = eContour.end(); |
410 #if DEBUG_ASSEMBLE | 411 #if DEBUG_ASSEMBLE |
411 SkDebugf("%s contour", __FUNCTION__); | 412 SkDebugf("%s contour", __FUNCTION__); |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 } | 575 } |
575 } | 576 } |
576 } while (rIndex < count); | 577 } while (rIndex < count); |
577 #if DEBUG_ASSEMBLE | 578 #if DEBUG_ASSEMBLE |
578 for (rIndex = 0; rIndex < count; ++rIndex) { | 579 for (rIndex = 0; rIndex < count; ++rIndex) { |
579 SkASSERT(sLink[rIndex] == SK_MaxS32); | 580 SkASSERT(sLink[rIndex] == SK_MaxS32); |
580 SkASSERT(eLink[rIndex] == SK_MaxS32); | 581 SkASSERT(eLink[rIndex] == SK_MaxS32); |
581 } | 582 } |
582 #endif | 583 #endif |
583 } | 584 } |
OLD | NEW |