Index: cc/trees/layer_tree_impl.cc |
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc |
index b5f8aed2307ba159c5c091f123706c768324942f..287317c65623119971a027714fc38c44e353953a 100644 |
--- a/cc/trees/layer_tree_impl.cc |
+++ b/cc/trees/layer_tree_impl.cc |
@@ -10,6 +10,7 @@ |
#include "base/trace_event/trace_event.h" |
#include "base/trace_event/trace_event_argument.h" |
+#include "cc/animation/animation_host.h" |
#include "cc/animation/keyframed_animation_curve.h" |
#include "cc/animation/scrollbar_animation_controller.h" |
#include "cc/animation/scrollbar_animation_controller_linear_fade.h" |
@@ -726,18 +727,24 @@ gfx::Size LayerTreeImpl::ScrollableSize() const { |
return root_scroll_layer->children()[0]->bounds(); |
} |
-LayerImpl* LayerTreeImpl::LayerById(int id) { |
- LayerIdMap::iterator iter = layer_id_map_.find(id); |
+LayerImpl* LayerTreeImpl::LayerById(int id) const { |
+ LayerIdMap::const_iterator iter = layer_id_map_.find(id); |
return iter != layer_id_map_.end() ? iter->second : NULL; |
} |
void LayerTreeImpl::RegisterLayer(LayerImpl* layer) { |
DCHECK(!LayerById(layer->id())); |
layer_id_map_[layer->id()] = layer; |
+ if (layer_tree_host_impl_->animation_host()) |
+ layer_tree_host_impl_->animation_host()->RegisterLayerImpl(layer->id(), |
+ IsActiveTree()); |
} |
void LayerTreeImpl::UnregisterLayer(LayerImpl* layer) { |
DCHECK(LayerById(layer->id())); |
+ if (layer_tree_host_impl_->animation_host()) |
+ layer_tree_host_impl_->animation_host()->UnregisterLayerImpl( |
+ layer->id(), IsActiveTree()); |
layer_id_map_.erase(layer->id()); |
} |