OLD | NEW |
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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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->debugGlobalState() |
109 || !fIntersections->debugGlobalState()->debugSkipAssert()) { | 109 || !fIntersections->debugGlobalState()->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.approximatelyEqual(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 } |
120 } | 120 } |
121 this->checkCoincident(); | 121 this->checkCoincident(); |
122 return fIntersections->used(); | 122 return fIntersections->used(); |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 } |
OLD | NEW |