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

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

Issue 1113963002: use pathops utils to improve precision of cubic chopping in scan converter (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: use LineCubicIntersect utility for more robustness Created 5 years, 7 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/core/SkGeometry.cpp ('k') | src/pathops/SkPathOpsCubic.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 "SkPathOpsCubic.h" 8 #include "SkPathOpsCubic.h"
9 #include "SkPathOpsLine.h" 9 #include "SkPathOpsLine.h"
10 10
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 } 418 }
419 419
420 int SkIntersections::intersectRay(const SkDCubic& cubic, const SkDLine& line) { 420 int SkIntersections::intersectRay(const SkDCubic& cubic, const SkDLine& line) {
421 LineCubicIntersections c(cubic, line, this); 421 LineCubicIntersections c(cubic, line, this);
422 fUsed = c.intersectRay(fT[0]); 422 fUsed = c.intersectRay(fT[0]);
423 for (int index = 0; index < fUsed; ++index) { 423 for (int index = 0; index < fUsed; ++index) {
424 fPt[index] = cubic.ptAtT(fT[0][index]); 424 fPt[index] = cubic.ptAtT(fT[0][index]);
425 } 425 }
426 return fUsed; 426 return fUsed;
427 } 427 }
428
429 // SkDCubic accessors to Intersection utilities
430
431 int SkDCubic::horizontalIntersect(double yIntercept, double roots[3]) const {
432 return LineCubicIntersections::HorizontalIntersect(*this, yIntercept, roots) ;
433 }
434
435 int SkDCubic::verticalIntersect(double xIntercept, double roots[3]) const {
436 return LineCubicIntersections::VerticalIntersect(*this, xIntercept, roots);
437 }
OLDNEW
« no previous file with comments | « src/core/SkGeometry.cpp ('k') | src/pathops/SkPathOpsCubic.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698