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> CreateMainInstance(); | 52 static std::unique_ptr<AnimationHost> CreateMainInstance(); |
51 static std::unique_ptr<AnimationHost> CreateForTesting( | 53 static std::unique_ptr<AnimationHost> CreateForTesting( |
52 ThreadInstance thread_instance); | 54 ThreadInstance thread_instance); |
53 std::unique_ptr<AnimationHost> CreateImplInstance( | 55 std::unique_ptr<AnimationHost> CreateImplInstance( |
54 bool supports_impl_scrolling) const; | 56 bool supports_impl_scrolling) const; |
55 ~AnimationHost(); | 57 ~AnimationHost(); |
56 | 58 |
57 void AddAnimationTimeline(scoped_refptr<AnimationTimeline> timeline); | 59 void AddAnimationTimeline(scoped_refptr<AnimationTimeline> timeline); |
58 void RemoveAnimationTimeline(scoped_refptr<AnimationTimeline> timeline); | 60 void RemoveAnimationTimeline(scoped_refptr<AnimationTimeline> timeline); |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 | 201 |
200 bool supports_scroll_animations_; | 202 bool supports_scroll_animations_; |
201 bool animation_waiting_for_deletion_; | 203 bool animation_waiting_for_deletion_; |
202 | 204 |
203 DISALLOW_COPY_AND_ASSIGN(AnimationHost); | 205 DISALLOW_COPY_AND_ASSIGN(AnimationHost); |
204 }; | 206 }; |
205 | 207 |
206 } // namespace cc | 208 } // namespace cc |
207 | 209 |
208 #endif // CC_ANIMATION_ANIMATION_HOST_H_ | 210 #endif // CC_ANIMATION_ANIMATION_HOST_H_ |
OLD | NEW |