OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 "cc/animation/layer_animation_controller.h" | 5 #include "cc/animation/layer_animation_controller.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "cc/animation/animation.h" | 9 #include "cc/animation/animation.h" |
10 #include "cc/animation/animation_delegate.h" | 10 #include "cc/animation/animation_delegate.h" |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 continue; | 145 continue; |
146 | 146 |
147 double trimmed = animation->TrimTimeToCurrentIteration(monotonic_time); | 147 double trimmed = animation->TrimTimeToCurrentIteration(monotonic_time); |
148 switch (animation->target_property()) { | 148 switch (animation->target_property()) { |
149 case Animation::Opacity: { | 149 case Animation::Opacity: { |
150 AnimationEvent event(AnimationEvent::PropertyUpdate, | 150 AnimationEvent event(AnimationEvent::PropertyUpdate, |
151 id_, | 151 id_, |
152 animation->group(), | 152 animation->group(), |
153 Animation::Opacity, | 153 Animation::Opacity, |
154 monotonic_time); | 154 monotonic_time); |
155 event.opacity = animation->curve()->ToFloatAnimationCurve()->GetValue( | 155 const FloatAnimationCurve* float_animation_curve = |
156 trimmed); | 156 animation->curve()->ToFloatAnimationCurve(); |
| 157 event.opacity = float_animation_curve->GetValue(trimmed); |
157 event.is_impl_only = true; | 158 event.is_impl_only = true; |
158 events->push_back(event); | 159 events->push_back(event); |
159 break; | 160 break; |
160 } | 161 } |
161 | 162 |
162 case Animation::Transform: { | 163 case Animation::Transform: { |
163 AnimationEvent event(AnimationEvent::PropertyUpdate, | 164 AnimationEvent event(AnimationEvent::PropertyUpdate, |
164 id_, | 165 id_, |
165 animation->group(), | 166 animation->group(), |
166 Animation::Transform, | 167 Animation::Transform, |
167 monotonic_time); | 168 monotonic_time); |
168 event.transform = | 169 const TransformAnimationCurve* transform_animation_curve = |
169 animation->curve()->ToTransformAnimationCurve()->GetValue(trimmed); | 170 animation->curve()->ToTransformAnimationCurve(); |
| 171 event.transform = transform_animation_curve->GetValue(trimmed); |
170 event.is_impl_only = true; | 172 event.is_impl_only = true; |
171 events->push_back(event); | 173 events->push_back(event); |
172 break; | 174 break; |
173 } | 175 } |
174 | 176 |
175 case Animation::Filter: { | 177 case Animation::Filter: { |
176 AnimationEvent event(AnimationEvent::PropertyUpdate, | 178 AnimationEvent event(AnimationEvent::PropertyUpdate, |
177 id_, | 179 id_, |
178 animation->group(), | 180 animation->group(), |
179 Animation::Filter, | 181 Animation::Filter, |
180 monotonic_time); | 182 monotonic_time); |
181 event.filters = animation->curve()->ToFilterAnimationCurve()->GetValue( | 183 const FilterAnimationCurve* filter_animation_curve = |
182 trimmed); | 184 animation->curve()->ToFilterAnimationCurve(); |
| 185 event.filters = filter_animation_curve->GetValue(trimmed); |
183 event.is_impl_only = true; | 186 event.is_impl_only = true; |
184 events->push_back(event); | 187 events->push_back(event); |
185 break; | 188 break; |
186 } | 189 } |
187 | 190 |
188 case Animation::BackgroundColor: { break; } | 191 case Animation::BackgroundColor: { break; } |
189 | 192 |
190 case Animation::ScrollOffset: { | 193 case Animation::ScrollOffset: { |
191 // Impl-side changes to scroll offset are already sent back to the | 194 // Impl-side changes to scroll offset are already sent back to the |
192 // main thread (e.g. for user-driven scrolling), so a PropertyUpdate | 195 // main thread (e.g. for user-driven scrolling), so a PropertyUpdate |
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1000 value_observers_); | 1003 value_observers_); |
1001 LayerAnimationValueObserver* obs; | 1004 LayerAnimationValueObserver* obs; |
1002 while ((obs = it.GetNext()) != NULL) | 1005 while ((obs = it.GetNext()) != NULL) |
1003 if (obs->IsActive()) | 1006 if (obs->IsActive()) |
1004 return true; | 1007 return true; |
1005 } | 1008 } |
1006 return false; | 1009 return false; |
1007 } | 1010 } |
1008 | 1011 |
1009 } // namespace cc | 1012 } // namespace cc |
OLD | NEW |