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 | 7 |
8 #include "SkIntersections.h" | 8 #include "SkIntersections.h" |
9 | 9 |
10 void SkIntersections::append(const SkIntersections& i) { | 10 void SkIntersections::append(const SkIntersections& i) { |
11 for (int index = 0; index < i.fUsed; ++index) { | 11 for (int index = 0; index < i.fUsed; ++index) { |
12 insert(i[0][index], i[1][index], i.pt(index)); | 12 insert(i[0][index], i[1][index], i.pt(index)); |
13 } | 13 } |
14 } | 14 } |
15 | 15 |
16 int (SkIntersections::*CurveVertical[])(const SkPoint[], SkScalar, SkScalar, SkS
calar, bool) = { | 16 int (SkIntersections::* const CurveVertical[])(const SkPoint[], SkScalar, SkScal
ar, SkScalar, bool) = { |
17 NULL, | 17 NULL, |
18 &SkIntersections::verticalLine, | 18 &SkIntersections::verticalLine, |
19 &SkIntersections::verticalQuad, | 19 &SkIntersections::verticalQuad, |
20 &SkIntersections::verticalCubic | 20 &SkIntersections::verticalCubic |
21 }; | 21 }; |
22 | 22 |
23 int (SkIntersections::*CurveRay[])(const SkPoint[], const SkDLine&) = { | 23 int ( SkIntersections::* const CurveRay[])(const SkPoint[], const SkDLine&) = { |
24 NULL, | 24 NULL, |
25 &SkIntersections::lineRay, | 25 &SkIntersections::lineRay, |
26 &SkIntersections::quadRay, | 26 &SkIntersections::quadRay, |
27 &SkIntersections::cubicRay | 27 &SkIntersections::cubicRay |
28 }; | 28 }; |
29 | 29 |
30 int SkIntersections::coincidentUsed() const { | 30 int SkIntersections::coincidentUsed() const { |
31 if (!fIsCoincident[0]) { | 31 if (!fIsCoincident[0]) { |
32 SkASSERT(!fIsCoincident[1]); | 32 SkASSERT(!fIsCoincident[1]); |
33 return 0; | 33 return 0; |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 quad.set(a); | 198 quad.set(a); |
199 return vertical(quad, top, bottom, x, flipped); | 199 return vertical(quad, top, bottom, x, flipped); |
200 } | 200 } |
201 | 201 |
202 int SkIntersections::verticalCubic(const SkPoint a[4], SkScalar top, SkScalar bo
ttom, | 202 int SkIntersections::verticalCubic(const SkPoint a[4], SkScalar top, SkScalar bo
ttom, |
203 SkScalar x, bool flipped) { | 203 SkScalar x, bool flipped) { |
204 SkDCubic cubic; | 204 SkDCubic cubic; |
205 cubic.set(a); | 205 cubic.set(a); |
206 return vertical(cubic, top, bottom, x, flipped); | 206 return vertical(cubic, top, bottom, x, flipped); |
207 } | 207 } |
OLD | NEW |