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 "SkOpEdgeBuilder.h" | 8 #include "SkOpEdgeBuilder.h" |
9 #include "SkPathOpsCommon.h" | 9 #include "SkPathOpsCommon.h" |
10 #include "SkPathWriter.h" | 10 #include "SkPathWriter.h" |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 SkOpContour** nextPtr = currentPtr; | 175 SkOpContour** nextPtr = currentPtr; |
176 SkOpContour* current = *currentPtr++; | 176 SkOpContour* current = *currentPtr++; |
177 if (current->containsCubics()) { | 177 if (current->containsCubics()) { |
178 AddSelfIntersectTs(current); | 178 AddSelfIntersectTs(current); |
179 } | 179 } |
180 SkOpContour* next; | 180 SkOpContour* next; |
181 do { | 181 do { |
182 next = *nextPtr++; | 182 next = *nextPtr++; |
183 } while (AddIntersectTs(current, next) && nextPtr != listEnd); | 183 } while (AddIntersectTs(current, next) && nextPtr != listEnd); |
184 } while (currentPtr != listEnd); | 184 } while (currentPtr != listEnd); |
185 // eat through coincident edges | 185 HandleCoincidence(&contourList, 0); |
186 CoincidenceCheck(&contourList, 0); | |
187 FixOtherTIndex(&contourList); | |
188 CheckEnds(&contourList); | |
189 CheckTiny(&contourList); | |
190 SortSegments(&contourList); | |
191 #if DEBUG_ACTIVE_SPANS || DEBUG_ACTIVE_SPANS_FIRST_ONLY | |
192 DebugShowActiveSpans(contourList); | |
193 #endif | |
194 // construct closed contours | 186 // construct closed contours |
195 SkPathWriter simple(*result); | 187 SkPathWriter simple(*result); |
196 if (builder.xorMask() == kWinding_PathOpsMask ? bridgeWinding(contourList, &
simple) | 188 if (builder.xorMask() == kWinding_PathOpsMask ? bridgeWinding(contourList, &
simple) |
197 : !bridgeXor(contourList, &simple)) | 189 : !bridgeXor(contourList, &simple)) |
198 { // if some edges could not be resolved, assemble remaining fragments | 190 { // if some edges could not be resolved, assemble remaining fragments |
199 SkPath temp; | 191 SkPath temp; |
200 temp.setFillType(fillType); | 192 temp.setFillType(fillType); |
201 SkPathWriter assembled(temp); | 193 SkPathWriter assembled(temp); |
202 Assemble(simple, &assembled); | 194 Assemble(simple, &assembled); |
203 *result = *assembled.nativePath(); | 195 *result = *assembled.nativePath(); |
204 result->setFillType(fillType); | 196 result->setFillType(fillType); |
205 } | 197 } |
206 return true; | 198 return true; |
207 } | 199 } |
OLD | NEW |