Index: cc/trees/layer_tree_host.h |
diff --git a/cc/trees/layer_tree_host.h b/cc/trees/layer_tree_host.h |
index ef5cb6acdc2b1d2712515356ee9a820bef55f872..edec6725e7cf5fb9d1dde3ae28a686de576dff77 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 "cc/trees/swap_promise_monitor.h" |
@@ -48,6 +49,7 @@ class GpuMemoryBufferManager; |
namespace cc { |
class AnimationRegistrar; |
+class AnimationHost; |
class BeginFrameSource; |
class HeadsUpDisplayLayer; |
class Layer; |
@@ -69,7 +71,7 @@ struct RenderingStats; |
struct ScrollAndScaleSet; |
enum class GpuRasterizationStatus; |
-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( |
@@ -257,6 +259,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_; } |
@@ -308,6 +311,27 @@ class CC_EXPORT LayerTreeHost { |
void SetAuthoritativeVSyncInterval(const base::TimeDelta& interval); |
+ Layer* LayerById(int id) const; |
+ void RegisterLayer(Layer* layer); |
+ void UnregisterLayer(Layer* layer); |
+ // LayerTreeMutatorsClient implementation. |
+ bool IsLayerInActiveTree(int layer_id) const override; |
+ bool IsLayerInPendingTree(int layer_id) 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; |
+ void SetLayerScrollOffsetMutated( |
+ int layer_id, |
+ bool active_tree, |
+ const gfx::ScrollOffset& scroll_offset) override; |
+ |
protected: |
LayerTreeHost(LayerTreeHostClient* client, |
SharedBitmapManager* shared_bitmap_manager, |
@@ -424,6 +448,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_; |
@@ -451,6 +476,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_; |