| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 SkOpContourHead contourHead; | 46 SkOpContourHead contourHead; |
| 47 SkOpGlobalState globalState(&contourHead, &allocator SkDEBUGPARAMS(false) | 47 SkOpGlobalState globalState(&contourHead, &allocator SkDEBUGPARAMS(false) |
| 48 SkDEBUGPARAMS(nullptr)); | 48 SkDEBUGPARAMS(nullptr)); |
| 49 SkOpEdgeBuilder builder(*path, &contourHead, &globalState); | 49 SkOpEdgeBuilder builder(*path, &contourHead, &globalState); |
| 50 if (builder.unparseable() || !builder.finish()) { | 50 if (builder.unparseable() || !builder.finish()) { |
| 51 return false; | 51 return false; |
| 52 } | 52 } |
| 53 if (!contourHead.count()) { | 53 if (!contourHead.count()) { |
| 54 return true; | 54 return true; |
| 55 } | 55 } |
| 56 SkASSERT(contourHead.next()); | 56 if (!contourHead.next()) { |
| 57 return false; |
| 58 } |
| 57 contourHead.joinAllSegments(); | 59 contourHead.joinAllSegments(); |
| 58 contourHead.resetReverse(); | 60 contourHead.resetReverse(); |
| 59 bool writePath = false; | 61 bool writePath = false; |
| 60 SkOpSpan* topSpan; | 62 SkOpSpan* topSpan; |
| 61 globalState.setPhase(SkOpGlobalState::kFixWinding); | 63 globalState.setPhase(SkOpGlobalState::kFixWinding); |
| 62 while ((topSpan = FindSortableTop(&contourHead))) { | 64 while ((topSpan = FindSortableTop(&contourHead))) { |
| 63 SkOpSegment* topSegment = topSpan->segment(); | 65 SkOpSegment* topSegment = topSpan->segment(); |
| 64 SkOpContour* topContour = topSegment->contour(); | 66 SkOpContour* topContour = topSegment->contour(); |
| 65 SkASSERT(topContour->isCcw() >= 0); | 67 SkASSERT(topContour->isCcw() >= 0); |
| 66 #if DEBUG_WINDING | 68 #if DEBUG_WINDING |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 sum.addPath(fPathRefs[index]); | 177 sum.addPath(fPathRefs[index]); |
| 176 } | 178 } |
| 177 } | 179 } |
| 178 reset(); | 180 reset(); |
| 179 bool success = Simplify(sum, result); | 181 bool success = Simplify(sum, result); |
| 180 if (!success) { | 182 if (!success) { |
| 181 *result = original; | 183 *result = original; |
| 182 } | 184 } |
| 183 return success; | 185 return success; |
| 184 } | 186 } |
| OLD | NEW |