| 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" |
| 11 #include "SkPathWriter.h" | 11 #include "SkPathWriter.h" |
| 12 | 12 |
| 13 static bool bridgeWinding(SkTDArray<SkOpContour* >& contourList, SkPathWriter* s
imple, | 13 static bool bridgeWinding(SkTDArray<SkOpContour* >& contourList, SkPathWriter* s
imple, |
| 14 SkChunkAlloc* allocator) { | 14 SkChunkAlloc* allocator) { |
| 15 bool firstContour = true; | 15 bool firstContour = true; |
| 16 bool unsortable = false; | 16 bool unsortable = false; |
| 17 bool topUnsortable = false; | 17 bool topUnsortable = false; |
| 18 bool firstPass = true; | 18 bool firstPass = true; |
| 19 SkPoint lastTopLeft; | 19 SkPoint lastTopLeft; |
| 20 SkPoint topLeft = {SK_ScalarMin, SK_ScalarMin}; | 20 SkPoint topLeft = {SK_ScalarMin, SK_ScalarMin}; |
| 21 do { | 21 do { |
| 22 SkOpSpanBase* start; | 22 SkOpSpanBase* start = NULL; |
| 23 SkOpSpanBase* end; | 23 SkOpSpanBase* end = NULL; |
| 24 bool topDone; | 24 bool topDone; |
| 25 bool onlyVertical = false; | 25 bool onlyVertical = false; |
| 26 lastTopLeft = topLeft; | 26 lastTopLeft = topLeft; |
| 27 SkOpSegment* current = FindSortableTop(contourList, firstPass, SkOpAngle
::kUnaryWinding, | 27 SkOpSegment* current = FindSortableTop(contourList, firstPass, SkOpAngle
::kUnaryWinding, |
| 28 &firstContour, &start, &end, &topLeft, &topUnsortable, &topDone,
&onlyVertical, | 28 &firstContour, &start, &end, &topLeft, &topUnsortable, &topDone,
&onlyVertical, |
| 29 allocator); | 29 allocator); |
| 30 if (!current) { | 30 if (!current) { |
| 31 if ((!topUnsortable || firstPass) && !topDone) { | 31 if ((!topUnsortable || firstPass) && !topDone) { |
| 32 SkASSERT(topLeft.fX != SK_ScalarMin && topLeft.fY != SK_ScalarMi
n); | 32 SkASSERT(topLeft.fX != SK_ScalarMin && topLeft.fY != SK_ScalarMi
n); |
| 33 if (lastTopLeft.fX == SK_ScalarMin && lastTopLeft.fY == SK_Scala
rMin) { | 33 if (lastTopLeft.fX == SK_ScalarMin && lastTopLeft.fY == SK_Scala
rMin) { |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after 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 |