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 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 case SkType_Int: { | 322 case SkType_Int: { |
323 SkDisplayInt* boxedValue = (SkDisplayInt*) displayable; | 323 SkDisplayInt* boxedValue = (SkDisplayInt*) displayable; |
324 operand->fS32 = boxedValue->value; | 324 operand->fS32 = boxedValue->value; |
325 } break; | 325 } break; |
326 case SkType_Float: { | 326 case SkType_Float: { |
327 SkDisplayFloat* boxedValue = (SkDisplayFloat*) displayable; | 327 SkDisplayFloat* boxedValue = (SkDisplayFloat*) displayable; |
328 operand->fScalar = boxedValue->value; | 328 operand->fScalar = boxedValue->value; |
329 } break; | 329 } break; |
330 case SkType_String: { | 330 case SkType_String: { |
331 SkDisplayString* boxedValue = (SkDisplayString*) displayable; | 331 SkDisplayString* boxedValue = (SkDisplayString*) displayable; |
332 operand->fString = SkNEW_ARGS(SkString, (boxedValue->value)); | 332 operand->fString = new SkString(boxedValue->value); |
333 } break; | 333 } break; |
334 default: { | 334 default: { |
335 const char* id; | 335 const char* id; |
336 bool success = fEngine->getMaker().findKey(displayable, &id); | 336 bool success = fEngine->getMaker().findKey(displayable, &id); |
337 SkASSERT(success); | 337 SkASSERT(success); |
338 operand->fString = SkNEW_ARGS(SkString, (id)); | 338 operand->fString = new SkString(id); |
339 } | 339 } |
340 } | 340 } |
341 return true; | 341 return true; |
342 } | 342 } |
343 | 343 |
344 virtual SkOperand2::OpType getReturnType(int /*index*/, SkOperand2* operand)
{ | 344 virtual SkOperand2::OpType getReturnType(int /*index*/, SkOperand2* operand)
{ |
345 SkDisplayable* displayable = (SkDisplayable*) operand->fObject; | 345 SkDisplayable* displayable = (SkDisplayable*) operand->fObject; |
346 switch (displayable->getType()) { | 346 switch (displayable->getType()) { |
347 case SkType_Array: | 347 case SkType_Array: |
348 return SkOperand2::kArray; | 348 return SkOperand2::kArray; |
(...skipping 264 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 |