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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 */ | 187 */ |
188 SkCubicType SkClassifyCubic(const SkPoint p[4], SkScalar inflection[3]); | 188 SkCubicType SkClassifyCubic(const SkPoint p[4], SkScalar inflection[3]); |
189 | 189 |
190 /////////////////////////////////////////////////////////////////////////////// | 190 /////////////////////////////////////////////////////////////////////////////// |
191 | 191 |
192 enum SkRotationDirection { | 192 enum SkRotationDirection { |
193 kCW_SkRotationDirection, | 193 kCW_SkRotationDirection, |
194 kCCW_SkRotationDirection | 194 kCCW_SkRotationDirection |
195 }; | 195 }; |
196 | 196 |
197 #ifdef SK_SUPPORT_LEGACY_ARCTO | |
198 /** Maximum number of points needed in the quadPoints[] parameter for | |
199 SkBuildQuadArc() | |
200 */ | |
201 #define kSkBuildQuadArcStorage 17 | |
202 | |
203 /** Given 2 unit vectors and a rotation direction, fill out the specified | |
204 array of points with quadratic segments. Return is the number of points | |
205 written to, which will be { 0, 3, 5, 7, ... kSkBuildQuadArcStorage } | |
206 | |
207 matrix, if not null, is appled to the points before they are returned. | |
208 */ | |
209 int SkBuildQuadArc(const SkVector& unitStart, const SkVector& unitStop, | |
210 SkRotationDirection, const SkMatrix*, SkPoint quadPoints[]); | |
211 #endif | |
212 | |
213 struct SkConic { | 197 struct SkConic { |
214 SkConic() {} | 198 SkConic() {} |
215 SkConic(const SkPoint& p0, const SkPoint& p1, const SkPoint& p2, SkScalar w)
{ | 199 SkConic(const SkPoint& p0, const SkPoint& p1, const SkPoint& p2, SkScalar w)
{ |
216 fPts[0] = p0; | 200 fPts[0] = p0; |
217 fPts[1] = p1; | 201 fPts[1] = p1; |
218 fPts[2] = p2; | 202 fPts[2] = p2; |
219 fW = w; | 203 fW = w; |
220 } | 204 } |
221 SkConic(const SkPoint pts[3], SkScalar w) { | 205 SkConic(const SkPoint pts[3], SkScalar w) { |
222 memcpy(fPts, pts, sizeof(fPts)); | 206 memcpy(fPts, pts, sizeof(fPts)); |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 private: | 415 private: |
432 enum { | 416 enum { |
433 kQuadCount = 8, // should handle most conics | 417 kQuadCount = 8, // should handle most conics |
434 kPointCount = 1 + 2 * kQuadCount, | 418 kPointCount = 1 + 2 * kQuadCount, |
435 }; | 419 }; |
436 SkAutoSTMalloc<kPointCount, SkPoint> fStorage; | 420 SkAutoSTMalloc<kPointCount, SkPoint> fStorage; |
437 int fQuadCount; // #quads for current usage | 421 int fQuadCount; // #quads for current usage |
438 }; | 422 }; |
439 | 423 |
440 #endif | 424 #endif |
OLD | NEW |