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

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

Issue 1138263002: Revert of stop calling SkScalarDiv (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/SkAnimatorScript.cpp ('k') | src/animator/SkDisplayPost.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 2011 Google Inc. 3 * Copyright 2011 Google Inc.
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 #include "SkAnimatorScript2.h" 8 #include "SkAnimatorScript2.h"
9 #include "SkAnimateBase.h" 9 #include "SkAnimateBase.h"
10 #include "SkAnimateMaker.h" 10 #include "SkAnimateMaker.h"
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 case SkType_ARGB: 405 case SkType_ARGB:
406 type = SkType_Int; 406 type = SkType_Int;
407 case SkType_Boolean: 407 case SkType_Boolean:
408 case SkType_Int: 408 case SkType_Int:
409 case SkType_MSec: 409 case SkType_MSec:
410 case SkType_Float: 410 case SkType_Float:
411 SkASSERT(info->getCount() == 1); 411 SkASSERT(info->getCount() == 1);
412 if (info->fType != SkType_MemberProperty && info->fType != SkType_Me mberFunction) 412 if (info->fType != SkType_MemberProperty && info->fType != SkType_Me mberFunction)
413 value->fS32 = *(int32_t*) info->memberData(displayable); // O K for SkScalar too 413 value->fS32 = *(int32_t*) info->memberData(displayable); // O K for SkScalar too
414 if (type == SkType_MSec) { 414 if (type == SkType_MSec) {
415 value->fScalar = value->fS32 * 0.001f; 415 value->fScalar = SkScalarDiv((SkScalar) value->fS32, 1000); // d ividing two ints is the same as dividing two scalars
416 type = SkType_Float; 416 type = SkType_Float;
417 } 417 }
418 break; 418 break;
419 case SkType_String: { 419 case SkType_String: {
420 SkString* displayableString; 420 SkString* displayableString;
421 if (info->fType != SkType_MemberProperty && info->fType != SkType_Me mberFunction) { 421 if (info->fType != SkType_MemberProperty && info->fType != SkType_Me mberFunction) {
422 info->getString(displayable, &displayableString); 422 info->getString(displayable, &displayableString);
423 value->fString = new SkString(*displayableString); 423 value->fString = new SkString(*displayableString);
424 } 424 }
425 } break; 425 } break;
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 SkASSERT(value.fOperand.fString->equals(scriptTests[index].fStri ngAnswer)); 613 SkASSERT(value.fOperand.fString->equals(scriptTests[index].fStri ngAnswer));
614 break; 614 break;
615 default: 615 default:
616 SkASSERT(0); 616 SkASSERT(0);
617 } 617 }
618 } 618 }
619 #endif 619 #endif
620 } 620 }
621 621
622 #endif 622 #endif
OLDNEW
« no previous file with comments | « src/animator/SkAnimatorScript.cpp ('k') | src/animator/SkDisplayPost.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698