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_TIMELINE_H_ | 5 #ifndef CC_ANIMATION_ANIMATION_TIMELINE_H_ |
6 #define CC_ANIMATION_ANIMATION_TIMELINE_H_ | 6 #define CC_ANIMATION_ANIMATION_TIMELINE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <unordered_map> | 9 #include <unordered_map> |
10 | 10 |
(...skipping 28 matching lines...) Expand all Loading... |
39 | 39 |
40 void AttachPlayer(scoped_refptr<AnimationPlayer> player); | 40 void AttachPlayer(scoped_refptr<AnimationPlayer> player); |
41 void DetachPlayer(scoped_refptr<AnimationPlayer> player); | 41 void DetachPlayer(scoped_refptr<AnimationPlayer> player); |
42 | 42 |
43 void ClearPlayers(); | 43 void ClearPlayers(); |
44 | 44 |
45 void PushPropertiesTo(AnimationTimeline* timeline_impl); | 45 void PushPropertiesTo(AnimationTimeline* timeline_impl); |
46 | 46 |
47 AnimationPlayer* GetPlayerById(int player_id) const; | 47 AnimationPlayer* GetPlayerById(int player_id) const; |
48 | 48 |
| 49 void SetNeedsPushProperties(); |
| 50 bool needs_push_properties() const { return needs_push_properties_; } |
| 51 |
49 private: | 52 private: |
50 friend class base::RefCounted<AnimationTimeline>; | 53 friend class base::RefCounted<AnimationTimeline>; |
51 | 54 |
52 explicit AnimationTimeline(int id); | 55 explicit AnimationTimeline(int id); |
53 virtual ~AnimationTimeline(); | 56 virtual ~AnimationTimeline(); |
54 | 57 |
55 void PushAttachedPlayersToImplThread(AnimationTimeline* timeline) const; | 58 void PushAttachedPlayersToImplThread(AnimationTimeline* timeline) const; |
56 void RemoveDetachedPlayersFromImplThread(AnimationTimeline* timeline) const; | 59 void RemoveDetachedPlayersFromImplThread(AnimationTimeline* timeline) const; |
57 void PushPropertiesToImplThread(AnimationTimeline* timeline); | 60 void PushPropertiesToImplThread(AnimationTimeline* timeline); |
58 | 61 |
59 void ErasePlayer(scoped_refptr<AnimationPlayer> player); | 62 void ErasePlayer(scoped_refptr<AnimationPlayer> player); |
60 | 63 |
61 // A list of all players which this timeline owns. | 64 // A list of all players which this timeline owns. |
62 using IdToPlayerMap = std::unordered_map<int, scoped_refptr<AnimationPlayer>>; | 65 using IdToPlayerMap = std::unordered_map<int, scoped_refptr<AnimationPlayer>>; |
63 IdToPlayerMap id_to_player_map_; | 66 IdToPlayerMap id_to_player_map_; |
64 | 67 |
65 int id_; | 68 int id_; |
66 AnimationHost* animation_host_; | 69 AnimationHost* animation_host_; |
| 70 bool needs_push_properties_; |
67 | 71 |
68 // Impl-only AnimationTimeline has no main thread instance and lives on | 72 // Impl-only AnimationTimeline has no main thread instance and lives on |
69 // it's own. | 73 // it's own. |
70 bool is_impl_only_; | 74 bool is_impl_only_; |
71 | 75 |
72 DISALLOW_COPY_AND_ASSIGN(AnimationTimeline); | 76 DISALLOW_COPY_AND_ASSIGN(AnimationTimeline); |
73 }; | 77 }; |
74 | 78 |
75 } // namespace cc | 79 } // namespace cc |
76 | 80 |
77 #endif // CC_ANIMATION_ANIMATION_TIMELINE_H_ | 81 #endif // CC_ANIMATION_ANIMATION_TIMELINE_H_ |
OLD | NEW |