Index: cc/layers/layer.cc |
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc |
index 56b8c739e4f24004b59bf8a138f3cd3606cb7bf9..8f29f22bce285716a9b3806cf0e85b32757b3a48 100644 |
--- a/cc/layers/layer.cc |
+++ b/cc/layers/layer.cc |
@@ -118,10 +118,13 @@ void Layer::SetLayerTreeHost(LayerTreeHost* host) { |
if (layer_tree_host_ == host) |
return; |
- if (layer_tree_host_) |
+ if (layer_tree_host_) { |
layer_tree_host_->property_trees()->needs_rebuild = true; |
- |
+ layer_tree_host_->UnregisterLayer(this); |
+ } |
layer_tree_host_ = host; |
+ if (layer_tree_host_) |
+ layer_tree_host_->RegisterLayer(this); |
// When changing hosts, the layer needs to commit its properties to the impl |
// side for the new host. |