Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(213)

Side by Side Diff: src/core/SkGeometry.h

Issue 1084623004: remove older version of cubic->coeff (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/core/SkGeometry.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 int SkChopQuadAtMaxCurvature(const SkPoint src[3], SkPoint dst[5]); 97 int SkChopQuadAtMaxCurvature(const SkPoint src[3], SkPoint dst[5]);
98 98
99 /** Given 3 points on a quadratic bezier, use degree elevation to 99 /** Given 3 points on a quadratic bezier, use degree elevation to
100 convert it into the cubic fitting the same curve. The new cubic 100 convert it into the cubic fitting the same curve. The new cubic
101 curve is returned in dst[0..3]. 101 curve is returned in dst[0..3].
102 */ 102 */
103 SK_API void SkConvertQuadToCubic(const SkPoint src[3], SkPoint dst[4]); 103 SK_API void SkConvertQuadToCubic(const SkPoint src[3], SkPoint dst[4]);
104 104
105 /////////////////////////////////////////////////////////////////////////////// 105 ///////////////////////////////////////////////////////////////////////////////
106 106
107 /** Convert from parametric from (pts) to polynomial coefficients
108 coeff[0]*T^3 + coeff[1]*T^2 + coeff[2]*T + coeff[3]
109 */
110 void SkGetCubicCoeff(const SkPoint pts[4], SkScalar cx[4], SkScalar cy[4]);
111
112 /** Set pt to the point on the src cubic specified by t. t must be 107 /** Set pt to the point on the src cubic specified by t. t must be
113 0 <= t <= 1.0 108 0 <= t <= 1.0
114 */ 109 */
115 void SkEvalCubicAt(const SkPoint src[4], SkScalar t, SkPoint* locOrNull, 110 void SkEvalCubicAt(const SkPoint src[4], SkScalar t, SkPoint* locOrNull,
116 SkVector* tangentOrNull, SkVector* curvatureOrNull); 111 SkVector* tangentOrNull, SkVector* curvatureOrNull);
117 112
118 /** Given a src cubic bezier, chop it at the specified t value, 113 /** Given a src cubic bezier, chop it at the specified t value,
119 where 0 < t < 1, and return the two new cubics in dst: 114 where 0 < t < 1, and return the two new cubics in dst:
120 dst[0..3] and dst[3..6] 115 dst[0..3] and dst[3..6]
121 */ 116 */
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 private: 325 private:
331 enum { 326 enum {
332 kQuadCount = 8, // should handle most conics 327 kQuadCount = 8, // should handle most conics
333 kPointCount = 1 + 2 * kQuadCount, 328 kPointCount = 1 + 2 * kQuadCount,
334 }; 329 };
335 SkAutoSTMalloc<kPointCount, SkPoint> fStorage; 330 SkAutoSTMalloc<kPointCount, SkPoint> fStorage;
336 int fQuadCount; // #quads for current usage 331 int fQuadCount; // #quads for current usage
337 }; 332 };
338 333
339 #endif 334 #endif
OLDNEW
« no previous file with comments | « no previous file | src/core/SkGeometry.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698