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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 return c.verticalIntersect(x, top, bottom, flipped); | 250 return c.verticalIntersect(x, top, bottom, flipped); |
251 } | 251 } |
252 | 252 |
253 int SkIntersections::intersect(const SkDCubic& cubic, const SkDLine& line) { | 253 int SkIntersections::intersect(const SkDCubic& cubic, const SkDLine& line) { |
254 LineCubicIntersections c(cubic, line, *this); | 254 LineCubicIntersections c(cubic, line, *this); |
255 return c.intersect(); | 255 return c.intersect(); |
256 } | 256 } |
257 | 257 |
258 int SkIntersections::intersectRay(const SkDCubic& cubic, const SkDLine& line) { | 258 int SkIntersections::intersectRay(const SkDCubic& cubic, const SkDLine& line) { |
259 LineCubicIntersections c(cubic, line, *this); | 259 LineCubicIntersections c(cubic, line, *this); |
260 return c.intersectRay(fT[0]); | 260 fUsed = c.intersectRay(fT[0]); |
| 261 for (int index = 0; index < fUsed; ++index) { |
| 262 fPt[index] = cubic.xyAtT(fT[0][index]); |
| 263 } |
| 264 return fUsed; |
261 } | 265 } |
OLD | NEW |