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

Side by Side Diff: src/animator/SkOperandIterpolator.cpp

Issue 111353003: deprecate SkScalarRound (and its ilk), use SkScalarRound[ToInt,ToScalar]. #define SK_SUPPORT_DEPREC… (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
« no previous file with comments | « src/animator/SkDrawColor.cpp ('k') | src/animator/SkScript.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 #include "SkOperandInterpolator.h" 10 #include "SkOperandInterpolator.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 74
75 const SkOperand* prevSrc = nextSrc - fElemCount; 75 const SkOperand* prevSrc = nextSrc - fElemCount;
76 76
77 if (fType == SkType_Float || fType == SkType_3D_Point) { 77 if (fType == SkType_Float || fType == SkType_3D_Point) {
78 for (int i = fElemCount - 1; i >= 0; --i) 78 for (int i = fElemCount - 1; i >= 0; --i)
79 values[i].fScalar = SkScalarInterp(prevSrc[i].fScalar, nextS rc[i].fScalar, T); 79 values[i].fScalar = SkScalarInterp(prevSrc[i].fScalar, nextS rc[i].fScalar, T);
80 } else if (fType == SkType_Int || fType == SkType_MSec) { 80 } else if (fType == SkType_Int || fType == SkType_MSec) {
81 for (int i = fElemCount - 1; i >= 0; --i) { 81 for (int i = fElemCount - 1; i >= 0; --i) {
82 int32_t a = prevSrc[i].fS32; 82 int32_t a = prevSrc[i].fS32;
83 int32_t b = nextSrc[i].fS32; 83 int32_t b = nextSrc[i].fS32;
84 values[i].fS32 = a + SkScalarRound((b - a) * T); 84 values[i].fS32 = a + SkScalarRoundToInt((b - a) * T);
85 } 85 }
86 } else 86 } else
87 memcpy(values, prevSrc, sizeof(SkOperand) * fElemCount); 87 memcpy(values, prevSrc, sizeof(SkOperand) * fElemCount);
88 } 88 }
89 } 89 }
90 return result; 90 return result;
91 } 91 }
92 92
93 //////////////////////////////////////////////////////////////////////////////// /////// 93 //////////////////////////////////////////////////////////////////////////////// ///////
94 //////////////////////////////////////////////////////////////////////////////// /////// 94 //////////////////////////////////////////////////////////////////////////////// ///////
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 SkASSERT(memcmp(v, iset(vv, 60, 120, 180), sizeof(v)) == 0); 140 SkASSERT(memcmp(v, iset(vv, 60, 120, 180), sizeof(v)) == 0);
141 141
142 result = inter.timeToValues(125, v); 142 result = inter.timeToValues(125, v);
143 SkASSERT(result == kNormal_Result); 143 SkASSERT(result == kNormal_Result);
144 result = inter.timeToValues(175, v); 144 result = inter.timeToValues(175, v);
145 SkASSERT(result == kNormal_Result); 145 SkASSERT(result == kNormal_Result);
146 #endif 146 #endif
147 } 147 }
148 148
149 #endif 149 #endif
OLDNEW
« no previous file with comments | « src/animator/SkDrawColor.cpp ('k') | src/animator/SkScript.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698