OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |