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

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: ElementAnimations. MutatorHostClient. cc/public. Animation timelines test common. Created 5 years, 6 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 449d8e4e09a0f614e44ead23cf8677e65fa2dedb..907643d4bdbd1df5dc11f84fded6883fd30199f3 100644
--- a/cc/trees/layer_tree_host.h
+++ b/cc/trees/layer_tree_host.h
@@ -32,6 +32,7 @@
#include "cc/output/output_surface.h"
#include "cc/output/renderer_capabilities.h"
#include "cc/output/swap_promise.h"
+#include "cc/public/mutator_host_client.h"
#include "cc/resources/resource_format.h"
#include "cc/resources/scoped_ui_resource.h"
#include "cc/surfaces/surface_sequence.h"
@@ -49,6 +50,7 @@ class GpuMemoryBufferManager;
namespace cc {
class AnimationRegistrar;
+class AnimationHost;
class BeginFrameSource;
class HeadsUpDisplayLayer;
class Layer;
@@ -70,7 +72,7 @@ struct PendingPageScaleAnimation;
struct RenderingStats;
struct ScrollAndScaleSet;
-class CC_EXPORT LayerTreeHost {
+class CC_EXPORT LayerTreeHost : public MutatorHostClient {
public:
// TODO(sad): InitParams should be a movable type so that it can be
// std::move()d to the Create* functions.
@@ -268,6 +270,7 @@ class CC_EXPORT LayerTreeHost {
AnimationRegistrar* animation_registrar() const {
return animation_registrar_.get();
}
+ AnimationHost* animation_host() const { return animation_host_.get(); }
bool in_paint_layer_contents() const { return in_paint_layer_contents_; }
@@ -334,6 +337,26 @@ class CC_EXPORT LayerTreeHost {
scoped_ptr<FrameTimingTracker::CompositeTimingSet> composite_events,
scoped_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events);
+ Layer* LayerById(int id) const;
+ void RegisterLayer(Layer* layer);
+ void UnregisterLayer(Layer* layer);
+ // LayerTreeMutatorsClient implementation.
+ bool IsLayerInTree(int layer_id, LayerTreeType tree_type) const override;
+ void SetMutatorsNeedCommit() override;
+ void SetLayerFilterMutated(int layer_id,
+ LayerTreeType tree_type,
+ const FilterOperations& filters) override;
+ void SetLayerOpacityMutated(int layer_id,
+ LayerTreeType tree_type,
+ float opacity) override;
+ void SetLayerTransformMutated(int layer_id,
+ LayerTreeType tree_type,
+ const gfx::Transform& transform) override;
+ void SetLayerScrollOffsetMutated(
+ int layer_id,
+ LayerTreeType tree_type,
+ const gfx::ScrollOffset& scroll_offset) override;
+
protected:
explicit LayerTreeHost(InitParams* params);
void InitializeThreaded(
@@ -459,6 +482,7 @@ class CC_EXPORT LayerTreeHost {
size_t partial_texture_update_requests_;
scoped_ptr<AnimationRegistrar> animation_registrar_;
+ scoped_ptr<AnimationHost> animation_host_;
scoped_ptr<PendingPageScaleAnimation> pending_page_scale_animation_;
@@ -487,6 +511,9 @@ class CC_EXPORT LayerTreeHost {
PropertyTrees property_trees_;
+ 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