| 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 | 157 |
| 158 // turn path into list of segments | 158 // turn path into list of segments |
| 159 SkTArray<SkOpContour> contours; | 159 SkTArray<SkOpContour> contours; |
| 160 SkOpEdgeBuilder builder(path, contours); | 160 SkOpEdgeBuilder builder(path, contours); |
| 161 if (!builder.finish()) { | 161 if (!builder.finish()) { |
| 162 return false; | 162 return false; |
| 163 } | 163 } |
| 164 SkTArray<SkOpContour*, true> contourList; | 164 SkTArray<SkOpContour*, true> contourList; |
| 165 MakeContourList(contours, contourList, false, false); | 165 MakeContourList(contours, contourList, false, false); |
| 166 SkOpContour** currentPtr = contourList.begin(); | 166 SkOpContour** currentPtr = contourList.begin(); |
| 167 result->reset(); |
| 167 result->setFillType(fillType); | 168 result->setFillType(fillType); |
| 168 result->reset(); | |
| 169 if (!currentPtr) { | 169 if (!currentPtr) { |
| 170 return true; | 170 return true; |
| 171 } | 171 } |
| 172 SkOpContour** listEnd = contourList.end(); | 172 SkOpContour** listEnd = contourList.end(); |
| 173 // find all intersections between segments | 173 // find all intersections between segments |
| 174 do { | 174 do { |
| 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); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 196 { // if some edges could not be resolved, assemble remaining fragments | 196 { // if some edges could not be resolved, assemble remaining fragments |
| 197 SkPath temp; | 197 SkPath temp; |
| 198 temp.setFillType(fillType); | 198 temp.setFillType(fillType); |
| 199 SkPathWriter assembled(temp); | 199 SkPathWriter assembled(temp); |
| 200 Assemble(simple, &assembled); | 200 Assemble(simple, &assembled); |
| 201 *result = *assembled.nativePath(); | 201 *result = *assembled.nativePath(); |
| 202 result->setFillType(fillType); | 202 result->setFillType(fillType); |
| 203 } | 203 } |
| 204 return true; | 204 return true; |
| 205 } | 205 } |
| OLD | NEW |