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 27 matching lines...) Expand all Loading... |
38 // Specifically, it owns all the AnimationTimelines objects. | 38 // Specifically, it owns all the AnimationTimelines objects. |
39 // There is just one AnimationHost for LayerTreeHost on main renderer thread | 39 // There is just one AnimationHost for LayerTreeHost on main renderer thread |
40 // and just one AnimationHost for LayerTreeHostImpl on impl thread. | 40 // and just one AnimationHost for LayerTreeHostImpl on impl thread. |
41 // We synchronize them during the commit process in a one-way data flow process | 41 // We synchronize them during the commit process in a one-way data flow process |
42 // (PushPropertiesTo). | 42 // (PushPropertiesTo). |
43 // An AnimationHost talks to its correspondent LayerTreeHost via | 43 // An AnimationHost talks to its correspondent LayerTreeHost via |
44 // LayerTreeMutatorsClient interface. | 44 // LayerTreeMutatorsClient interface. |
45 class CC_EXPORT AnimationHost { | 45 class CC_EXPORT AnimationHost { |
46 public: | 46 public: |
47 using ElementToAnimationsMap = | 47 using ElementToAnimationsMap = |
48 std::unordered_map<ElementId, | 48 std::unordered_map<ElementId, scoped_refptr<ElementAnimations>>; |
49 scoped_refptr<ElementAnimations>, | |
50 ElementIdHash>; | |
51 | 49 |
52 static std::unique_ptr<AnimationHost> Create(ThreadInstance thread_instance); | 50 static std::unique_ptr<AnimationHost> Create(ThreadInstance thread_instance); |
53 ~AnimationHost(); | 51 ~AnimationHost(); |
54 | 52 |
55 void AddAnimationTimeline(scoped_refptr<AnimationTimeline> timeline); | 53 void AddAnimationTimeline(scoped_refptr<AnimationTimeline> timeline); |
56 void RemoveAnimationTimeline(scoped_refptr<AnimationTimeline> timeline); | 54 void RemoveAnimationTimeline(scoped_refptr<AnimationTimeline> timeline); |
57 AnimationTimeline* GetTimelineById(int timeline_id) const; | 55 AnimationTimeline* GetTimelineById(int timeline_id) const; |
58 | 56 |
59 void ClearTimelines(); | 57 void ClearTimelines(); |
60 | 58 |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 | 195 |
198 bool supports_scroll_animations_; | 196 bool supports_scroll_animations_; |
199 bool animation_waiting_for_deletion_; | 197 bool animation_waiting_for_deletion_; |
200 | 198 |
201 DISALLOW_COPY_AND_ASSIGN(AnimationHost); | 199 DISALLOW_COPY_AND_ASSIGN(AnimationHost); |
202 }; | 200 }; |
203 | 201 |
204 } // namespace cc | 202 } // namespace cc |
205 | 203 |
206 #endif // CC_ANIMATION_ANIMATION_HOST_H_ | 204 #endif // CC_ANIMATION_ANIMATION_HOST_H_ |
OLD | NEW |