OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "ui/compositor/layer_animation_sequence.h" | 5 #include "ui/compositor/layer_animation_sequence.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <iterator> | 8 #include <iterator> |
9 | 9 |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 const cc::AnimationEvent& event) { | 212 const cc::AnimationEvent& event) { |
213 if (elements_.empty() || event.group_id != animation_group_id_) | 213 if (elements_.empty() || event.group_id != animation_group_id_) |
214 return; | 214 return; |
215 | 215 |
216 size_t current_index = last_element_ % elements_.size(); | 216 size_t current_index = last_element_ % elements_.size(); |
217 LayerAnimationElement::AnimatableProperties element_properties = | 217 LayerAnimationElement::AnimatableProperties element_properties = |
218 elements_[current_index]->properties(); | 218 elements_[current_index]->properties(); |
219 LayerAnimationElement::AnimatableProperty event_property = | 219 LayerAnimationElement::AnimatableProperty event_property = |
220 LayerAnimationElement::ToAnimatableProperty(event.target_property); | 220 LayerAnimationElement::ToAnimatableProperty(event.target_property); |
221 DCHECK(element_properties & event_property); | 221 DCHECK(element_properties & event_property); |
222 elements_[current_index]->set_effective_start_time( | 222 elements_[current_index]->set_effective_start_time(event.monotonic_time); |
223 base::TimeTicks::FromInternalValue( | |
224 event.monotonic_time * base::Time::kMicrosecondsPerSecond)); | |
225 } | 223 } |
226 | 224 |
227 void LayerAnimationSequence::OnScheduled() { | 225 void LayerAnimationSequence::OnScheduled() { |
228 NotifyScheduled(); | 226 NotifyScheduled(); |
229 } | 227 } |
230 | 228 |
231 void LayerAnimationSequence::OnAnimatorDestroyed() { | 229 void LayerAnimationSequence::OnAnimatorDestroyed() { |
232 if (observers_.might_have_observers()) { | 230 if (observers_.might_have_observers()) { |
233 ObserverListBase<LayerAnimationObserver>::Iterator it(observers_); | 231 ObserverListBase<LayerAnimationObserver>::Iterator it(observers_); |
234 LayerAnimationObserver* obs; | 232 LayerAnimationObserver* obs; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 | 272 |
275 LayerAnimationElement* LayerAnimationSequence::CurrentElement() const { | 273 LayerAnimationElement* LayerAnimationSequence::CurrentElement() const { |
276 if (elements_.empty()) | 274 if (elements_.empty()) |
277 return NULL; | 275 return NULL; |
278 | 276 |
279 size_t current_index = last_element_ % elements_.size(); | 277 size_t current_index = last_element_ % elements_.size(); |
280 return elements_[current_index].get(); | 278 return elements_[current_index].get(); |
281 } | 279 } |
282 | 280 |
283 } // namespace ui | 281 } // namespace ui |
OLD | NEW |