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

Unified Diff: cc/layers/layer_impl.cc

Issue 1547893003: WIP - compositor worker mega patch. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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.cc ('k') | cc/layers/layer_unittest.cc » ('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 3837bca46148ae930f6d84a0381c0e4766388fcb..a8257c8f183f2c51e7888d70b9cc3d291958da2a 100644
--- a/cc/layers/layer_impl.cc
+++ b/cc/layers/layer_impl.cc
@@ -132,6 +132,9 @@ LayerImpl::~LayerImpl() {
layer_tree_impl_->UnregisterScrollLayer(this);
layer_tree_impl_->UnregisterLayer(this);
+ if (element_id_)
+ layer_tree_impl_->RemoveFromElementMap(this);
+
TRACE_EVENT_OBJECT_DELETED_WITH_ID(
TRACE_DISABLED_BY_DEFAULT("cc.debug"), "cc::LayerImpl", this);
}
@@ -1242,7 +1245,11 @@ void LayerImpl::SetElementId(uint64_t element_id) {
TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("compositor-worker"),
"LayerImpl::SetElementId", "id", element_id);
+ if (element_id_)
+ layer_tree_impl_->RemoveFromElementMap(this);
element_id_ = element_id;
+ if (element_id_)
+ layer_tree_impl_->AddToElementMap(this);
SetNeedsPushProperties();
}
@@ -1254,6 +1261,8 @@ void LayerImpl::SetMutableProperties(uint32_t properties) {
"LayerImpl::SetMutableProperties", "properties", properties);
mutable_properties_ = properties;
+ if (element_id_)
+ layer_tree_impl_->AddToElementMap(this);
SetNeedsPushProperties();
}
@@ -1545,6 +1554,11 @@ void LayerImpl::UpdatePropertyTreeScrollOffset() {
}
void LayerImpl::DidUpdateScrollOffset() {
+ TRACE_EVENT2("compositor-worker,scroll-compensation",
+ "LayerImpl::DidUpdateScrollOffset", "x",
+ scroll_offset_->Current(IsActive()).x(), "y",
+ scroll_offset_->Current(IsActive()).y());
+
DCHECK(scroll_offset_);
layer_tree_impl()->DidUpdateScrollState(id());
« no previous file with comments | « cc/layers/layer.cc ('k') | cc/layers/layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698