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 #ifndef SkPathOpsCubic_DEFINED | 8 #ifndef SkPathOpsCubic_DEFINED |
9 #define SkPathOpsCubic_DEFINED | 9 #define SkPathOpsCubic_DEFINED |
10 | 10 |
11 #include "SkPath.h" | 11 #include "SkPath.h" |
12 #include "SkPathOpsPoint.h" | 12 #include "SkPathOpsPoint.h" |
13 #include "SkTDArray.h" | 13 #include "SkTArray.h" |
14 | 14 |
15 struct SkDCubicPair { | 15 struct SkDCubicPair { |
16 const SkDCubic& first() const { return (const SkDCubic&) pts[0]; } | 16 const SkDCubic& first() const { return (const SkDCubic&) pts[0]; } |
17 const SkDCubic& second() const { return (const SkDCubic&) pts[3]; } | 17 const SkDCubic& second() const { return (const SkDCubic&) pts[3]; } |
18 SkDPoint pts[7]; | 18 SkDPoint pts[7]; |
19 }; | 19 }; |
20 | 20 |
21 struct SkDCubic { | 21 struct SkDCubic { |
22 SkDPoint fPts[4]; | 22 SkDPoint fPts[4]; |
23 | 23 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 void subDivide(const SkDPoint& a, const SkDPoint& d, double t1, double t2, S
kDPoint p[2]) const; | 67 void subDivide(const SkDPoint& a, const SkDPoint& d, double t1, double t2, S
kDPoint p[2]) const; |
68 | 68 |
69 static void SubDivide(const SkPoint pts[4], const SkDPoint& a, const SkDPoin
t& d, double t1, | 69 static void SubDivide(const SkPoint pts[4], const SkDPoint& a, const SkDPoin
t& d, double t1, |
70 double t2, SkDPoint p[2]) { | 70 double t2, SkDPoint p[2]) { |
71 SkDCubic cubic; | 71 SkDCubic cubic; |
72 cubic.set(pts); | 72 cubic.set(pts); |
73 cubic.subDivide(a, d, t1, t2, p); | 73 cubic.subDivide(a, d, t1, t2, p); |
74 } | 74 } |
75 | 75 |
76 SkDPoint top(double startT, double endT) const; | 76 SkDPoint top(double startT, double endT) const; |
77 void toQuadraticTs(double precision, SkTDArray<double>* ts) const; | 77 void toQuadraticTs(double precision, SkTArray<double, true>* ts) const; |
78 SkDQuad toQuad() const; | 78 SkDQuad toQuad() const; |
79 SkDPoint xyAtT(double t) const; | 79 SkDPoint xyAtT(double t) const; |
80 }; | 80 }; |
81 | 81 |
82 #endif | 82 #endif |
OLD | NEW |