OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
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 SkGeometry_DEFINED | 8 #ifndef SkGeometry_DEFINED |
9 #define SkGeometry_DEFINED | 9 #define SkGeometry_DEFINED |
10 | 10 |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 /** Return 1 for no chop, 2 for having chopped the cubic at a single | 159 /** Return 1 for no chop, 2 for having chopped the cubic at a single |
160 inflection point, 3 for having chopped at 2 inflection points. | 160 inflection point, 3 for having chopped at 2 inflection points. |
161 dst will hold the resulting 1, 2, or 3 cubics. | 161 dst will hold the resulting 1, 2, or 3 cubics. |
162 */ | 162 */ |
163 int SkChopCubicAtInflections(const SkPoint src[4], SkPoint dst[10]); | 163 int SkChopCubicAtInflections(const SkPoint src[4], SkPoint dst[10]); |
164 | 164 |
165 int SkFindCubicMaxCurvature(const SkPoint src[4], SkScalar tValues[3]); | 165 int SkFindCubicMaxCurvature(const SkPoint src[4], SkScalar tValues[3]); |
166 int SkChopCubicAtMaxCurvature(const SkPoint src[4], SkPoint dst[13], | 166 int SkChopCubicAtMaxCurvature(const SkPoint src[4], SkPoint dst[13], |
167 SkScalar tValues[3] = NULL); | 167 SkScalar tValues[3] = NULL); |
168 | 168 |
| 169 bool SkChopMonoCubicAtX(SkPoint src[4], SkScalar y, SkPoint dst[7]); |
| 170 bool SkChopMonoCubicAtY(SkPoint src[4], SkScalar x, SkPoint dst[7]); |
| 171 |
169 enum SkCubicType { | 172 enum SkCubicType { |
170 kSerpentine_SkCubicType, | 173 kSerpentine_SkCubicType, |
171 kCusp_SkCubicType, | 174 kCusp_SkCubicType, |
172 kLoop_SkCubicType, | 175 kLoop_SkCubicType, |
173 kQuadratic_SkCubicType, | 176 kQuadratic_SkCubicType, |
174 kLine_SkCubicType, | 177 kLine_SkCubicType, |
175 kPoint_SkCubicType | 178 kPoint_SkCubicType |
176 }; | 179 }; |
177 | 180 |
178 /** Returns the cubic classification. Pass scratch storage for computing inflect
ion data, | 181 /** Returns the cubic classification. Pass scratch storage for computing inflect
ion data, |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 private: | 328 private: |
326 enum { | 329 enum { |
327 kQuadCount = 8, // should handle most conics | 330 kQuadCount = 8, // should handle most conics |
328 kPointCount = 1 + 2 * kQuadCount, | 331 kPointCount = 1 + 2 * kQuadCount, |
329 }; | 332 }; |
330 SkAutoSTMalloc<kPointCount, SkPoint> fStorage; | 333 SkAutoSTMalloc<kPointCount, SkPoint> fStorage; |
331 int fQuadCount; // #quads for current usage | 334 int fQuadCount; // #quads for current usage |
332 }; | 335 }; |
333 | 336 |
334 #endif | 337 #endif |
OLD | NEW |