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

Unified Diff: cc/layers/layer.cc

Issue 2888483002: Manage registering composited elements in PaintArtifactCompositor. (Closed)
Patch Set: Fix inverted logic. Created 3 years, 7 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
Index: cc/layers/layer.cc
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc
index cb823eec1e3a68666ddf9bbc3a21208168b3e556..d3100f3daa802322ca072e5be186709b65020bce 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -124,7 +124,8 @@ void Layer::SetLayerTreeHost(LayerTreeHost* host) {
layer_tree_host_->property_trees()->RemoveIdFromIdToIndexMaps(id());
layer_tree_host_->property_trees()->needs_rebuild = true;
layer_tree_host_->UnregisterLayer(this);
- if (inputs_.element_id) {
+ if (!layer_tree_host_->GetSettings().use_layer_lists &&
+ inputs_.element_id) {
layer_tree_host_->UnregisterElement(inputs_.element_id,
ElementListType::ACTIVE, this);
}
@@ -132,7 +133,7 @@ void Layer::SetLayerTreeHost(LayerTreeHost* host) {
if (host) {
host->property_trees()->needs_rebuild = true;
host->RegisterLayer(this);
- if (inputs_.element_id) {
+ if (!host->GetSettings().use_layer_lists && inputs_.element_id) {
host->RegisterElement(inputs_.element_id, ElementListType::ACTIVE, this);
}
}
@@ -150,12 +151,10 @@ void Layer::SetLayerTreeHost(LayerTreeHost* host) {
if (inputs_.mask_layer.get())
inputs_.mask_layer->SetLayerTreeHost(host);
- const bool has_any_animation =
- layer_tree_host_ ? GetMutatorHost()->HasAnyAnimation(element_id())
- : false;
-
- if (host && has_any_animation)
+ if (host && !host->GetSettings().use_layer_lists &&
+ GetMutatorHost()->HasAnyAnimation(element_id())) {
host->SetNeedsCommit();
+ }
}
void Layer::SetNeedsCommit() {

Powered by Google App Engine
This is Rietveld 408576698