OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #ifndef SkGeometry_DEFINED | 10 #ifndef SkGeometry_DEFINED |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 but if it is equal to cubic[3].fY then it is considered to | 184 but if it is equal to cubic[3].fY then it is considered to |
185 cross. | 185 cross. |
186 Optional outgoing "ambiguous" argument indicates whether the answer is | 186 Optional outgoing "ambiguous" argument indicates whether the answer is |
187 ambiguous because the query occurred exactly at one of the endpoints' y | 187 ambiguous because the query occurred exactly at one of the endpoints' y |
188 coordinates or at a tangent point, indicating that another query y | 188 coordinates or at a tangent point, indicating that another query y |
189 coordinate is preferred for robustness. | 189 coordinate is preferred for robustness. |
190 */ | 190 */ |
191 int SkNumXRayCrossingsForCubic(const SkXRay& pt, const SkPoint cubic[4], | 191 int SkNumXRayCrossingsForCubic(const SkXRay& pt, const SkPoint cubic[4], |
192 bool* ambiguous = NULL); | 192 bool* ambiguous = NULL); |
193 | 193 |
| 194 enum SkCubicType { |
| 195 kSerpentine_SkCubicType, |
| 196 kCusp_SkCubicType, |
| 197 kLoop_SkCubicType, |
| 198 kQuadratic_SkCubicType, |
| 199 kLine_SkCubicType, |
| 200 kPoint_SkCubicType |
| 201 }; |
| 202 |
| 203 /** Returns the cubic classification. Pass scratch storage for computing inflect
ion data, |
| 204 which can be used with additional work to find the loop intersections and so
on. |
| 205 */ |
| 206 SkCubicType SkClassifyCubic(const SkPoint p[4], SkScalar inflection[3]); |
| 207 |
194 /////////////////////////////////////////////////////////////////////////////// | 208 /////////////////////////////////////////////////////////////////////////////// |
195 | 209 |
196 enum SkRotationDirection { | 210 enum SkRotationDirection { |
197 kCW_SkRotationDirection, | 211 kCW_SkRotationDirection, |
198 kCCW_SkRotationDirection | 212 kCCW_SkRotationDirection |
199 }; | 213 }; |
200 | 214 |
201 /** Maximum number of points needed in the quadPoints[] parameter for | 215 /** Maximum number of points needed in the quadPoints[] parameter for |
202 SkBuildQuadArc() | 216 SkBuildQuadArc() |
203 */ | 217 */ |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 private: | 321 private: |
308 enum { | 322 enum { |
309 kQuadCount = 8, // should handle most conics | 323 kQuadCount = 8, // should handle most conics |
310 kPointCount = 1 + 2 * kQuadCount, | 324 kPointCount = 1 + 2 * kQuadCount, |
311 }; | 325 }; |
312 SkAutoSTMalloc<kPointCount, SkPoint> fStorage; | 326 SkAutoSTMalloc<kPointCount, SkPoint> fStorage; |
313 int fQuadCount; // #quads for current usage | 327 int fQuadCount; // #quads for current usage |
314 }; | 328 }; |
315 | 329 |
316 #endif | 330 #endif |
OLD | NEW |