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

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

Issue 272153002: fix bugs found by computing flat clips in 800K skps (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix maybe-uninitialized error in unbuntu Created 6 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
« no previous file with comments | « src/pathops/SkDCubicIntersection.cpp ('k') | src/pathops/SkDLineIntersection.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 "SkIntersections.h" 7 #include "SkIntersections.h"
8 #include "SkPathOpsCubic.h" 8 #include "SkPathOpsCubic.h"
9 #include "SkPathOpsLine.h" 9 #include "SkPathOpsLine.h"
10 10
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 } 254 }
255 255
256 /* Note that this does not look for endpoints of the line that are near the cubic. 256 /* Note that this does not look for endpoints of the line that are near the cubic.
257 These points are found later when check ends looks for missing points */ 257 These points are found later when check ends looks for missing points */
258 void addNearEndPoints() { 258 void addNearEndPoints() {
259 for (int cIndex = 0; cIndex < 4; cIndex += 3) { 259 for (int cIndex = 0; cIndex < 4; cIndex += 3) {
260 double cubicT = (double) (cIndex >> 1); 260 double cubicT = (double) (cIndex >> 1);
261 if (fIntersections->hasT(cubicT)) { 261 if (fIntersections->hasT(cubicT)) {
262 continue; 262 continue;
263 } 263 }
264 double lineT = fLine.nearPoint(fCubic[cIndex]); 264 double lineT = fLine.nearPoint(fCubic[cIndex], NULL);
265 if (lineT < 0) { 265 if (lineT < 0) {
266 continue; 266 continue;
267 } 267 }
268 fIntersections->insert(cubicT, lineT, fCubic[cIndex]); 268 fIntersections->insert(cubicT, lineT, fCubic[cIndex]);
269 } 269 }
270 } 270 }
271 271
272 void addExactHorizontalEndPoints(double left, double right, double y) { 272 void addExactHorizontalEndPoints(double left, double right, double y) {
273 for (int cIndex = 0; cIndex < 4; cIndex += 3) { 273 for (int cIndex = 0; cIndex < 4; cIndex += 3) {
274 double lineT = SkDLine::ExactPointH(fCubic[cIndex], left, right, y); 274 double lineT = SkDLine::ExactPointH(fCubic[cIndex], left, right, y);
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 } 394 }
395 395
396 int SkIntersections::intersectRay(const SkDCubic& cubic, const SkDLine& line) { 396 int SkIntersections::intersectRay(const SkDCubic& cubic, const SkDLine& line) {
397 LineCubicIntersections c(cubic, line, this); 397 LineCubicIntersections c(cubic, line, this);
398 fUsed = c.intersectRay(fT[0]); 398 fUsed = c.intersectRay(fT[0]);
399 for (int index = 0; index < fUsed; ++index) { 399 for (int index = 0; index < fUsed; ++index) {
400 fPt[index] = cubic.ptAtT(fT[0][index]); 400 fPt[index] = cubic.ptAtT(fT[0][index]);
401 } 401 }
402 return fUsed; 402 return fUsed;
403 } 403 }
OLDNEW
« no previous file with comments | « src/pathops/SkDCubicIntersection.cpp ('k') | src/pathops/SkDLineIntersection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698