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, scoped_refptr<ElementAnimations>>; | 48 std::unordered_map<ElementId, |
| 49 scoped_refptr<ElementAnimations>, |
| 50 ElementIdHash>; |
49 | 51 |
50 static std::unique_ptr<AnimationHost> Create(ThreadInstance thread_instance); | 52 static std::unique_ptr<AnimationHost> Create(ThreadInstance thread_instance); |
51 ~AnimationHost(); | 53 ~AnimationHost(); |
52 | 54 |
53 void AddAnimationTimeline(scoped_refptr<AnimationTimeline> timeline); | 55 void AddAnimationTimeline(scoped_refptr<AnimationTimeline> timeline); |
54 void RemoveAnimationTimeline(scoped_refptr<AnimationTimeline> timeline); | 56 void RemoveAnimationTimeline(scoped_refptr<AnimationTimeline> timeline); |
55 AnimationTimeline* GetTimelineById(int timeline_id) const; | 57 AnimationTimeline* GetTimelineById(int timeline_id) const; |
56 | 58 |
57 void ClearTimelines(); | 59 void ClearTimelines(); |
58 | 60 |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 | 197 |
196 bool supports_scroll_animations_; | 198 bool supports_scroll_animations_; |
197 bool animation_waiting_for_deletion_; | 199 bool animation_waiting_for_deletion_; |
198 | 200 |
199 DISALLOW_COPY_AND_ASSIGN(AnimationHost); | 201 DISALLOW_COPY_AND_ASSIGN(AnimationHost); |
200 }; | 202 }; |
201 | 203 |
202 } // namespace cc | 204 } // namespace cc |
203 | 205 |
204 #endif // CC_ANIMATION_ANIMATION_HOST_H_ | 206 #endif // CC_ANIMATION_ANIMATION_HOST_H_ |
OLD | NEW |