Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/pathops/SkPathOpsSimplify.cpp

Issue 17432003: SkPath::rewind needs to have same reset as SkPath::reset. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/core/SkPath.cpp ('k') | tests/PathTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « src/core/SkPath.cpp ('k') | tests/PathTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698