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

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: 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
95 private: 98 private:
96 friend class base::RefCounted<AnimationPlayer>; 99 friend class base::RefCounted<AnimationPlayer>;
97 100
98 explicit AnimationPlayer(int id); 101 explicit AnimationPlayer(int id);
99 ~AnimationPlayer(); 102 ~AnimationPlayer();
100 103
101 void SetNeedsCommit(); 104 void SetNeedsPushProperties();
102 105
103 void RegisterPlayer(); 106 void RegisterPlayer();
104 void UnregisterPlayer(); 107 void UnregisterPlayer();
105 108
106 void BindElementAnimations(); 109 void BindElementAnimations();
107 void UnbindElementAnimations(); 110 void UnbindElementAnimations();
108 111
109 // We accumulate added animations in animations_ container 112 // We accumulate added animations in animations_ container
110 // if element_animations_ is a nullptr. It allows us to add/remove animations 113 // if element_animations_ is a nullptr. It allows us to add/remove animations
111 // to non-attached AnimationPlayers. 114 // to non-attached AnimationPlayers.
112 std::vector<std::unique_ptr<Animation>> animations_; 115 std::vector<std::unique_ptr<Animation>> animations_;
113 116
114 AnimationHost* animation_host_; 117 AnimationHost* animation_host_;
115 AnimationTimeline* animation_timeline_; 118 AnimationTimeline* animation_timeline_;
116 // element_animations isn't null if player attached to an element (layer). 119 // element_animations isn't null if player attached to an element (layer).
117 scoped_refptr<ElementAnimations> element_animations_; 120 scoped_refptr<ElementAnimations> element_animations_;
118 AnimationDelegate* animation_delegate_; 121 AnimationDelegate* animation_delegate_;
119 122
120 int id_; 123 int id_;
121 ElementId element_id_; 124 ElementId element_id_;
125 bool needs_push_properties_;
122 126
123 DISALLOW_COPY_AND_ASSIGN(AnimationPlayer); 127 DISALLOW_COPY_AND_ASSIGN(AnimationPlayer);
124 }; 128 };
125 129
126 } // namespace cc 130 } // namespace cc
127 131
128 #endif // CC_ANIMATION_ANIMATION_PLAYER_H_ 132 #endif // CC_ANIMATION_ANIMATION_PLAYER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698