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

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

Issue 1036753002: SkChopCubicAt2 using Sk2s-- 2x faster (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 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 | « bench/GeometryBench.cpp ('k') | 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 0 <= t <= 1.0 88 0 <= t <= 1.0
89 */ 89 */
90 void SkEvalCubicAt(const SkPoint src[4], SkScalar t, SkPoint* locOrNull, 90 void SkEvalCubicAt(const SkPoint src[4], SkScalar t, SkPoint* locOrNull,
91 SkVector* tangentOrNull, SkVector* curvatureOrNull); 91 SkVector* tangentOrNull, SkVector* curvatureOrNull);
92 92
93 /** Given a src cubic bezier, chop it at the specified t value, 93 /** Given a src cubic bezier, chop it at the specified t value,
94 where 0 < t < 1, and return the two new cubics in dst: 94 where 0 < t < 1, and return the two new cubics in dst:
95 dst[0..3] and dst[3..6] 95 dst[0..3] and dst[3..6]
96 */ 96 */
97 void SkChopCubicAt(const SkPoint src[4], SkPoint dst[7], SkScalar t); 97 void SkChopCubicAt(const SkPoint src[4], SkPoint dst[7], SkScalar t);
98 void SkChopCubicAt2(const SkPoint src[4], SkPoint dst[7], SkScalar t);
99
98 /** Given a src cubic bezier, chop it at the specified t values, 100 /** Given a src cubic bezier, chop it at the specified t values,
99 where 0 < t < 1, and return the new cubics in dst: 101 where 0 < t < 1, and return the new cubics in dst:
100 dst[0..3],dst[3..6],...,dst[3*t_count..3*(t_count+1)] 102 dst[0..3],dst[3..6],...,dst[3*t_count..3*(t_count+1)]
101 */ 103 */
102 void SkChopCubicAt(const SkPoint src[4], SkPoint dst[], const SkScalar t[], 104 void SkChopCubicAt(const SkPoint src[4], SkPoint dst[], const SkScalar t[],
103 int t_count); 105 int t_count);
104 106
105 /** Given a src cubic bezier, chop it at the specified t == 1/2, 107 /** Given a src cubic bezier, chop it at the specified t == 1/2,
106 The new cubics are returned in dst[0..3] and dst[3..6] 108 The new cubics are returned in dst[0..3] and dst[3..6]
107 */ 109 */
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 private: 307 private:
306 enum { 308 enum {
307 kQuadCount = 8, // should handle most conics 309 kQuadCount = 8, // should handle most conics
308 kPointCount = 1 + 2 * kQuadCount, 310 kPointCount = 1 + 2 * kQuadCount,
309 }; 311 };
310 SkAutoSTMalloc<kPointCount, SkPoint> fStorage; 312 SkAutoSTMalloc<kPointCount, SkPoint> fStorage;
311 int fQuadCount; // #quads for current usage 313 int fQuadCount; // #quads for current usage
312 }; 314 };
313 315
314 #endif 316 #endif
OLDNEW
« no previous file with comments | « bench/GeometryBench.cpp ('k') | src/core/SkGeometry.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698