OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 | 7 |
8 #include "SkMatrix.h" | 8 #include "SkMatrix.h" |
9 #include "SkOpEdgeBuilder.h" | 9 #include "SkOpEdgeBuilder.h" |
10 #include "SkPathPriv.h" | 10 #include "SkPathPriv.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 if (dir != SkPathPriv::kCCW_FirstDirection) { | 37 if (dir != SkPathPriv::kCCW_FirstDirection) { |
38 SkPath temp; | 38 SkPath temp; |
39 temp.reverseAddPath(*path); | 39 temp.reverseAddPath(*path); |
40 *path = temp; | 40 *path = temp; |
41 } | 41 } |
42 path->setFillType(fillType); | 42 path->setFillType(fillType); |
43 return; | 43 return; |
44 } | 44 } |
45 SkChunkAlloc allocator(4096); | 45 SkChunkAlloc allocator(4096); |
46 SkOpContourHead contourHead; | 46 SkOpContourHead contourHead; |
47 SkOpGlobalState globalState(NULL, &contourHead SkDEBUGPARAMS(NULL)); | 47 SkOpGlobalState globalState(nullptr, &contourHead SkDEBUGPARAMS(nullptr)); |
48 SkOpEdgeBuilder builder(*path, &contourHead, &allocator, &globalState); | 48 SkOpEdgeBuilder builder(*path, &contourHead, &allocator, &globalState); |
49 builder.finish(&allocator); | 49 builder.finish(&allocator); |
50 SkASSERT(contourHead.next()); | 50 SkASSERT(contourHead.next()); |
51 contourHead.resetReverse(); | 51 contourHead.resetReverse(); |
52 bool writePath = false; | 52 bool writePath = false; |
53 SkOpSpan* topSpan; | 53 SkOpSpan* topSpan; |
54 globalState.setPhase(SkOpGlobalState::kFixWinding); | 54 globalState.setPhase(SkOpGlobalState::kFixWinding); |
55 while ((topSpan = FindSortableTop(&contourHead))) { | 55 while ((topSpan = FindSortableTop(&contourHead))) { |
56 SkOpSegment* topSegment = topSpan->segment(); | 56 SkOpSegment* topSegment = topSpan->segment(); |
57 SkOpContour* topContour = topSegment->contour(); | 57 SkOpContour* topContour = topSegment->contour(); |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 sum.addPath(fPathRefs[index]); | 164 sum.addPath(fPathRefs[index]); |
165 } | 165 } |
166 } | 166 } |
167 reset(); | 167 reset(); |
168 bool success = Simplify(sum, result); | 168 bool success = Simplify(sum, result); |
169 if (!success) { | 169 if (!success) { |
170 *result = original; | 170 *result = original; |
171 } | 171 } |
172 return success; | 172 return success; |
173 } | 173 } |
OLD | NEW |