Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(206)

Side by Side Diff: cc/animation/animation_timeline.h

Issue 2261113002: CC Animation: Introduce some dirty flags to optimize PushProperties on commit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Do not change SetNeedsCommit invalidation, leave it as-is. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/animation/animation_player_unittest.cc ('k') | cc/animation/animation_timeline.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « cc/animation/animation_player_unittest.cc ('k') | cc/animation/animation_timeline.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698