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

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

Issue 947033002: CC Animations: Establish AnimationHost, AnimationTimeline and AnimationPlayer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Set up impl-only timelines for ScrollOffset animations Created 5 years, 8 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.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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CC_ANIMATION_ANIMATION_TIMELINE_H_
6 #define CC_ANIMATION_ANIMATION_TIMELINE_H_
7
8 #include <vector>
9
10 #include "base/containers/hash_tables.h"
11 #include "base/memory/ref_counted.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "cc/base/cc_export.h"
14
15 namespace cc {
16
17 class AnimationHost;
18 class AnimationPlayer;
19
20 typedef std::vector<scoped_refptr<AnimationPlayer>> AnimationPlayerList;
21
22 class CC_EXPORT AnimationTimeline : public base::RefCounted<AnimationTimeline> {
23 public:
24 static scoped_refptr<AnimationTimeline> Create(int id);
25 scoped_refptr<AnimationTimeline> CreateImplInstance() const;
26
27 int id() const { return id_; }
28
29 AnimationHost* animation_host() { return animation_host_; }
30 const AnimationHost* animation_host() const { return animation_host_; }
31 void SetAnimationHost(AnimationHost* animation_host);
32
33 void set_is_impl_only(bool is_impl_only) { is_impl_only_ = is_impl_only; }
34 bool is_impl_only() const { return is_impl_only_; }
35
36 void AttachPlayer(AnimationPlayer* player);
37 void DetachPlayer(AnimationPlayer* player);
38
39 void ClearPlayers();
40
41 void PushPropertiesTo(AnimationTimeline* timeline_impl);
42
43 private:
44 friend class base::RefCounted<AnimationTimeline>;
45
46 explicit AnimationTimeline(int id);
47 virtual ~AnimationTimeline();
48
49 AnimationPlayer* GetPlayerById(int player_id) const;
50
51 void PushAttachedPlayersToImplThread(AnimationTimeline* timeline) const;
52 void RemoveDetachedPlayersFromImplThread(AnimationTimeline* timeline) const;
53 void PushPropertiesToImplThread(AnimationTimeline* timeline);
54
55 void ErasePlayers(AnimationPlayerList::iterator begin,
56 AnimationPlayerList::iterator end);
57
58 AnimationPlayerList players_;
59 int id_;
60 AnimationHost* animation_host_;
61 bool is_impl_only_;
62
63 DISALLOW_COPY_AND_ASSIGN(AnimationTimeline);
64 };
65
66 } // namespace cc
67
68 #endif // CC_ANIMATION_ANIMATION_TIMELINE_H_
OLDNEW
« no previous file with comments | « cc/animation/animation_player.cc ('k') | cc/animation/animation_timeline.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698