OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |