Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: cc/animation/animation_player.h

Issue 1904653002: CC Animation: Merge LayerAnimationController into ElementAnimations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor optimization: Don't init value observations if same host. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/animation/animation_host.cc ('k') | cc/animation/animation_player.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef CC_ANIMATION_ANIMATION_PLAYER_H_ 5 #ifndef CC_ANIMATION_ANIMATION_PLAYER_H_
6 #define CC_ANIMATION_ANIMATION_PLAYER_H_ 6 #define CC_ANIMATION_ANIMATION_PLAYER_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/containers/linked_list.h" 10 #include "base/containers/linked_list.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "base/time/time.h" 13 #include "base/time/time.h"
14 #include "cc/animation/animation.h" 14 #include "cc/animation/animation.h"
15 #include "cc/animation/animation_curve.h" 15 #include "cc/animation/animation_curve.h"
16 #include "cc/animation/element_animations.h" 16 #include "cc/animation/element_animations.h"
17 #include "cc/base/cc_export.h" 17 #include "cc/base/cc_export.h"
18 18
19 namespace cc { 19 namespace cc {
20 20
21 class AnimationDelegate; 21 class AnimationDelegate;
22 class AnimationHost; 22 class AnimationHost;
23 class AnimationTimeline; 23 class AnimationTimeline;
24 class ElementAnimations; 24 class ElementAnimations;
25 class LayerAnimationController;
26 enum class LayerTreeType; 25 enum class LayerTreeType;
27 26
28 // An AnimationPlayer owns all animations to be run on particular CC Layer. 27 // An AnimationPlayer owns all animations to be run on particular CC Layer.
29 // Multiple AnimationPlayers can be attached to one layer. In this case, 28 // Multiple AnimationPlayers can be attached to one layer. In this case,
30 // they share common LayerAnimationController (temp solution) so the 29 // they share common ElementAnimations so the
31 // LayerAnimationController-to-Layer relationship stays the same (1:1, LACs 30 // ElementAnimations-to-Layer relationship is 1:1.
32 // have same IDs as their respective Layers).
33 // For now, the blink logic is responsible for handling of conflicting 31 // For now, the blink logic is responsible for handling of conflicting
34 // same-property animations. 32 // same-property animations.
35 // Each AnimationPlayer has its copy on the impl thread. 33 // Each AnimationPlayer has its copy on the impl thread.
36 // This is a CC counterpart for blink::AnimationPlayer (in 1:1 relationship). 34 // This is a CC counterpart for blink::AnimationPlayer (in 1:1 relationship).
37 class CC_EXPORT AnimationPlayer : public base::RefCounted<AnimationPlayer>, 35 class CC_EXPORT AnimationPlayer : public base::RefCounted<AnimationPlayer>,
38 public base::LinkNode<AnimationPlayer> { 36 public base::LinkNode<AnimationPlayer> {
39 public: 37 public:
40 static scoped_refptr<AnimationPlayer> Create(int id); 38 static scoped_refptr<AnimationPlayer> Create(int id);
41 scoped_refptr<AnimationPlayer> CreateImplInstance() const; 39 scoped_refptr<AnimationPlayer> CreateImplInstance() const;
42 40
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 TargetProperty::Type target_property, 83 TargetProperty::Type target_property,
86 int group); 84 int group);
87 void NotifyAnimationAborted(base::TimeTicks monotonic_time, 85 void NotifyAnimationAborted(base::TimeTicks monotonic_time,
88 TargetProperty::Type target_property, 86 TargetProperty::Type target_property,
89 int group); 87 int group);
90 void NotifyAnimationTakeover(base::TimeTicks monotonic_time, 88 void NotifyAnimationTakeover(base::TimeTicks monotonic_time,
91 TargetProperty::Type target_property, 89 TargetProperty::Type target_property,
92 double animation_start_time, 90 double animation_start_time,
93 std::unique_ptr<AnimationCurve> curve); 91 std::unique_ptr<AnimationCurve> curve);
94 92
95 // Whether this player has animations waiting to get sent to LAC. 93 // Whether this player has animations waiting to get sent to ElementAnimations
96 bool has_pending_animations_for_testing() const { 94 bool has_pending_animations_for_testing() const {
97 return !animations_.empty(); 95 return !animations_.empty();
98 } 96 }
99 97
100 private: 98 private:
101 friend class base::RefCounted<AnimationPlayer>; 99 friend class base::RefCounted<AnimationPlayer>;
102 100
103 explicit AnimationPlayer(int id); 101 explicit AnimationPlayer(int id);
104 ~AnimationPlayer(); 102 ~AnimationPlayer();
105 103
(...skipping 18 matching lines...) Expand all
124 122
125 int id_; 123 int id_;
126 int layer_id_; 124 int layer_id_;
127 125
128 DISALLOW_COPY_AND_ASSIGN(AnimationPlayer); 126 DISALLOW_COPY_AND_ASSIGN(AnimationPlayer);
129 }; 127 };
130 128
131 } // namespace cc 129 } // namespace cc
132 130
133 #endif // CC_ANIMATION_ANIMATION_PLAYER_H_ 131 #endif // CC_ANIMATION_ANIMATION_PLAYER_H_
OLDNEW
« no previous file with comments | « cc/animation/animation_host.cc ('k') | cc/animation/animation_player.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698