OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright 2015 Google Inc. |
| 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. |
| 6 */ |
| 7 #include "SkIntersections.h" |
| 8 #include "SkPathOpsConic.h" |
| 9 #include "SkPathOpsLine.h" |
| 10 |
| 11 class LineConicIntersections { |
| 12 public: |
| 13 LineConicIntersections(const SkDConic& c, const SkDLine& l, SkIntersections*
i) |
| 14 : fConic(c) |
| 15 , fLine(l) |
| 16 , fIntersections(i) |
| 17 , fAllowNear(true) { |
| 18 i->setMax(3); // allow short partial coincidence plus discrete intersec
tion |
| 19 } |
| 20 |
| 21 void allowNear(bool allow) { |
| 22 fAllowNear = allow; |
| 23 } |
| 24 |
| 25 int intersectRay(double roots[2]) { |
| 26 return 0; |
| 27 } |
| 28 }; |
| 29 |
| 30 int SkIntersections::intersectRay(const SkDConic& conic, const SkDLine& line) { |
| 31 LineConicIntersections c(conic, line, this); |
| 32 fUsed = c.intersectRay(fT[0]); |
| 33 for (int index = 0; index < fUsed; ++index) { |
| 34 fPt[index] = conic.ptAtT(fT[0][index]); |
| 35 } |
| 36 return fUsed; |
| 37 } |
OLD | NEW |