Index: cc/layers/layer.cc |
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc |
index 4d03f565efefc9ba936722715815d3f6f67e4bbd..fc7d0da5fb76fe249c2993df59b9c75885e041d3 100644 |
--- a/cc/layers/layer.cc |
+++ b/cc/layers/layer.cc |
@@ -117,10 +117,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. |