Index: cc/layers/layer.cc |
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc |
index af3fc67471c847f0d6fbaf5dadc00d0838b983e5..4f799b8ce0b0d3a87be19069fcb0fa0410cf961f 100644 |
--- a/cc/layers/layer.cc |
+++ b/cc/layers/layer.cc |
@@ -132,6 +132,11 @@ void Layer::SetLayerTreeHost(LayerTreeHost* host) { |
if (layer_tree_host_) |
layer_tree_host_->property_trees()->needs_rebuild = true; |
+ if (host) |
+ host->property_trees()->needs_rebuild = true; |
+ |
+ InvalidatePropertyTreesIndices(); |
Ian Vollick
2015/06/09 00:18:51
Is there a chance that we're detaching/attaching a
|
+ |
layer_tree_host_ = host; |
// When changing hosts, the layer needs to commit its properties to the impl |
@@ -1053,6 +1058,13 @@ int Layer::opacity_tree_index() const { |
return opacity_tree_index_; |
} |
+void Layer::InvalidatePropertyTreesIndices() { |
+ int invalid_property_tree_index = -1; |
+ SetTransformTreeIndex(invalid_property_tree_index); |
+ SetClipTreeIndex(invalid_property_tree_index); |
+ SetOpacityTreeIndex(invalid_property_tree_index); |
+} |
+ |
void Layer::SetShouldFlattenTransform(bool should_flatten) { |
DCHECK(IsPropertyChangeAllowed()); |
if (should_flatten_transform_ == should_flatten) |