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

Side by Side Diff: src/utils/SkInterpolator.cpp

Issue 117053002: remove SK_SCALAR_IS_[FLOAT,FIXED] and assume floats (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years 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 | Annotate | Revision Log
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2008 The Android Open Source Project 3 * Copyright 2008 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 #include "SkInterpolator.h" 10 #include "SkInterpolator.h"
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 #ifdef SK_DEBUG 148 #ifdef SK_DEBUG
149 fTimesArray = (SkTimeCode(*)[10]) fTimes; 149 fTimesArray = (SkTimeCode(*)[10]) fTimes;
150 fScalarsArray = (SkScalar(*)[10]) fValues; 150 fScalarsArray = (SkScalar(*)[10]) fValues;
151 #endif 151 #endif
152 } 152 }
153 153
154 #define SK_Fixed1Third (SK_Fixed1/3) 154 #define SK_Fixed1Third (SK_Fixed1/3)
155 #define SK_Fixed2Third (SK_Fixed1*2/3) 155 #define SK_Fixed2Third (SK_Fixed1*2/3)
156 156
157 static const SkScalar gIdentityBlend[4] = { 157 static const SkScalar gIdentityBlend[4] = {
158 #ifdef SK_SCALAR_IS_FLOAT
159 0.33333333f, 0.33333333f, 0.66666667f, 0.66666667f 158 0.33333333f, 0.33333333f, 0.66666667f, 0.66666667f
160 #else
161 SK_Fixed1Third, SK_Fixed1Third, SK_Fixed2Third, SK_Fixed2Third
162 #endif
163 }; 159 };
164 160
165 bool SkInterpolator::setKeyFrame(int index, SkMSec time, 161 bool SkInterpolator::setKeyFrame(int index, SkMSec time,
166 const SkScalar values[], const SkScalar blend[4]) { 162 const SkScalar values[], const SkScalar blend[4]) {
167 SkASSERT(values != NULL); 163 SkASSERT(values != NULL);
168 164
169 if (blend == NULL) { 165 if (blend == NULL) {
170 blend = gIdentityBlend; 166 blend = gIdentityBlend;
171 } 167 }
172 168
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 SkASSERT(memcmp(v, iset(vv, 60, 120, 180), sizeof(v)) == 0); 318 SkASSERT(memcmp(v, iset(vv, 60, 120, 180), sizeof(v)) == 0);
323 319
324 result = inter.timeToValues(125, v); 320 result = inter.timeToValues(125, v);
325 SkASSERT(result == kNormal_Result); 321 SkASSERT(result == kNormal_Result);
326 result = inter.timeToValues(175, v); 322 result = inter.timeToValues(175, v);
327 SkASSERT(result == kNormal_Result); 323 SkASSERT(result == kNormal_Result);
328 #endif 324 #endif
329 } 325 }
330 326
331 #endif 327 #endif
OLDNEW
« src/core/SkCanvas.cpp ('K') | « src/utils/SkCamera.cpp ('k') | src/utils/SkParse.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698