| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/element_animations.h" | 5 #include "cc/animation/element_animations.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 | 131 |
| 132 bool ElementAnimations::IsEmpty() const { | 132 bool ElementAnimations::IsEmpty() const { |
| 133 return !players_list_.might_have_observers(); | 133 return !players_list_.might_have_observers(); |
| 134 } | 134 } |
| 135 | 135 |
| 136 void ElementAnimations::SetNeedsPushProperties() { | 136 void ElementAnimations::SetNeedsPushProperties() { |
| 137 needs_push_properties_ = true; | 137 needs_push_properties_ = true; |
| 138 } | 138 } |
| 139 | 139 |
| 140 void ElementAnimations::PushPropertiesTo( | 140 void ElementAnimations::PushPropertiesTo( |
| 141 scoped_refptr<ElementAnimations> element_animations_impl) { | 141 scoped_refptr<ElementAnimations> element_animations_impl) const { |
| 142 DCHECK_NE(this, element_animations_impl); | 142 DCHECK_NE(this, element_animations_impl); |
| 143 | 143 |
| 144 if (!needs_push_properties_) | 144 if (!needs_push_properties_) |
| 145 return; | 145 return; |
| 146 needs_push_properties_ = false; | 146 needs_push_properties_ = false; |
| 147 | 147 |
| 148 element_animations_impl->scroll_offset_animation_was_interrupted_ = | 148 element_animations_impl->scroll_offset_animation_was_interrupted_ = |
| 149 scroll_offset_animation_was_interrupted_; | 149 scroll_offset_animation_was_interrupted_; |
| 150 scroll_offset_animation_was_interrupted_ = false; | 150 scroll_offset_animation_was_interrupted_ = false; |
| 151 | 151 |
| 152 // Update impl client state. | 152 // Update impl client state. |
| 153 if (needs_update_impl_client_state_) | 153 if (needs_update_impl_client_state_) |
| 154 element_animations_impl->UpdateClientAnimationState(); | 154 element_animations_impl->UpdateClientAnimationState(); |
| 155 needs_update_impl_client_state_ = false; | 155 needs_update_impl_client_state_ = false; |
| 156 | 156 |
| 157 element_animations_impl->UpdateActivation(ActivationType::NORMAL); | 157 element_animations_impl->UpdateActivation(ActivationType::NORMAL); |
| 158 UpdateActivation(ActivationType::NORMAL); | |
| 159 } | 158 } |
| 160 | 159 |
| 161 void ElementAnimations::Animate(base::TimeTicks monotonic_time) { | 160 void ElementAnimations::Animate(base::TimeTicks monotonic_time) { |
| 162 DCHECK(!monotonic_time.is_null()); | 161 DCHECK(!monotonic_time.is_null()); |
| 163 if (!has_element_in_active_list() && !has_element_in_pending_list()) | 162 if (!has_element_in_active_list() && !has_element_in_pending_list()) |
| 164 return; | 163 return; |
| 165 | 164 |
| 166 for (auto& player : players_list_) { | 165 for (auto& player : players_list_) { |
| 167 if (player.needs_to_start_animations()) | 166 if (player.needs_to_start_animations()) |
| 168 player.StartAnimations(monotonic_time); | 167 player.StartAnimations(monotonic_time); |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 567 if (animation_host()) { | 566 if (animation_host()) { |
| 568 DCHECK(animation_host()->mutator_host_client()); | 567 DCHECK(animation_host()->mutator_host_client()); |
| 569 return animation_host()->mutator_host_client()->GetScrollOffsetForAnimation( | 568 return animation_host()->mutator_host_client()->GetScrollOffsetForAnimation( |
| 570 element_id()); | 569 element_id()); |
| 571 } | 570 } |
| 572 | 571 |
| 573 return gfx::ScrollOffset(); | 572 return gfx::ScrollOffset(); |
| 574 } | 573 } |
| 575 | 574 |
| 576 } // namespace cc | 575 } // namespace cc |
| OLD | NEW |