| OLD | NEW |
| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 scoped_refptr<ElementAnimations> GetElementAnimationsForElementId( | 72 scoped_refptr<ElementAnimations> GetElementAnimationsForElementId( |
| 73 ElementId element_id) const; | 73 ElementId element_id) const; |
| 74 | 74 |
| 75 // Parent LayerTreeHost or LayerTreeHostImpl. | 75 // Parent LayerTreeHost or LayerTreeHostImpl. |
| 76 MutatorHostClient* mutator_host_client() { return mutator_host_client_; } | 76 MutatorHostClient* mutator_host_client() { return mutator_host_client_; } |
| 77 const MutatorHostClient* mutator_host_client() const { | 77 const MutatorHostClient* mutator_host_client() const { |
| 78 return mutator_host_client_; | 78 return mutator_host_client_; |
| 79 } | 79 } |
| 80 void SetMutatorHostClient(MutatorHostClient* client); | 80 void SetMutatorHostClient(MutatorHostClient* client); |
| 81 | 81 |
| 82 void SetNeedsPushProperties(); | 82 void SetNeedsCommit(); |
| 83 bool needs_push_properties() const { return needs_push_properties_; } | 83 void SetNeedsRebuildPropertyTrees(); |
| 84 | 84 |
| 85 void PushPropertiesTo(AnimationHost* host_impl); | 85 void PushPropertiesTo(AnimationHost* host_impl); |
| 86 | 86 |
| 87 void SetSupportsScrollAnimations(bool supports_scroll_animations); | 87 void SetSupportsScrollAnimations(bool supports_scroll_animations); |
| 88 bool SupportsScrollAnimations() const; | 88 bool SupportsScrollAnimations() const; |
| 89 bool NeedsAnimateLayers() const; | 89 bool NeedsAnimateLayers() const; |
| 90 | 90 |
| 91 bool ActivateAnimations(); | 91 bool ActivateAnimations(); |
| 92 bool AnimateLayers(base::TimeTicks monotonic_time); | 92 bool AnimateLayers(base::TimeTicks monotonic_time); |
| 93 bool UpdateAnimationState(bool start_ready_animations, | 93 bool UpdateAnimationState(bool start_ready_animations, |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 void DidDeactivateElementAnimations(ElementAnimations* element_animations); | 163 void DidDeactivateElementAnimations(ElementAnimations* element_animations); |
| 164 | 164 |
| 165 // Registers the given ElementAnimations as alive. | 165 // Registers the given ElementAnimations as alive. |
| 166 void RegisterElementAnimations(ElementAnimations* element_animations); | 166 void RegisterElementAnimations(ElementAnimations* element_animations); |
| 167 // Unregisters the given ElementAnimations as alive. | 167 // Unregisters the given ElementAnimations as alive. |
| 168 void UnregisterElementAnimations(ElementAnimations* element_animations); | 168 void UnregisterElementAnimations(ElementAnimations* element_animations); |
| 169 | 169 |
| 170 const ElementToAnimationsMap& active_element_animations_for_testing() const; | 170 const ElementToAnimationsMap& active_element_animations_for_testing() const; |
| 171 const ElementToAnimationsMap& all_element_animations_for_testing() const; | 171 const ElementToAnimationsMap& all_element_animations_for_testing() const; |
| 172 | 172 |
| 173 bool animation_waiting_for_deletion() const { |
| 174 return animation_waiting_for_deletion_; |
| 175 } |
| 176 void OnAnimationWaitingForDeletion(); |
| 177 |
| 173 private: | 178 private: |
| 174 explicit AnimationHost(ThreadInstance thread_instance); | 179 explicit AnimationHost(ThreadInstance thread_instance); |
| 175 | 180 |
| 176 void PushTimelinesToImplThread(AnimationHost* host_impl) const; | 181 void PushTimelinesToImplThread(AnimationHost* host_impl) const; |
| 177 void RemoveTimelinesFromImplThread(AnimationHost* host_impl) const; | 182 void RemoveTimelinesFromImplThread(AnimationHost* host_impl) const; |
| 178 void PushPropertiesToImplThread(AnimationHost* host_impl); | 183 void PushPropertiesToImplThread(AnimationHost* host_impl); |
| 179 | 184 |
| 180 void EraseTimeline(scoped_refptr<AnimationTimeline> timeline); | 185 void EraseTimeline(scoped_refptr<AnimationTimeline> timeline); |
| 181 | 186 |
| 182 ElementToAnimationsMap element_to_animations_map_; | 187 ElementToAnimationsMap element_to_animations_map_; |
| 183 ElementToAnimationsMap active_element_to_animations_map_; | 188 ElementToAnimationsMap active_element_to_animations_map_; |
| 184 | 189 |
| 185 // A list of all timelines which this host owns. | 190 // A list of all timelines which this host owns. |
| 186 using IdToTimelineMap = | 191 using IdToTimelineMap = |
| 187 std::unordered_map<int, scoped_refptr<AnimationTimeline>>; | 192 std::unordered_map<int, scoped_refptr<AnimationTimeline>>; |
| 188 IdToTimelineMap id_to_timeline_map_; | 193 IdToTimelineMap id_to_timeline_map_; |
| 189 | 194 |
| 190 MutatorHostClient* mutator_host_client_; | 195 MutatorHostClient* mutator_host_client_; |
| 191 | 196 |
| 192 std::unique_ptr<ScrollOffsetAnimations> scroll_offset_animations_; | 197 std::unique_ptr<ScrollOffsetAnimations> scroll_offset_animations_; |
| 193 std::unique_ptr<ScrollOffsetAnimationsImpl> scroll_offset_animations_impl_; | 198 std::unique_ptr<ScrollOffsetAnimationsImpl> scroll_offset_animations_impl_; |
| 194 | 199 |
| 195 const ThreadInstance thread_instance_; | 200 const ThreadInstance thread_instance_; |
| 196 | 201 |
| 197 bool supports_scroll_animations_; | 202 bool supports_scroll_animations_; |
| 198 bool needs_push_properties_; | 203 bool animation_waiting_for_deletion_; |
| 199 | 204 |
| 200 DISALLOW_COPY_AND_ASSIGN(AnimationHost); | 205 DISALLOW_COPY_AND_ASSIGN(AnimationHost); |
| 201 }; | 206 }; |
| 202 | 207 |
| 203 } // namespace cc | 208 } // namespace cc |
| 204 | 209 |
| 205 #endif // CC_ANIMATION_ANIMATION_HOST_H_ | 210 #endif // CC_ANIMATION_ANIMATION_HOST_H_ |
| OLD | NEW |