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

Unified Diff: cc/trees/layer_tree_host.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/trees/layer_tree_host.h
diff --git a/cc/trees/layer_tree_host.h b/cc/trees/layer_tree_host.h
index b17b5a4c4a77e2f3f943920bd30e68c95a880bbe..293da3f1b5171f1a22bb8a0e366979436c3da44b 100644
--- a/cc/trees/layer_tree_host.h
+++ b/cc/trees/layer_tree_host.h
@@ -36,6 +36,7 @@
#include "cc/surfaces/surface_sequence.h"
#include "cc/trees/layer_tree_host_client.h"
#include "cc/trees/layer_tree_host_common.h"
+#include "cc/trees/layer_tree_mutators_client.h"
#include "cc/trees/layer_tree_settings.h"
#include "cc/trees/proxy.h"
#include "third_party/skia/include/core/SkColor.h"
@@ -47,6 +48,7 @@ class GpuMemoryBufferManager;
namespace cc {
class AnimationRegistrar;
+class AnimationTimeline;
class BeginFrameSource;
class HeadsUpDisplayLayer;
class Layer;
@@ -85,7 +87,7 @@ struct CC_EXPORT RendererCapabilities {
bool using_shared_memory_resources;
};
-class CC_EXPORT LayerTreeHost {
+class CC_EXPORT LayerTreeHost : public LayerTreeMutatorsClient {
public:
// The SharedBitmapManager will be used on the compositor thread.
static scoped_ptr<LayerTreeHost> CreateThreaded(
@@ -175,6 +177,7 @@ class CC_EXPORT LayerTreeHost {
void SetNextCommitForcesRedraw();
void SetAnimationEvents(scoped_ptr<AnimationEventsVector> events);
+ void SetAnimationTimeline(scoped_refptr<AnimationTimeline> timeline);
void SetRootLayer(scoped_refptr<Layer> root_layer);
Layer* root_layer() { return root_layer_.get(); }
@@ -271,6 +274,9 @@ class CC_EXPORT LayerTreeHost {
AnimationRegistrar* animation_registrar() const {
return animation_registrar_.get();
}
+ AnimationTimeline* animation_timeline() const {
+ return animation_timeline_.get();
+ }
// Obtains a thorough dump of the LayerTreeHost as a value.
void AsValueInto(base::trace_event::TracedValue* value) const;
@@ -323,6 +329,22 @@ class CC_EXPORT LayerTreeHost {
void SetChildrenNeedBeginFrames(bool children_need_begin_frames) const;
void SendBeginFramesToChildren(const BeginFrameArgs& args) const;
+ Layer* LayerById(int id) const;
+ void RegisterLayer(Layer* layer);
+ void UnregisterLayer(Layer* layer);
+ // LayerTreeMutatorsClient implementation.
+ AnimationRegistrar* GetAnimationRegistrar() const override;
+ void SetMutatorsNeedCommit() override;
+ void SetLayerFilterMutated(int layer_id,
+ bool active_tree,
+ const FilterOperations& filters) override;
+ void SetLayerOpacityMutated(int layer_id,
+ bool active_tree,
+ float opacity) override;
+ void SetLayerTransformMutated(int layer_id,
+ bool active_tree,
+ const gfx::Transform& transform) override;
+
protected:
LayerTreeHost(LayerTreeHostClient* client,
SharedBitmapManager* shared_bitmap_manager,
@@ -438,6 +460,7 @@ class CC_EXPORT LayerTreeHost {
size_t partial_texture_update_requests_;
scoped_ptr<AnimationRegistrar> animation_registrar_;
+ scoped_refptr<AnimationTimeline> animation_timeline_;
scoped_ptr<PendingPageScaleAnimation> pending_page_scale_animation_;
@@ -478,6 +501,9 @@ class CC_EXPORT LayerTreeHost {
ScopedPtrVector<SwapPromise> swap_promise_list_;
std::set<SwapPromiseMonitor*> swap_promise_monitor_;
+ typedef base::hash_map<int, Layer*> LayerIdMap;
+ LayerIdMap layer_id_map_;
+
uint32_t surface_id_namespace_;
uint32_t next_surface_sequence_;

Powered by Google App Engine
This is Rietveld 408576698