Chromium Code Reviews| Index: cc/animation/animation_player.h |
| diff --git a/cc/animation/animation_player.h b/cc/animation/animation_player.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..3b26ed88300fe7b507011e7372eed153fe8fea2d |
| --- /dev/null |
| +++ b/cc/animation/animation_player.h |
| @@ -0,0 +1,89 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CC_ANIMATION_ANIMATION_PLAYER_H_ |
| +#define CC_ANIMATION_ANIMATION_PLAYER_H_ |
| + |
| +#include "base/memory/ref_counted.h" |
| +#include "cc/animation/layer_animation_controller.h" |
| +#include "cc/animation/layer_animation_value_observer.h" |
| +#include "cc/animation/layer_animation_value_provider.h" |
| +#include "cc/base/cc_export.h" |
| + |
| +namespace cc { |
| + |
| +class AnimationTimeline; |
| +class Layer; |
| + |
| +class CC_EXPORT AnimationPlayer : public base::RefCounted<AnimationPlayer>, |
| + public LayerAnimationValueProvider { |
| + public: |
| + static scoped_refptr<AnimationPlayer> Create(int id); |
| + scoped_refptr<AnimationPlayer> CreateImplInstance() const; |
| + |
| + int id() const { return id_; } |
| + |
| + AnimationTimeline* animation_timeline() { return animation_timeline_; } |
| + const AnimationTimeline* animation_timeline() const { |
| + return animation_timeline_; |
| + } |
| + void SetAnimationTimeline(AnimationTimeline* timeline); |
| + |
| + LayerAnimationController* layer_animation_controller() const { |
| + return layer_animation_controller_.get(); |
| + } |
| + |
| + void set_layer_animation_delegate(AnimationDelegate* delegate); |
|
Ian Vollick
2015/05/05 03:52:06
Will we need to plumb back animation start times o
|
| + |
| + void AttachLayer(int layer_id); |
| + void DetachLayer(); |
| + |
| + void LayerImplRegistered(int layer_id, bool is_active_tree); |
| + void LayerImplUnregistered(int layer_id, bool is_active_tree); |
| + |
| + void AddAnimation(scoped_ptr<Animation> animation); |
| + void PauseAnimation(int animation_id, double time_offset); |
| + void RemoveAnimation(int animation_id); |
| + |
| + void PushPropertiesTo(AnimationPlayer* player_impl); |
| + |
| + private: |
| + friend class base::RefCounted<AnimationPlayer>; |
| + friend class AnimationPlayerPendingValueObserver; |
| + |
| + explicit AnimationPlayer(int id); |
| + ~AnimationPlayer() override; |
| + |
| + void SetNeedsCommit(); |
| + |
| + void SetFilterMutated(bool active_tree, const FilterOperations& filters); |
| + void SetOpacityMutated(bool active_tree, float opacity); |
| + void SetTransformMutated(bool active_tree, const gfx::Transform& transform); |
| + |
| + void CreateActiveValueObserver(); |
| + void DestroyActiveValueObserver(); |
| + |
| + void CreatePendingValueObserver(); |
| + void DestroyPendingValueObserver(); |
| + |
| + // LayerAnimationValueProvider implementation. |
| + gfx::ScrollOffset ScrollOffsetForAnimation() const override; |
| + |
| + class ValueObserver; |
| + scoped_ptr<ValueObserver> active_value_observer_; |
| + scoped_ptr<ValueObserver> pending_value_observer_; |
| + |
| + scoped_refptr<LayerAnimationController> layer_animation_controller_; |
| + AnimationTimeline* animation_timeline_; |
| + AnimationDelegate* layer_animation_delegate_; |
| + |
| + int id_; |
| + int layer_id_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(AnimationPlayer); |
| +}; |
| + |
| +} // namespace cc |
| + |
| +#endif // CC_ANIMATION_ANIMATION_PLAYER_H_ |