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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 int maxWinding, sumWinding, oppMaxWinding, oppSumWinding; | 85 int maxWinding, sumWinding, oppMaxWinding, oppSumWinding; |
86 segment->setUpWindings(start, end, &sumMiWinding, &sumSuWinding, | 86 segment->setUpWindings(start, end, &sumMiWinding, &sumSuWinding, |
87 &maxWinding, &sumWinding, &oppMaxWinding, &oppSumWinding); | 87 &maxWinding, &sumWinding, &oppMaxWinding, &oppSumWinding); |
88 if (!segment->done(angle)) { | 88 if (!segment->done(angle)) { |
89 if (!first) { | 89 if (!first) { |
90 first = segment; | 90 first = segment; |
91 nextStart = start; | 91 nextStart = start; |
92 nextEnd = end; | 92 nextEnd = end; |
93 } | 93 } |
94 (void) segment->markAngle(maxWinding, sumWinding, oppMaxWinding, | 94 (void) segment->markAngle(maxWinding, sumWinding, oppMaxWinding, |
95 oppSumWinding, true, angle); | 95 oppSumWinding, angle); |
96 } | 96 } |
97 } while (++nextIndex != lastIndex); | 97 } while (++nextIndex != lastIndex); |
98 if (first) { | 98 if (first) { |
99 #if TRY_ROTATE | 99 #if TRY_ROTATE |
100 *chase.insert(0) = span; | 100 *chase.insert(0) = span; |
101 #else | 101 #else |
102 *chase.append() = span; | 102 *chase.append() = span; |
103 #endif | 103 #endif |
104 return first; | 104 return first; |
105 } | 105 } |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 { // if some edges could not be resolved, assemble remaining fragments | 311 { // if some edges could not be resolved, assemble remaining fragments |
312 SkPath temp; | 312 SkPath temp; |
313 temp.setFillType(fillType); | 313 temp.setFillType(fillType); |
314 SkPathWriter assembled(temp); | 314 SkPathWriter assembled(temp); |
315 Assemble(wrapper, &assembled); | 315 Assemble(wrapper, &assembled); |
316 *result = *assembled.nativePath(); | 316 *result = *assembled.nativePath(); |
317 result->setFillType(fillType); | 317 result->setFillType(fillType); |
318 } | 318 } |
319 return true; | 319 return true; |
320 } | 320 } |
OLD | NEW |