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

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

Issue 2169983002: let line/cubic intersect at four spots (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove the right unneeded test Created 4 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 | tests/PathOpsOpTest.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 "SkPathOpsCurve.h" 9 #include "SkPathOpsCurve.h"
10 #include "SkPathOpsLine.h" 10 #include "SkPathOpsLine.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 enum PinTPoint { 80 enum PinTPoint {
81 kPointUninitialized, 81 kPointUninitialized,
82 kPointInitialized 82 kPointInitialized
83 }; 83 };
84 84
85 LineCubicIntersections(const SkDCubic& c, const SkDLine& l, SkIntersections* i) 85 LineCubicIntersections(const SkDCubic& c, const SkDLine& l, SkIntersections* i)
86 : fCubic(c) 86 : fCubic(c)
87 , fLine(l) 87 , fLine(l)
88 , fIntersections(i) 88 , fIntersections(i)
89 , fAllowNear(true) { 89 , fAllowNear(true) {
90 i->setMax(3); 90 i->setMax(4);
91 } 91 }
92 92
93 void allowNear(bool allow) { 93 void allowNear(bool allow) {
94 fAllowNear = allow; 94 fAllowNear = allow;
95 } 95 }
96 96
97 void checkCoincident() { 97 void checkCoincident() {
98 int last = fIntersections->used() - 1; 98 int last = fIntersections->used() - 1;
99 for (int index = 0; index < last; ) { 99 for (int index = 0; index < last; ) {
100 double cubicMidT = ((*fIntersections)[0][index] + (*fIntersections)[ 0][index + 1]) / 2; 100 double cubicMidT = ((*fIntersections)[0][index] + (*fIntersections)[ 0][index + 1]) / 2;
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 445
446 // SkDCubic accessors to Intersection utilities 446 // SkDCubic accessors to Intersection utilities
447 447
448 int SkDCubic::horizontalIntersect(double yIntercept, double roots[3]) const { 448 int SkDCubic::horizontalIntersect(double yIntercept, double roots[3]) const {
449 return LineCubicIntersections::HorizontalIntersect(*this, yIntercept, roots) ; 449 return LineCubicIntersections::HorizontalIntersect(*this, yIntercept, roots) ;
450 } 450 }
451 451
452 int SkDCubic::verticalIntersect(double xIntercept, double roots[3]) const { 452 int SkDCubic::verticalIntersect(double xIntercept, double roots[3]) const {
453 return LineCubicIntersections::VerticalIntersect(*this, xIntercept, roots); 453 return LineCubicIntersections::VerticalIntersect(*this, xIntercept, roots);
454 } 454 }
OLDNEW
« no previous file with comments | « no previous file | tests/PathOpsOpTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698