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

Unified Diff: cc/layers/layer.cc

Issue 2049063002: Revert of Use element id's for animations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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.h ('k') | cc/layers/layer_impl.h » ('j') | 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 a2bd6345629fe98ff7348e2252bb91aca97ba06d..284bb1ebe95caeb792cf1219d04b263d092e2e6e 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -15,7 +15,6 @@
#include "base/single_thread_task_runner.h"
#include "base/time/time.h"
#include "base/trace_event/trace_event.h"
-#include "cc/animation/animation_host.h"
#include "cc/animation/mutable_properties.h"
#include "cc/base/simple_enclosed_region.h"
#include "cc/debug/frame_viewer_instrumentation.h"
@@ -59,6 +58,7 @@
clip_tree_index_(-1),
scroll_tree_index_(-1),
property_tree_sequence_number_(-1),
+ element_id_(0),
mutable_properties_(MutableProperty::kNone),
main_thread_scrolling_reasons_(
MainThreadScrollingReason::kNotScrollingOnMain),
@@ -122,20 +122,10 @@
layer_tree_host_->property_trees()->RemoveIdFromIdToIndexMaps(id());
layer_tree_host_->property_trees()->needs_rebuild = true;
layer_tree_host_->UnregisterLayer(this);
- if (element_id_) {
- layer_tree_host_->animation_host()->UnregisterElement(
- element_id_, ElementListType::ACTIVE);
- layer_tree_host_->RemoveFromElementMap(this);
- }
}
if (host) {
host->property_trees()->needs_rebuild = true;
host->RegisterLayer(this);
- if (element_id_) {
- host->AddToElementMap(this);
- host->animation_host()->RegisterElement(element_id_,
- ElementListType::ACTIVE);
- }
}
layer_tree_host_ = host;
@@ -1802,26 +1792,13 @@
benchmark->RunOnLayer(this);
}
-void Layer::SetElementId(ElementId id) {
+void Layer::SetElementId(uint64_t id) {
DCHECK(IsPropertyChangeAllowed());
if (element_id_ == id)
return;
TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("compositor-worker"),
- "Layer::SetElementId", "element", id.AsValue().release());
- if (element_id_ && layer_tree_host()) {
- layer_tree_host()->animation_host()->UnregisterElement(
- element_id_, ElementListType::ACTIVE);
- layer_tree_host()->RemoveFromElementMap(this);
- }
-
+ "Layer::SetElementId", "id", id);
element_id_ = id;
-
- if (element_id_ && layer_tree_host()) {
- layer_tree_host()->animation_host()->RegisterElement(
- element_id_, ElementListType::ACTIVE);
- layer_tree_host()->AddToElementMap(this);
- }
-
SetNeedsCommit();
}
« no previous file with comments | « cc/layers/layer.h ('k') | cc/layers/layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698