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 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 case SkType_Int: { | 455 case SkType_Int: { |
456 SkDisplayInt* boxedValue = (SkDisplayInt*) displayable; | 456 SkDisplayInt* boxedValue = (SkDisplayInt*) displayable; |
457 scriptValue->fOperand.fS32 = boxedValue->value; | 457 scriptValue->fOperand.fS32 = boxedValue->value; |
458 } break; | 458 } break; |
459 case SkType_Float: { | 459 case SkType_Float: { |
460 SkDisplayFloat* boxedValue = (SkDisplayFloat*) displayable; | 460 SkDisplayFloat* boxedValue = (SkDisplayFloat*) displayable; |
461 scriptValue->fOperand.fScalar = boxedValue->value; | 461 scriptValue->fOperand.fScalar = boxedValue->value; |
462 } break; | 462 } break; |
463 case SkType_String: { | 463 case SkType_String: { |
464 SkDisplayString* boxedValue = (SkDisplayString*) displayable; | 464 SkDisplayString* boxedValue = (SkDisplayString*) displayable; |
465 scriptValue->fOperand.fString = SkNEW_ARGS(SkString, (boxedValue->va
lue)); | 465 scriptValue->fOperand.fString = new SkString(boxedValue->value); |
466 } break; | 466 } break; |
467 default: { | 467 default: { |
468 const char* id = NULL; | 468 const char* id = NULL; |
469 SkDEBUGCODE(bool success = ) maker->findKey(displayable, &id); | 469 SkDEBUGCODE(bool success = ) maker->findKey(displayable, &id); |
470 SkASSERT(success); | 470 SkASSERT(success); |
471 scriptValue->fOperand.fString = SkNEW_ARGS(SkString, (id)); | 471 scriptValue->fOperand.fString = new SkString(id); |
472 type = SkType_String; | 472 type = SkType_String; |
473 } | 473 } |
474 } | 474 } |
475 scriptValue->fType = type; | 475 scriptValue->fType = type; |
476 return true; | 476 return true; |
477 } | 477 } |
478 | 478 |
479 #if defined SK_SUPPORT_UNITTEST | 479 #if defined SK_SUPPORT_UNITTEST |
480 | 480 |
481 #include "SkAnimator.h" | 481 #include "SkAnimator.h" |
(...skipping 103 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 |