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

Side by Side Diff: include/utils/SkInterpolator.h

Issue 351713005: Promote SkInterpolator unit test to our tests driver. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: review Created 6 years, 5 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 | « gyp/tests.gypi ('k') | src/utils/SkInterpolator.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 /* 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 SkInterpolator_DEFINED 10 #ifndef SkInterpolator_DEFINED
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 106
107 /** Return the computed values given the specified time. Return whether 107 /** Return the computed values given the specified time. Return whether
108 those values are the result of pinning to either the first 108 those values are the result of pinning to either the first
109 (kFreezeStart) or last (kFreezeEnd), or from interpolated the two 109 (kFreezeStart) or last (kFreezeEnd), or from interpolated the two
110 nearest key values (kNormal). 110 nearest key values (kNormal).
111 @param time The time to sample (in milliseconds) 111 @param time The time to sample (in milliseconds)
112 @param (may be null) where to write the computed values. 112 @param (may be null) where to write the computed values.
113 */ 113 */
114 Result timeToValues(SkMSec time, SkScalar values[] = NULL) const; 114 Result timeToValues(SkMSec time, SkScalar values[] = NULL) const;
115 115
116 SkDEBUGCODE(static void UnitTest();)
117 private: 116 private:
118 SkScalar* fValues; // pointer into fStorage 117 SkScalar* fValues; // pointer into fStorage
119 #ifdef SK_DEBUG 118 #ifdef SK_DEBUG
120 SkScalar(* fScalarsArray)[10]; 119 SkScalar(* fScalarsArray)[10];
121 #endif 120 #endif
122 typedef SkInterpolatorBase INHERITED; 121 typedef SkInterpolatorBase INHERITED;
123 }; 122 };
124 123
125 /** Given all the parameters are [0...1], apply the cubic specified by (0,0) 124 /** Given all the parameters are [0...1], apply the cubic specified by (0,0)
126 (bx,by) (cx,cy) (1,1) to value, returning the answer, also [0...1]. 125 (bx,by) (cx,cy) (1,1) to value, returning the answer, also [0...1].
127 */ 126 */
128 SkScalar SkUnitCubicInterp(SkScalar value, SkScalar bx, SkScalar by, 127 SkScalar SkUnitCubicInterp(SkScalar value, SkScalar bx, SkScalar by,
129 SkScalar cx, SkScalar cy); 128 SkScalar cx, SkScalar cy);
130 129
131 #endif 130 #endif
OLDNEW
« no previous file with comments | « gyp/tests.gypi ('k') | src/utils/SkInterpolator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698