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

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: Do not change SetNeedsCommit invalidation, leave it as-is. Created 4 years, 3 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_perftest.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/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(); 105 void SetNeedsCommit();
102 106
103 void RegisterPlayer(); 107 void RegisterPlayer();
104 void UnregisterPlayer(); 108 void UnregisterPlayer();
105 109
106 void BindElementAnimations(); 110 void BindElementAnimations();
107 void UnbindElementAnimations(); 111 void UnbindElementAnimations();
108 112
109 // We accumulate added animations in animations_ container 113 // We accumulate added animations in animations_ container
110 // if element_animations_ is a nullptr. It allows us to add/remove animations 114 // if element_animations_ is a nullptr. It allows us to add/remove animations
111 // to non-attached AnimationPlayers. 115 // to non-attached AnimationPlayers.
112 std::vector<std::unique_ptr<Animation>> animations_; 116 std::vector<std::unique_ptr<Animation>> animations_;
113 117
114 AnimationHost* animation_host_; 118 AnimationHost* animation_host_;
115 AnimationTimeline* animation_timeline_; 119 AnimationTimeline* animation_timeline_;
116 // element_animations isn't null if player attached to an element (layer). 120 // element_animations isn't null if player attached to an element (layer).
117 scoped_refptr<ElementAnimations> element_animations_; 121 scoped_refptr<ElementAnimations> element_animations_;
118 AnimationDelegate* animation_delegate_; 122 AnimationDelegate* animation_delegate_;
119 123
120 int id_; 124 int id_;
121 ElementId element_id_; 125 ElementId element_id_;
126 bool needs_push_properties_;
122 127
123 DISALLOW_COPY_AND_ASSIGN(AnimationPlayer); 128 DISALLOW_COPY_AND_ASSIGN(AnimationPlayer);
124 }; 129 };
125 130
126 } // namespace cc 131 } // namespace cc
127 132
128 #endif // CC_ANIMATION_ANIMATION_PLAYER_H_ 133 #endif // CC_ANIMATION_ANIMATION_PLAYER_H_
OLDNEW
« no previous file with comments | « cc/animation/animation_host_perftest.cc ('k') | cc/animation/animation_player.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698