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

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

Issue 2426173002: fix fuzzers (Closed)
Patch Set: fix dm Created 4 years, 2 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 | « src/pathops/SkDCubicLineIntersection.cpp ('k') | src/pathops/SkIntersections.h » ('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 "SkIntersections.h" 7 #include "SkIntersections.h"
8 #include "SkPathOpsLine.h" 8 #include "SkPathOpsLine.h"
9 9
10 void SkIntersections::cleanUpParallelLines(bool parallel) { 10 void SkIntersections::cleanUpParallelLines(bool parallel) {
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 if (nearCount != 2 || aNotB[0] == aNotB[1]) { 145 if (nearCount != 2 || aNotB[0] == aNotB[1]) {
146 for (int iA = 0; iA < 2; ++iA) { 146 for (int iA = 0; iA < 2; ++iA) {
147 if (!aNotB[iA]) { 147 if (!aNotB[iA]) {
148 continue; 148 continue;
149 } 149 }
150 int nearer = aNearB[iA] > 0.5; 150 int nearer = aNearB[iA] > 0.5;
151 if (!bNotA[nearer]) { 151 if (!bNotA[nearer]) {
152 continue; 152 continue;
153 } 153 }
154 SkASSERT(a[iA] != b[nearer]); 154 SkASSERT(a[iA] != b[nearer]);
155 SkASSERT(iA == (bNearA[nearer] > 0.5)); 155 SkOPASSERT(iA == (bNearA[nearer] > 0.5));
156 insertNear(iA, nearer, a[iA], b[nearer]); 156 insertNear(iA, nearer, a[iA], b[nearer]);
157 aNearB[iA] = -1; 157 aNearB[iA] = -1;
158 bNearA[nearer] = -1; 158 bNearA[nearer] = -1;
159 nearCount -= 2; 159 nearCount -= 2;
160 } 160 }
161 } 161 }
162 if (nearCount > 0) { 162 if (nearCount > 0) {
163 for (int iA = 0; iA < 2; ++iA) { 163 for (int iA = 0; iA < 2; ++iA) {
164 if (aNearB[iA] >= 0) { 164 if (aNearB[iA] >= 0) {
165 insert(iA, aNearB[iA], a[iA]); 165 insert(iA, aNearB[iA], a[iA]);
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 insert((double) index, flipped ? 1 - t : t, line[index]); 324 insert((double) index, flipped ? 1 - t : t, line[index]);
325 } 325 }
326 } 326 }
327 } 327 }
328 } 328 }
329 cleanUpParallelLines(result == 2); 329 cleanUpParallelLines(result == 2);
330 SkASSERT(fUsed <= 2); 330 SkASSERT(fUsed <= 2);
331 return fUsed; 331 return fUsed;
332 } 332 }
333 333
OLDNEW
« no previous file with comments | « src/pathops/SkDCubicLineIntersection.cpp ('k') | src/pathops/SkIntersections.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698