Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10112)

Unified Diff: cc/layers/layer.cc

Issue 1166233002: Rebuild PropertyTrees When Layer Attach to New LayerTreeHost (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@implon
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/layers/layer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « cc/layers/layer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698