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

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

Issue 1218863005: don't fix winding for empty paths (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « no previous file | src/pathops/SkOpSpan.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 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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 reset(); 151 reset();
152 return true; 152 return true;
153 } 153 }
154 SkPath sum; 154 SkPath sum;
155 for (int index = 0; index < count; ++index) { 155 for (int index = 0; index < count; ++index) {
156 if (!Simplify(fPathRefs[index], &fPathRefs[index])) { 156 if (!Simplify(fPathRefs[index], &fPathRefs[index])) {
157 reset(); 157 reset();
158 *result = original; 158 *result = original;
159 return false; 159 return false;
160 } 160 }
161 // convert the even odd result back to winding form before accumulating it 161 if (!fPathRefs[index].isEmpty()) {
162 FixWinding(&fPathRefs[index]); 162 // convert the even odd result back to winding form before accumulat ing it
163 sum.addPath(fPathRefs[index]); 163 FixWinding(&fPathRefs[index]);
164 sum.addPath(fPathRefs[index]);
165 }
164 } 166 }
165 reset(); 167 reset();
166 bool success = Simplify(sum, result); 168 bool success = Simplify(sum, result);
167 if (!success) { 169 if (!success) {
168 *result = original; 170 *result = original;
169 } 171 }
170 return success; 172 return success;
171 } 173 }
OLDNEW
« no previous file with comments | « no previous file | src/pathops/SkOpSpan.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698