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

Unified 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: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: cc/animation/animation_timeline.h
diff --git a/cc/animation/animation_timeline.h b/cc/animation/animation_timeline.h
new file mode 100644
index 0000000000000000000000000000000000000000..79c27f9a93959e49fb3287da57f7819d9fc783f6
--- /dev/null
+++ b/cc/animation/animation_timeline.h
@@ -0,0 +1,57 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CC_ANIMATION_ANIMATION_TIMELINE_H_
+#define CC_ANIMATION_ANIMATION_TIMELINE_H_
+
+#include <vector>
+
+#include "base/memory/ref_counted.h"
+#include "cc/base/cc_export.h"
+
+namespace cc {
+
+class AnimationPlayer;
+class LayerTreeHost;
+class LayerTreeMutatorsClient;
+
+typedef std::vector<scoped_refptr<AnimationPlayer>> AnimationPlayerList;
+
+class CC_EXPORT AnimationTimeline : public base::RefCounted<AnimationTimeline> {
+ public:
+ static scoped_refptr<AnimationTimeline> Create();
+
+ void AttachPlayer(AnimationPlayer* player);
+ void DetachPlayer(AnimationPlayer* player);
+ AnimationPlayer* GetPlayerById(int player_id) const;
+
+ LayerTreeMutatorsClient* layer_tree_mutators_client() {
+ return layer_tree_mutators_client_;
+ }
+ const LayerTreeMutatorsClient* layer_tree_mutators_client() const {
+ return layer_tree_mutators_client_;
+ }
+ void SetLayerTreeMutatorsClient(LayerTreeMutatorsClient* client);
+
+ void PushPropertiesTo(AnimationTimeline* timeline_impl);
+
+ private:
+ friend class base::RefCounted<AnimationTimeline>;
+
+ AnimationTimeline();
+ virtual ~AnimationTimeline();
+
+ void PushAttachedPlayersToImplThread(AnimationTimeline* timeline) const;
+ void RemoveDetachedPlayersFromImplThread(AnimationTimeline* timeline) const;
+ void PushPropertiesToImplThread(AnimationTimeline* timeline);
+
+ AnimationPlayerList players_;
+ LayerTreeMutatorsClient* layer_tree_mutators_client_;
+
+ DISALLOW_COPY_AND_ASSIGN(AnimationTimeline);
+};
+
+} // namespace cc
+
+#endif // CC_ANIMATION_ANIMATION_TIMELINE_H_

Powered by Google App Engine
This is Rietveld 408576698