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 "cc/animation/animation_host.h" | 7 #include "cc/animation/animation_host.h" |
8 #include "cc/animation/animation_player.h" | 8 #include "cc/animation/animation_player.h" |
9 #include "cc/animation/animation_registrar.h" | 9 #include "cc/animation/animation_registrar.h" |
10 #include "cc/animation/layer_animation_value_observer.h" | 10 #include "cc/animation/layer_animation_value_observer.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 void OnTransformAnimated(const gfx::Transform& transform) override { | 31 void OnTransformAnimated(const gfx::Transform& transform) override { |
32 element_animations_->SetTransformMutated(tree_type_, transform); | 32 element_animations_->SetTransformMutated(tree_type_, transform); |
33 } | 33 } |
34 | 34 |
35 void OnScrollOffsetAnimated(const gfx::ScrollOffset& scroll_offset) override { | 35 void OnScrollOffsetAnimated(const gfx::ScrollOffset& scroll_offset) override { |
36 element_animations_->SetScrollOffsetMutated(tree_type_, scroll_offset); | 36 element_animations_->SetScrollOffsetMutated(tree_type_, scroll_offset); |
37 } | 37 } |
38 | 38 |
39 void OnAnimationWaitingForDeletion() override { | 39 void OnAnimationWaitingForDeletion() override { |
40 // TODO(loyso): implement it. | 40 // TODO(loyso): See Layer::OnAnimationWaitingForDeletion. But we always do |
| 41 // PushProperties for AnimationTimelines for now. |
41 } | 42 } |
42 | 43 |
43 bool IsActive() const override { return tree_type_ == LayerTreeType::ACTIVE; } | 44 bool IsActive() const override { return tree_type_ == LayerTreeType::ACTIVE; } |
44 | 45 |
45 private: | 46 private: |
46 ElementAnimations* element_animations_; | 47 ElementAnimations* element_animations_; |
47 const LayerTreeType tree_type_; | 48 const LayerTreeType tree_type_; |
48 | 49 |
49 DISALLOW_COPY_AND_ASSIGN(ValueObserver); | 50 DISALLOW_COPY_AND_ASSIGN(ValueObserver); |
50 }; | 51 }; |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 Animation::TargetProperty target_property, | 230 Animation::TargetProperty target_property, |
230 int group) { | 231 int group) { |
231 for (PlayersListNode* node = players_list_->head(); | 232 for (PlayersListNode* node = players_list_->head(); |
232 node != players_list_->end(); node = node->next()) { | 233 node != players_list_->end(); node = node->next()) { |
233 AnimationPlayer* player = node->value(); | 234 AnimationPlayer* player = node->value(); |
234 player->NotifyAnimationFinished(monotonic_time, target_property, group); | 235 player->NotifyAnimationFinished(monotonic_time, target_property, group); |
235 } | 236 } |
236 } | 237 } |
237 | 238 |
238 gfx::ScrollOffset ElementAnimations::ScrollOffsetForAnimation() const { | 239 gfx::ScrollOffset ElementAnimations::ScrollOffsetForAnimation() const { |
239 // TODO(loyso): implement it. | 240 DCHECK(layer_animation_controller_); |
| 241 if (animation_host()) { |
| 242 DCHECK(animation_host()->mutator_host_client()); |
| 243 return animation_host()->mutator_host_client()->GetScrollOffsetForAnimation( |
| 244 layer_id()); |
| 245 } |
| 246 |
240 return gfx::ScrollOffset(); | 247 return gfx::ScrollOffset(); |
241 } | 248 } |
242 | 249 |
243 } // namespace cc | 250 } // namespace cc |
OLD | NEW |