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 "SkAnimator.h" | 10 #include "SkAnimator.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 "<Math id=\"Math\"/>" | 39 "<Math id=\"Math\"/>" |
40 "<Number id=\"Number\"/>" | 40 "<Number id=\"Number\"/>" |
41 "</screenplay>"; | 41 "</screenplay>"; |
42 | 42 |
43 #define gMathPrimer gMathPrimerText | 43 #define gMathPrimer gMathPrimerText |
44 | 44 |
45 SkAnimator::SkAnimator() : fMaker(NULL) { | 45 SkAnimator::SkAnimator() : fMaker(NULL) { |
46 initialize(); | 46 initialize(); |
47 } | 47 } |
48 | 48 |
49 SkAnimator::~SkAnimator() { | 49 SkAnimator::~SkAnimator() { delete fMaker; } |
50 SkDELETE(fMaker); | |
51 } | |
52 | 50 |
53 void SkAnimator::addExtras(SkExtras* extras) { | 51 void SkAnimator::addExtras(SkExtras* extras) { |
54 *fMaker->fExtras.append() = extras; | 52 *fMaker->fExtras.append() = extras; |
55 } | 53 } |
56 | 54 |
57 bool SkAnimator::appendStream(SkStream* stream) { | 55 bool SkAnimator::appendStream(SkStream* stream) { |
58 return decodeStream(stream); | 56 return decodeStream(stream); |
59 } | 57 } |
60 | 58 |
61 bool SkAnimator::decodeMemory(const void* buffer, size_t size) | 59 bool SkAnimator::decodeMemory(const void* buffer, size_t size) |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 if (field == NULL) | 377 if (field == NULL) |
380 return NULL; | 378 return NULL; |
381 return getString(element, field); | 379 return getString(element, field); |
382 } | 380 } |
383 | 381 |
384 const char* SkAnimator::getURIBase() { | 382 const char* SkAnimator::getURIBase() { |
385 return fMaker->fPrefix.c_str(); | 383 return fMaker->fPrefix.c_str(); |
386 } | 384 } |
387 | 385 |
388 void SkAnimator::initialize() { | 386 void SkAnimator::initialize() { |
389 SkDELETE(fMaker); | 387 delete fMaker; |
390 fMaker = SkNEW_ARGS(SkAnimateMaker, (this, NULL, NULL)); | 388 fMaker = new SkAnimateMaker(this, NULL, NULL); |
391 decodeMemory(gMathPrimer, sizeof(gMathPrimer)-1); | 389 decodeMemory(gMathPrimer, sizeof(gMathPrimer)-1); |
392 #ifdef SK_BUILD_FOR_ANDROID | 390 #ifdef SK_BUILD_FOR_ANDROID |
393 InitializeSkExtraPathEffects(this); | 391 InitializeSkExtraPathEffects(this); |
394 #endif | 392 #endif |
395 } | 393 } |
396 | 394 |
397 | 395 |
398 #ifdef SK_DEBUG | 396 #ifdef SK_DEBUG |
399 bool SkAnimator::isTrackingEvents() { | 397 bool SkAnimator::isTrackingEvents() { |
400 return false; | 398 return false; |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 gUnitTests[i].fUnitTest(); | 695 gUnitTests[i].fUnitTest(); |
698 SkDebugf("SkAnimator: End UnitTest for %s\n", gUnitTests[i].fTypeName); | 696 SkDebugf("SkAnimator: End UnitTest for %s\n", gUnitTests[i].fTypeName); |
699 } | 697 } |
700 } | 698 } |
701 #else | 699 #else |
702 void SkAnimator::Init(bool) {} | 700 void SkAnimator::Init(bool) {} |
703 #endif | 701 #endif |
704 | 702 |
705 void SkAnimator::Term() { | 703 void SkAnimator::Term() { |
706 } | 704 } |
OLD | NEW |