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

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

Issue 2261113002: CC Animation: Introduce some dirty flags to optimize PushProperties on commit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add more tests. Created 4 years, 4 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
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/macros.h" 10 #include "base/macros.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 // AnimationDelegate routing. 75 // AnimationDelegate routing.
76 void NotifyAnimationStarted(base::TimeTicks monotonic_time, 76 void NotifyAnimationStarted(base::TimeTicks monotonic_time,
77 TargetProperty::Type target_property, 77 TargetProperty::Type target_property,
78 int group); 78 int group);
79 void NotifyAnimationFinished(base::TimeTicks monotonic_time, 79 void NotifyAnimationFinished(base::TimeTicks monotonic_time,
80 TargetProperty::Type target_property, 80 TargetProperty::Type target_property,
81 int group); 81 int group);
82 void NotifyAnimationAborted(base::TimeTicks monotonic_time, 82 void NotifyAnimationAborted(base::TimeTicks monotonic_time,
83 TargetProperty::Type target_property, 83 TargetProperty::Type target_property,
84 int group); 84 int group);
85 void NotifyAnimationWaitingForDeletion();
85 void NotifyAnimationTakeover(base::TimeTicks monotonic_time, 86 void NotifyAnimationTakeover(base::TimeTicks monotonic_time,
86 TargetProperty::Type target_property, 87 TargetProperty::Type target_property,
87 double animation_start_time, 88 double animation_start_time,
88 std::unique_ptr<AnimationCurve> curve); 89 std::unique_ptr<AnimationCurve> curve);
89 90
90 // Whether this player has animations waiting to get sent to ElementAnimations 91 // Whether this player has animations waiting to get sent to ElementAnimations
91 bool has_pending_animations_for_testing() const { 92 bool has_pending_animations_for_testing() const {
92 return !animations_.empty(); 93 return !animations_.empty();
93 } 94 }
94 95
96 bool needs_push_properties() const { return needs_push_properties_; }
97 void SetNeedsPushProperties();
98
95 private: 99 private:
96 friend class base::RefCounted<AnimationPlayer>; 100 friend class base::RefCounted<AnimationPlayer>;
97 101
98 explicit AnimationPlayer(int id); 102 explicit AnimationPlayer(int id);
99 ~AnimationPlayer(); 103 ~AnimationPlayer();
100 104
101 void SetNeedsCommit();
102
103 void RegisterPlayer(); 105 void RegisterPlayer();
104 void UnregisterPlayer(); 106 void UnregisterPlayer();
105 107
106 void BindElementAnimations(); 108 void BindElementAnimations();
107 void UnbindElementAnimations(); 109 void UnbindElementAnimations();
108 110
109 // We accumulate added animations in animations_ container 111 // We accumulate added animations in animations_ container
110 // if element_animations_ is a nullptr. It allows us to add/remove animations 112 // if element_animations_ is a nullptr. It allows us to add/remove animations
111 // to non-attached AnimationPlayers. 113 // to non-attached AnimationPlayers.
112 std::vector<std::unique_ptr<Animation>> animations_; 114 std::vector<std::unique_ptr<Animation>> animations_;
113 115
114 AnimationHost* animation_host_; 116 AnimationHost* animation_host_;
115 AnimationTimeline* animation_timeline_; 117 AnimationTimeline* animation_timeline_;
116 // element_animations isn't null if player attached to an element (layer). 118 // element_animations isn't null if player attached to an element (layer).
117 scoped_refptr<ElementAnimations> element_animations_; 119 scoped_refptr<ElementAnimations> element_animations_;
118 AnimationDelegate* animation_delegate_; 120 AnimationDelegate* animation_delegate_;
119 121
120 int id_; 122 int id_;
121 ElementId element_id_; 123 ElementId element_id_;
124 bool needs_push_properties_;
122 125
123 DISALLOW_COPY_AND_ASSIGN(AnimationPlayer); 126 DISALLOW_COPY_AND_ASSIGN(AnimationPlayer);
124 }; 127 };
125 128
126 } // namespace cc 129 } // namespace cc
127 130
128 #endif // CC_ANIMATION_ANIMATION_PLAYER_H_ 131 #endif // CC_ANIMATION_ANIMATION_PLAYER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698