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

Unified Diff: cc/layers/layer.cc

Issue 1217883002: Rebuild PropertyTrees When Layer Attach to New LayerTreeHost (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2403
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 5c2d6a8643dfdda6968d0cfe7cbeb1f1aa895c6e..9a10f5d55bec2e61c7d70ad27e22bda8b4d16d35 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -124,6 +124,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();
+
layer_tree_host_ = host;
// When changing hosts, the layer needs to commit its properties to the impl
@@ -1039,6 +1044,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