| 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 "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "cc/animation/animation_host.h" | 9 #include "cc/animation/animation_host.h" |
| 10 #include "cc/animation/animation_player.h" | 10 #include "cc/animation/animation_player.h" |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 } | 143 } |
| 144 } | 144 } |
| 145 | 145 |
| 146 bool ElementAnimations::IsEmpty() const { | 146 bool ElementAnimations::IsEmpty() const { |
| 147 return players_list_->empty(); | 147 return players_list_->empty(); |
| 148 } | 148 } |
| 149 | 149 |
| 150 void ElementAnimations::PushPropertiesTo( | 150 void ElementAnimations::PushPropertiesTo( |
| 151 ElementAnimations* element_animations_impl) { | 151 ElementAnimations* element_animations_impl) { |
| 152 DCHECK(layer_animation_controller_); | 152 DCHECK(layer_animation_controller_); |
| 153 DCHECK(element_animations_impl->layer_animation_controller()); | 153 DCHECK(element_animations_impl->layer_animation_controller_); |
| 154 | 154 |
| 155 layer_animation_controller_->PushAnimationUpdatesTo( | 155 layer_animation_controller_->PushAnimationUpdatesTo( |
| 156 element_animations_impl->layer_animation_controller()); | 156 element_animations_impl->layer_animation_controller_.get()); |
| 157 } |
| 158 |
| 159 void ElementAnimations::AddAnimation(std::unique_ptr<Animation> animation) { |
| 160 layer_animation_controller_->AddAnimation(std::move(animation)); |
| 161 } |
| 162 |
| 163 void ElementAnimations::PauseAnimation(int animation_id, |
| 164 base::TimeDelta time_offset) { |
| 165 layer_animation_controller_->PauseAnimation(animation_id, time_offset); |
| 166 } |
| 167 |
| 168 void ElementAnimations::RemoveAnimation(int animation_id) { |
| 169 layer_animation_controller_->RemoveAnimation(animation_id); |
| 170 } |
| 171 |
| 172 void ElementAnimations::AbortAnimation(int animation_id) { |
| 173 layer_animation_controller_->AbortAnimation(animation_id); |
| 174 } |
| 175 |
| 176 void ElementAnimations::AbortAnimations(TargetProperty::Type target_property, |
| 177 bool needs_completion) { |
| 178 layer_animation_controller_->AbortAnimations(target_property, |
| 179 needs_completion); |
| 180 } |
| 181 |
| 182 Animation* ElementAnimations::GetAnimation( |
| 183 TargetProperty::Type target_property) const { |
| 184 return layer_animation_controller_->GetAnimation(target_property); |
| 185 } |
| 186 |
| 187 Animation* ElementAnimations::GetAnimationById(int animation_id) const { |
| 188 return layer_animation_controller_->GetAnimationById(animation_id); |
| 189 } |
| 190 |
| 191 void ElementAnimations::AddEventObserver( |
| 192 LayerAnimationEventObserver* observer) { |
| 193 layer_animation_controller_->AddEventObserver(observer); |
| 194 } |
| 195 |
| 196 void ElementAnimations::RemoveEventObserver( |
| 197 LayerAnimationEventObserver* observer) { |
| 198 layer_animation_controller_->RemoveEventObserver(observer); |
| 157 } | 199 } |
| 158 | 200 |
| 159 void ElementAnimations::SetFilterMutated(LayerTreeType tree_type, | 201 void ElementAnimations::SetFilterMutated(LayerTreeType tree_type, |
| 160 const FilterOperations& filters) { | 202 const FilterOperations& filters) { |
| 161 DCHECK(layer_id()); | 203 DCHECK(layer_id()); |
| 162 DCHECK(animation_host()); | 204 DCHECK(animation_host()); |
| 163 DCHECK(animation_host()->mutator_host_client()); | 205 DCHECK(animation_host()->mutator_host_client()); |
| 164 animation_host()->mutator_host_client()->SetLayerFilterMutated( | 206 animation_host()->mutator_host_client()->SetLayerFilterMutated( |
| 165 layer_id(), tree_type, filters); | 207 layer_id(), tree_type, filters); |
| 166 } | 208 } |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 if (animation_host()) { | 331 if (animation_host()) { |
| 290 DCHECK(animation_host()->mutator_host_client()); | 332 DCHECK(animation_host()->mutator_host_client()); |
| 291 return animation_host()->mutator_host_client()->GetScrollOffsetForAnimation( | 333 return animation_host()->mutator_host_client()->GetScrollOffsetForAnimation( |
| 292 layer_id()); | 334 layer_id()); |
| 293 } | 335 } |
| 294 | 336 |
| 295 return gfx::ScrollOffset(); | 337 return gfx::ScrollOffset(); |
| 296 } | 338 } |
| 297 | 339 |
| 298 } // namespace cc | 340 } // namespace cc |
| OLD | NEW |