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

Unified Diff: cc/layers/layer_impl.cc

Issue 1973083002: Use element id's for animations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 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_impl.h ('k') | cc/layers/layer_impl_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 18562bc1c19fbc0da298083cf3ad6adbe1595510..1ad29f0a51f300aed28b34fbe6e220075691ab15 100644
--- a/cc/layers/layer_impl.cc
+++ b/cc/layers/layer_impl.cc
@@ -72,7 +72,6 @@ LayerImpl::LayerImpl(LayerTreeImpl* tree_impl, int id)
scroll_tree_index_(-1),
sorting_context_id_(0),
current_draw_mode_(DRAW_MODE_NONE),
- element_id_(0),
mutable_properties_(MutableProperty::kNone),
debug_info_(nullptr),
scrolls_drawn_descendant_(false),
@@ -815,16 +814,19 @@ bool LayerImpl::HasPotentiallyRunningOpacityAnimation() const {
return layer_tree_impl_->HasPotentiallyRunningOpacityAnimation(this);
}
-void LayerImpl::SetElementId(uint64_t element_id) {
+void LayerImpl::SetElementId(ElementId element_id) {
if (element_id == element_id_)
return;
TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("compositor-worker"),
- "LayerImpl::SetElementId", "id", element_id);
+ "LayerImpl::SetElementId", "element",
+ element_id.AsValue().release());
layer_tree_impl_->RemoveFromElementMap(this);
element_id_ = element_id;
layer_tree_impl_->AddToElementMap(this);
+
+ SetNeedsPushProperties();
}
void LayerImpl::SetMutableProperties(uint32_t properties) {
@@ -1004,10 +1006,11 @@ void LayerImpl::AsValueInto(base::trace_event::TracedValue* state) const {
state->SetInteger("gpu_memory_usage",
base::saturated_cast<int>(GPUMemoryUsageInBytes()));
- if (mutable_properties_ != MutableProperty::kNone) {
- state->SetInteger("element_id", base::saturated_cast<int>(element_id_));
+ if (element_id_)
+ element_id_.AddToTracedValue(state);
+
+ if (mutable_properties_ != MutableProperty::kNone)
state->SetInteger("mutable_properties", mutable_properties_);
- }
MathUtil::AddToTracedValue("scroll_offset", CurrentScrollOffset(), state);
« no previous file with comments | « cc/layers/layer_impl.h ('k') | cc/layers/layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698