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

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: Remove kEnableNewCompositorAnimations. Created 5 years, 9 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..1ffaa87a272b208f7212a884686ab548ee28f1f6
--- /dev/null
+++ b/cc/animation/animation_timeline.h
@@ -0,0 +1,69 @@
+// 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/containers/hash_tables.h"
+#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;
+
+ void RegisterLayerImpl(int layer_id, bool is_active_tree);
+ void UnregisterLayerImpl(int layer_id, bool is_active_tree);
+
+ void RegisterPlayerForLayer(int layer_id, AnimationPlayer* player);
+ void UnregisterPlayerForLayer(int layer_id, AnimationPlayer* player);
+
+ 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>;
+
+ typedef base::hash_map<int, AnimationPlayer*> LayerToPlayerMap;
+ LayerToPlayerMap layer_to_player_map_;
+
+ AnimationTimeline();
+ virtual ~AnimationTimeline();
+
+ void PushAttachedPlayersToImplThread(AnimationTimeline* timeline) const;
+ void RemoveDetachedPlayersFromImplThread(AnimationTimeline* timeline) const;
+ void PushPropertiesToImplThread(AnimationTimeline* timeline);
+
+ AnimationPlayer* GetPlayerForLayerId(int layer_id) const;
+
+ 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