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

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

Issue 1877073006: CC Animation: Make AnimationRegistrar a private member of AnimationHost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « no previous file | cc/animation/animation_host.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_HOST_H_ 5 #ifndef CC_ANIMATION_ANIMATION_HOST_H_
6 #define CC_ANIMATION_ANIMATION_HOST_H_ 6 #define CC_ANIMATION_ANIMATION_HOST_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <unordered_map> 9 #include <unordered_map>
10 10
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 const MutatorHostClient* mutator_host_client() const { 70 const MutatorHostClient* mutator_host_client() const {
71 return mutator_host_client_; 71 return mutator_host_client_;
72 } 72 }
73 void SetMutatorHostClient(MutatorHostClient* client); 73 void SetMutatorHostClient(MutatorHostClient* client);
74 74
75 void SetNeedsCommit(); 75 void SetNeedsCommit();
76 void SetNeedsRebuildPropertyTrees(); 76 void SetNeedsRebuildPropertyTrees();
77 77
78 void PushPropertiesTo(AnimationHost* host_impl); 78 void PushPropertiesTo(AnimationHost* host_impl);
79 79
80 AnimationRegistrar* animation_registrar() const {
81 return animation_registrar_.get();
82 }
83
84 void SetSupportsScrollAnimations(bool supports_scroll_animations); 80 void SetSupportsScrollAnimations(bool supports_scroll_animations);
85 bool SupportsScrollAnimations() const; 81 bool SupportsScrollAnimations() const;
86 bool NeedsAnimateLayers() const; 82 bool NeedsAnimateLayers() const;
87 83
88 bool ActivateAnimations(); 84 bool ActivateAnimations();
89 bool AnimateLayers(base::TimeTicks monotonic_time); 85 bool AnimateLayers(base::TimeTicks monotonic_time);
90 bool UpdateAnimationState(bool start_ready_animations, 86 bool UpdateAnimationState(bool start_ready_animations,
91 AnimationEvents* events); 87 AnimationEvents* events);
92 88
93 std::unique_ptr<AnimationEvents> CreateEvents(); 89 std::unique_ptr<AnimationEvents> CreateEvents();
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 const gfx::ScrollOffset& target_offset, 140 const gfx::ScrollOffset& target_offset,
145 const gfx::ScrollOffset& current_offset); 141 const gfx::ScrollOffset& current_offset);
146 bool ImplOnlyScrollAnimationUpdateTarget( 142 bool ImplOnlyScrollAnimationUpdateTarget(
147 int layer_id, 143 int layer_id,
148 const gfx::Vector2dF& scroll_delta, 144 const gfx::Vector2dF& scroll_delta,
149 const gfx::ScrollOffset& max_scroll_offset, 145 const gfx::ScrollOffset& max_scroll_offset,
150 base::TimeTicks frame_monotonic_time); 146 base::TimeTicks frame_monotonic_time);
151 147
152 void ScrollAnimationAbort(bool needs_completion); 148 void ScrollAnimationAbort(bool needs_completion);
153 149
150 // If an animation has been registered for the given id, return it. Otherwise
151 // creates a new one and returns a scoped_refptr to it.
152 scoped_refptr<LayerAnimationController> GetAnimationControllerForId(int id);
153
154 void SetAnimationRegistrarFor(
155 scoped_refptr<LayerAnimationController> controller);
156 void ResetAnimationRegistrarFor(
157 scoped_refptr<LayerAnimationController> controller);
158
159 // Registers the given controller as alive.
160 void RegisterAnimationController(LayerAnimationController* controller);
161 // Unregisters the given controller as alive.
162 void UnregisterAnimationController(LayerAnimationController* controller);
163
164 using AnimationControllerMap =
165 std::unordered_map<int, LayerAnimationController*>;
166 const AnimationControllerMap& active_animation_controllers_for_testing()
167 const;
168 const AnimationControllerMap& all_animation_controllers_for_testing() const;
169
154 private: 170 private:
155 explicit AnimationHost(ThreadInstance thread_instance); 171 explicit AnimationHost(ThreadInstance thread_instance);
156 172
157 void PushTimelinesToImplThread(AnimationHost* host_impl) const; 173 void PushTimelinesToImplThread(AnimationHost* host_impl) const;
158 void RemoveTimelinesFromImplThread(AnimationHost* host_impl) const; 174 void RemoveTimelinesFromImplThread(AnimationHost* host_impl) const;
159 void PushPropertiesToImplThread(AnimationHost* host_impl); 175 void PushPropertiesToImplThread(AnimationHost* host_impl);
160 176
161 void EraseTimeline(scoped_refptr<AnimationTimeline> timeline); 177 void EraseTimeline(scoped_refptr<AnimationTimeline> timeline);
162 178
163 // TODO(loyso): For now AnimationPlayers share LayerAnimationController object 179 // TODO(loyso): For now AnimationPlayers share LayerAnimationController object
(...skipping 15 matching lines...) Expand all
179 std::unique_ptr<ScrollOffsetAnimations> scroll_offset_animations_; 195 std::unique_ptr<ScrollOffsetAnimations> scroll_offset_animations_;
180 196
181 const ThreadInstance thread_instance_; 197 const ThreadInstance thread_instance_;
182 198
183 DISALLOW_COPY_AND_ASSIGN(AnimationHost); 199 DISALLOW_COPY_AND_ASSIGN(AnimationHost);
184 }; 200 };
185 201
186 } // namespace cc 202 } // namespace cc
187 203
188 #endif // CC_ANIMATION_ANIMATION_HOST_H_ 204 #endif // CC_ANIMATION_ANIMATION_HOST_H_
OLDNEW
« no previous file with comments | « no previous file | cc/animation/animation_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698