| 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/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 for (auto& observer : observers_) | 41 for (auto& observer : observers_) |
| 42 observer.DetachedFromSequence(this, true); | 42 observer.DetachedFromSequence(this, true); |
| 43 } | 43 } |
| 44 | 44 |
| 45 void LayerAnimationSequence::Start(LayerAnimationDelegate* delegate) { | 45 void LayerAnimationSequence::Start(LayerAnimationDelegate* delegate) { |
| 46 DCHECK(start_time_ != base::TimeTicks()); | 46 DCHECK(start_time_ != base::TimeTicks()); |
| 47 last_progressed_fraction_ = 0.0; | 47 last_progressed_fraction_ = 0.0; |
| 48 if (elements_.empty()) | 48 if (elements_.empty()) |
| 49 return; | 49 return; |
| 50 | 50 |
| 51 elements_[0]->set_requested_start_time(start_time_); |
| 52 elements_[0]->Start(delegate, animation_group_id_); |
| 53 |
| 51 NotifyStarted(); | 54 NotifyStarted(); |
| 52 | 55 |
| 53 elements_[0]->set_requested_start_time(start_time_); | 56 // This may have been aborted. |
| 54 elements_[0]->Start(delegate, animation_group_id_); | |
| 55 } | 57 } |
| 56 | 58 |
| 57 void LayerAnimationSequence::Progress(base::TimeTicks now, | 59 void LayerAnimationSequence::Progress(base::TimeTicks now, |
| 58 LayerAnimationDelegate* delegate) { | 60 LayerAnimationDelegate* delegate) { |
| 59 DCHECK(start_time_ != base::TimeTicks()); | 61 DCHECK(start_time_ != base::TimeTicks()); |
| 60 bool redraw_required = false; | 62 bool redraw_required = false; |
| 61 | 63 |
| 62 if (elements_.empty()) | 64 if (elements_.empty()) |
| 63 return; | 65 return; |
| 64 | 66 |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 | 276 |
| 275 LayerAnimationElement* LayerAnimationSequence::CurrentElement() const { | 277 LayerAnimationElement* LayerAnimationSequence::CurrentElement() const { |
| 276 if (elements_.empty()) | 278 if (elements_.empty()) |
| 277 return NULL; | 279 return NULL; |
| 278 | 280 |
| 279 size_t current_index = last_element_ % elements_.size(); | 281 size_t current_index = last_element_ % elements_.size(); |
| 280 return elements_[current_index].get(); | 282 return elements_[current_index].get(); |
| 281 } | 283 } |
| 282 | 284 |
| 283 } // namespace ui | 285 } // namespace ui |
| OLD | NEW |