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 #include <vector> | 10 #include <vector> |
(...skipping 29 matching lines...) Expand all Loading... | |
40 // There is just one AnimationHost for LayerTreeHost on main renderer thread | 40 // There is just one AnimationHost for LayerTreeHost on main renderer thread |
41 // and just one AnimationHost for LayerTreeHostImpl on impl thread. | 41 // and just one AnimationHost for LayerTreeHostImpl on impl thread. |
42 // We synchronize them during the commit process in a one-way data flow process | 42 // We synchronize them during the commit process in a one-way data flow process |
43 // (PushPropertiesTo). | 43 // (PushPropertiesTo). |
44 // An AnimationHost talks to its correspondent LayerTreeHost via | 44 // An AnimationHost talks to its correspondent LayerTreeHost via |
45 // MutatorHostClient interface. | 45 // MutatorHostClient interface. |
46 class CC_ANIMATION_EXPORT AnimationHost | 46 class CC_ANIMATION_EXPORT AnimationHost |
47 : public NON_EXPORTED_BASE(MutatorHost) { | 47 : public NON_EXPORTED_BASE(MutatorHost) { |
48 public: | 48 public: |
49 using ElementToAnimationsMap = | 49 using ElementToAnimationsMap = |
50 std::unordered_map<ElementId, | 50 std::unordered_map<ElementId::Id, scoped_refptr<ElementAnimations>>; |
wkorman
2017/05/08 18:23:24
My personal preference given our shift to support
| |
51 scoped_refptr<ElementAnimations>, | |
52 ElementIdHash>; | |
53 using PlayersList = std::vector<scoped_refptr<AnimationPlayer>>; | 51 using PlayersList = std::vector<scoped_refptr<AnimationPlayer>>; |
54 | 52 |
55 static std::unique_ptr<AnimationHost> CreateMainInstance(); | 53 static std::unique_ptr<AnimationHost> CreateMainInstance(); |
56 static std::unique_ptr<AnimationHost> CreateForTesting( | 54 static std::unique_ptr<AnimationHost> CreateForTesting( |
57 ThreadInstance thread_instance); | 55 ThreadInstance thread_instance); |
58 ~AnimationHost() override; | 56 ~AnimationHost() override; |
59 | 57 |
60 void AddAnimationTimeline(scoped_refptr<AnimationTimeline> timeline); | 58 void AddAnimationTimeline(scoped_refptr<AnimationTimeline> timeline); |
61 void RemoveAnimationTimeline(scoped_refptr<AnimationTimeline> timeline); | 59 void RemoveAnimationTimeline(scoped_refptr<AnimationTimeline> timeline); |
62 AnimationTimeline* GetTimelineById(int timeline_id) const; | 60 AnimationTimeline* GetTimelineById(int timeline_id) const; |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
208 | 206 |
209 bool supports_scroll_animations_; | 207 bool supports_scroll_animations_; |
210 bool needs_push_properties_; | 208 bool needs_push_properties_; |
211 | 209 |
212 DISALLOW_COPY_AND_ASSIGN(AnimationHost); | 210 DISALLOW_COPY_AND_ASSIGN(AnimationHost); |
213 }; | 211 }; |
214 | 212 |
215 } // namespace cc | 213 } // namespace cc |
216 | 214 |
217 #endif // CC_ANIMATION_ANIMATION_HOST_H_ | 215 #endif // CC_ANIMATION_ANIMATION_HOST_H_ |
OLD | NEW |