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

Side by Side Diff: src/pathops/SkDConicLineIntersection.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/SkAddIntersections.cpp ('k') | src/pathops/SkDCubicLineIntersection.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 2015 Google Inc. 2 * Copyright 2015 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 "SkPathOpsConic.h" 8 #include "SkPathOpsConic.h"
9 #include "SkPathOpsCurve.h" 9 #include "SkPathOpsCurve.h"
10 #include "SkPathOpsLine.h" 10 #include "SkPathOpsLine.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 this->addExactEndPoints(); 98 this->addExactEndPoints();
99 if (fAllowNear) { 99 if (fAllowNear) {
100 this->addNearEndPoints(); 100 this->addNearEndPoints();
101 } 101 }
102 double rootVals[2]; 102 double rootVals[2];
103 int roots = this->intersectRay(rootVals); 103 int roots = this->intersectRay(rootVals);
104 for (int index = 0; index < roots; ++index) { 104 for (int index = 0; index < roots; ++index) {
105 double conicT = rootVals[index]; 105 double conicT = rootVals[index];
106 double lineT = this->findLineT(conicT); 106 double lineT = this->findLineT(conicT);
107 #ifdef SK_DEBUG 107 #ifdef SK_DEBUG
108 if (!fIntersections->debugGlobalState() 108 if (!fIntersections->globalState()
109 || !fIntersections->debugGlobalState()->debugSkipAssert()) { 109 || !fIntersections->globalState()->debugSkipAssert()) {
110 SkDEBUGCODE(SkDPoint conicPt = fConic.ptAtT(conicT)); 110 SkDEBUGCODE(SkDPoint conicPt = fConic.ptAtT(conicT));
111 SkDEBUGCODE(SkDPoint linePt = fLine->ptAtT(lineT)); 111 SkDEBUGCODE(SkDPoint linePt = fLine->ptAtT(lineT));
112 SkASSERT(conicPt.approximatelyDEqual(linePt)); 112 SkASSERT(conicPt.approximatelyDEqual(linePt));
113 } 113 }
114 #endif 114 #endif
115 SkDPoint pt; 115 SkDPoint pt;
116 if (this->pinTs(&conicT, &lineT, &pt, kPointUninitialized) 116 if (this->pinTs(&conicT, &lineT, &pt, kPointUninitialized)
117 && this->uniqueAnswer(conicT, pt)) { 117 && this->uniqueAnswer(conicT, pt)) {
118 fIntersections->insert(conicT, lineT, pt); 118 fIntersections->insert(conicT, lineT, pt);
119 } 119 }
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 375
376 int SkIntersections::HorizontalIntercept(const SkDConic& conic, SkScalar y, doub le* roots) { 376 int SkIntersections::HorizontalIntercept(const SkDConic& conic, SkScalar y, doub le* roots) {
377 LineConicIntersections c(conic); 377 LineConicIntersections c(conic);
378 return c.horizontalIntersect(y, roots); 378 return c.horizontalIntersect(y, roots);
379 } 379 }
380 380
381 int SkIntersections::VerticalIntercept(const SkDConic& conic, SkScalar x, double * roots) { 381 int SkIntersections::VerticalIntercept(const SkDConic& conic, SkScalar x, double * roots) {
382 LineConicIntersections c(conic); 382 LineConicIntersections c(conic);
383 return c.verticalIntersect(x, roots); 383 return c.verticalIntersect(x, roots);
384 } 384 }
OLDNEW
« no previous file with comments | « src/pathops/SkAddIntersections.cpp ('k') | src/pathops/SkDCubicLineIntersection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698