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

Unified Diff: cc/layers/layer_impl.cc

Issue 1447893002: compositor-worker: Introduce WebCompositorMutableState (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review feedback. Created 4 years, 11 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/blink/web_compositor_mutable_state_provider_impl.cc ('k') | cc/trees/layer_tree_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer_impl.cc
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc
index f36215dc0012e36cc14bd99ab63a3f1b36046cd0..93d45a95fac951239bd20fcdab35feecfb040427 100644
--- a/cc/layers/layer_impl.cc
+++ b/cc/layers/layer_impl.cc
@@ -115,6 +115,9 @@ LayerImpl::LayerImpl(LayerTreeImpl* tree_impl,
layer_animation_controller_->set_layer_animation_delegate(this);
}
}
+
+ layer_tree_impl_->AddToElementMap(this);
+
SetNeedsPushProperties();
}
@@ -132,6 +135,8 @@ LayerImpl::~LayerImpl() {
layer_tree_impl_->UnregisterScrollLayer(this);
layer_tree_impl_->UnregisterLayer(this);
+ layer_tree_impl_->RemoveFromElementMap(this);
+
TRACE_EVENT_OBJECT_DELETED_WITH_ID(
TRACE_DISABLED_BY_DEFAULT("cc.debug"), "cc::LayerImpl", this);
}
@@ -1249,7 +1254,9 @@ void LayerImpl::SetElementId(uint64_t element_id) {
TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("compositor-worker"),
"LayerImpl::SetElementId", "id", element_id);
+ layer_tree_impl_->RemoveFromElementMap(this);
element_id_ = element_id;
+ layer_tree_impl_->AddToElementMap(this);
SetNeedsPushProperties();
}
@@ -1261,6 +1268,8 @@ void LayerImpl::SetMutableProperties(uint32_t properties) {
"LayerImpl::SetMutableProperties", "properties", properties);
mutable_properties_ = properties;
+ // If this layer is already in the element map, update its properties.
+ layer_tree_impl_->AddToElementMap(this);
SetNeedsPushProperties();
}
« no previous file with comments | « cc/blink/web_compositor_mutable_state_provider_impl.cc ('k') | cc/trees/layer_tree_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698