| OLD | NEW |
| 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 Loading... |
| 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 = value->fOperand.fS32 * 0.001f; | 238 value->fOperand.fScalar = SkScalarDiv((SkScalar) value->fOperand
.fS32, 1000); // dividing two ints is the same as dividing two scalars |
| 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 Loading... |
| 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 |
| OLD | NEW |