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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 void InterpolableList::trace(Visitor* visitor) |
102 { | 102 { |
103 #if ENABLE_OILPAN | |
104 visitor->trace(m_values); | 103 visitor->trace(m_values); |
105 #endif | |
106 InterpolableValue::trace(visitor); | 104 InterpolableValue::trace(visitor); |
107 } | 105 } |
108 | 106 |
109 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 |
110 { | 108 { |
111 const InterpolableAnimatableValue& toValue = toInterpolableAnimatableValue(t
o); | 109 const InterpolableAnimatableValue& toValue = toInterpolableAnimatableValue(t
o); |
112 InterpolableAnimatableValue& resultValue = toInterpolableAnimatableValue(res
ult); | 110 InterpolableAnimatableValue& resultValue = toInterpolableAnimatableValue(res
ult); |
113 if (progress == 0) | 111 if (progress == 0) |
114 resultValue.m_value = m_value; | 112 resultValue.m_value = m_value; |
115 if (progress == 1) | 113 if (progress == 1) |
116 resultValue.m_value = toValue.m_value; | 114 resultValue.m_value = toValue.m_value; |
117 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); |
118 } | 116 } |
119 | 117 |
120 void InterpolableAnimatableValue::trace(Visitor* visitor) | 118 void InterpolableAnimatableValue::trace(Visitor* visitor) |
121 { | 119 { |
122 visitor->trace(m_value); | 120 visitor->trace(m_value); |
123 InterpolableValue::trace(visitor); | 121 InterpolableValue::trace(visitor); |
124 } | 122 } |
125 | 123 |
126 } | 124 } |
OLD | NEW |