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

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

Issue 1135053002: stop calling SkScalarDiv (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix xpsdevice Created 5 years, 7 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 | « src/animator/SkAnimateSet.cpp ('k') | src/animator/SkAnimatorScript2.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 "SkAnimatorScript.h" 10 #include "SkAnimatorScript.h"
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 case SkType_ARGB: 228 case SkType_ARGB:
229 type = SkType_Int; 229 type = SkType_Int;
230 case SkType_Boolean: 230 case SkType_Boolean:
231 case SkType_Int: 231 case SkType_Int:
232 case SkType_MSec: 232 case SkType_MSec:
233 case SkType_Float: 233 case SkType_Float:
234 SkASSERT(info->getCount() == 1); 234 SkASSERT(info->getCount() == 1);
235 if (info->fType != SkType_MemberProperty && info->fType != SkType_Me mberFunction) 235 if (info->fType != SkType_MemberProperty && info->fType != SkType_Me mberFunction)
236 value->fOperand.fS32 = *(int32_t*) info->memberData(displayable) ; // OK for SkScalar too 236 value->fOperand.fS32 = *(int32_t*) info->memberData(displayable) ; // OK for SkScalar too
237 if (type == SkType_MSec) { 237 if (type == SkType_MSec) {
238 value->fOperand.fScalar = SkScalarDiv((SkScalar) value->fOperand .fS32, 1000); // dividing two ints is the same as dividing two scalars 238 value->fOperand.fScalar = value->fOperand.fS32 * 0.001f;
239 type = SkType_Float; 239 type = SkType_Float;
240 } 240 }
241 break; 241 break;
242 case SkType_String: { 242 case SkType_String: {
243 SkString* displayableString; 243 SkString* displayableString;
244 if (info->fType != SkType_MemberProperty && info->fType != SkType_Me mberFunction) { 244 if (info->fType != SkType_MemberProperty && info->fType != SkType_Me mberFunction) {
245 info->getString(displayable, &displayableString); 245 info->getString(displayable, &displayableString);
246 value->fOperand.fString = new SkString(*displayableString); 246 value->fOperand.fString = new SkString(*displayableString);
247 } 247 }
248 } break; 248 } break;
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 SkASSERT(strcmp(value.fOperand.fString->c_str(), scriptTests[ind ex].fStringAnswer) == 0); 585 SkASSERT(strcmp(value.fOperand.fString->c_str(), scriptTests[ind ex].fStringAnswer) == 0);
586 break; 586 break;
587 default: 587 default:
588 SkASSERT(0); 588 SkASSERT(0);
589 } 589 }
590 } 590 }
591 #endif 591 #endif
592 } 592 }
593 593
594 #endif 594 #endif
OLDNEW
« no previous file with comments | « src/animator/SkAnimateSet.cpp ('k') | src/animator/SkAnimatorScript2.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698