| 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 "SkAnimateBase.h" | 10 #include "SkAnimateBase.h" |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 fFieldInfo = fTarget->getMember(arrayStr.c_str()); | 156 fFieldInfo = fTarget->getMember(arrayStr.c_str()); |
| 157 SkString scriptStr(arrayEnd + 1, lval.size() - arrayNameLen - 2); | 157 SkString scriptStr(arrayEnd + 1, lval.size() - arrayNameLen - 2); |
| 158 SkAnimatorScript::EvaluateInt(maker, this, scriptStr.c_str(), &fFieldOff
set); | 158 SkAnimatorScript::EvaluateInt(maker, this, scriptStr.c_str(), &fFieldOff
set); |
| 159 } | 159 } |
| 160 } | 160 } |
| 161 | 161 |
| 162 void SkAnimateBase::packARGB(SkScalar array[], int count, SkTDOperandArray* conv
erted) | 162 void SkAnimateBase::packARGB(SkScalar array[], int count, SkTDOperandArray* conv
erted) |
| 163 { | 163 { |
| 164 SkASSERT(count == 4); | 164 SkASSERT(count == 4); |
| 165 converted->setCount(1); | 165 converted->setCount(1); |
| 166 SkColor color = SkColorSetARGB(SkScalarRound(array[0]), SkScalarRound(array[
1]), | 166 SkColor color = SkColorSetARGB(SkScalarRoundToInt(array[0]), |
| 167 SkScalarRound(array[2]), SkScalarRound(array[3])); | 167 SkScalarRoundToInt(array[1]), |
| 168 SkScalarRoundToInt(array[2]), |
| 169 SkScalarRoundToInt(array[3])); |
| 168 (*converted)[0].fS32 = color; | 170 (*converted)[0].fS32 = color; |
| 169 } | 171 } |
| 170 | 172 |
| 171 | 173 |
| 172 | 174 |
| 173 void SkAnimateBase::refresh(SkAnimateMaker& ) { | 175 void SkAnimateBase::refresh(SkAnimateMaker& ) { |
| 174 } | 176 } |
| 175 | 177 |
| 176 bool SkAnimateBase::setParent(SkDisplayable* apply) { | 178 bool SkAnimateBase::setParent(SkDisplayable* apply) { |
| 177 SkASSERT(apply->isApply()); | 179 SkASSERT(apply->isApply()); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 return; | 226 return; |
| 225 } | 227 } |
| 226 if (fApply && fApply->getMode() != SkApply::kMode_create) | 228 if (fApply && fApply->getMode() != SkApply::kMode_create) |
| 227 target.reset(); | 229 target.reset(); |
| 228 } | 230 } |
| 229 } | 231 } |
| 230 | 232 |
| 231 bool SkAnimateBase::targetNeedsInitialization() const { | 233 bool SkAnimateBase::targetNeedsInitialization() const { |
| 232 return false; | 234 return false; |
| 233 } | 235 } |
| OLD | NEW |