| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "core/animation/InterpolableValue.h" | 6 #include "core/animation/InterpolableValue.h" |
| 7 | 7 |
| 8 namespace blink { | 8 namespace blink { |
| 9 | 9 |
| 10 DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(InterpolableValue); | 10 DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(InterpolableValue); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 InterpolableList& resultList = toInterpolableList(result); | 91 InterpolableList& resultList = toInterpolableList(result); |
| 92 | 92 |
| 93 ASSERT(resultList.m_size == m_size); | 93 ASSERT(resultList.m_size == m_size); |
| 94 | 94 |
| 95 for (size_t i = 0; i < m_size; i++) { | 95 for (size_t i = 0; i < m_size; i++) { |
| 96 ASSERT(m_values[i]); | 96 ASSERT(m_values[i]); |
| 97 m_values[i]->multiply(scalar, *(resultList.m_values[i])); | 97 m_values[i]->multiply(scalar, *(resultList.m_values[i])); |
| 98 } | 98 } |
| 99 } | 99 } |
| 100 | 100 |
| 101 void InterpolableList::trace(Visitor* visitor) | 101 DEFINE_TRACE(InterpolableList) |
| 102 { | 102 { |
| 103 visitor->trace(m_values); | 103 visitor->trace(m_values); |
| 104 InterpolableValue::trace(visitor); | 104 InterpolableValue::trace(visitor); |
| 105 } | 105 } |
| 106 | 106 |
| 107 void InterpolableAnimatableValue::interpolate(const InterpolableValue& to, const
double progress, InterpolableValue& result) const | 107 void InterpolableAnimatableValue::interpolate(const InterpolableValue& to, const
double progress, InterpolableValue& result) const |
| 108 { | 108 { |
| 109 const InterpolableAnimatableValue& toValue = toInterpolableAnimatableValue(t
o); | 109 const InterpolableAnimatableValue& toValue = toInterpolableAnimatableValue(t
o); |
| 110 InterpolableAnimatableValue& resultValue = toInterpolableAnimatableValue(res
ult); | 110 InterpolableAnimatableValue& resultValue = toInterpolableAnimatableValue(res
ult); |
| 111 if (progress == 0) | 111 if (progress == 0) |
| 112 resultValue.m_value = m_value; | 112 resultValue.m_value = m_value; |
| 113 if (progress == 1) | 113 if (progress == 1) |
| 114 resultValue.m_value = toValue.m_value; | 114 resultValue.m_value = toValue.m_value; |
| 115 resultValue.m_value = AnimatableValue::interpolate(m_value.get(), toValue.m_
value.get(), progress); | 115 resultValue.m_value = AnimatableValue::interpolate(m_value.get(), toValue.m_
value.get(), progress); |
| 116 } | 116 } |
| 117 | 117 |
| 118 void InterpolableAnimatableValue::trace(Visitor* visitor) | 118 DEFINE_TRACE(InterpolableAnimatableValue) |
| 119 { | 119 { |
| 120 visitor->trace(m_value); | 120 visitor->trace(m_value); |
| 121 InterpolableValue::trace(visitor); | 121 InterpolableValue::trace(visitor); |
| 122 } | 122 } |
| 123 | 123 |
| 124 } | 124 } |
| OLD | NEW |