| 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 | 158 |
| 159 bool SkAnimatorScript::EvalID(const char* token, size_t len, void* user, SkScrip
tValue* value) { | 159 bool SkAnimatorScript::EvalID(const char* token, size_t len, void* user, SkScrip
tValue* value) { |
| 160 SkAnimatorScript* engine = (SkAnimatorScript*) user; | 160 SkAnimatorScript* engine = (SkAnimatorScript*) user; |
| 161 SkTDict<SkDisplayable*>* ids = &engine->fMaker.fIDs; | 161 SkTDict<SkDisplayable*>* ids = &engine->fMaker.fIDs; |
| 162 SkDisplayable* displayable; | 162 SkDisplayable* displayable; |
| 163 bool success = ids->find(token, len, &displayable); | 163 bool success = ids->find(token, len, &displayable); |
| 164 if (success == false) { | 164 if (success == false) { |
| 165 displayable = engine->fWorking; | 165 displayable = engine->fWorking; |
| 166 if (SK_LITERAL_STR_EQUAL("parent", token, len)) { | 166 if (SK_LITERAL_STR_EQUAL("parent", token, len)) { |
| 167 SkDisplayable* parent = displayable->getParent(); | 167 SkDisplayable* parent = displayable->getParent(); |
| 168 if (parent == false) | 168 if (parent == NULL) |
| 169 parent = engine->fParent; | 169 parent = engine->fParent; |
| 170 if (parent) { | 170 if (parent) { |
| 171 value->fOperand.fDisplayable = parent; | 171 value->fOperand.fDisplayable = parent; |
| 172 value->fType = SkType_Displayable; | 172 value->fType = SkType_Displayable; |
| 173 return true; | 173 return true; |
| 174 } | 174 } |
| 175 } | 175 } |
| 176 if (displayable && EvalMember(token, len, displayable, engine, value)) | 176 if (displayable && EvalMember(token, len, displayable, engine, value)) |
| 177 return true; | 177 return true; |
| 178 value->fOperand.fString = NULL; | 178 value->fOperand.fString = NULL; |
| (...skipping 406 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 |