Chromium Code Reviews| Index: cc/layers/layer.cc |
| diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc |
| index 8896bbb196ce2ed8bb890037d33adc403ca6c733..59fb08c864d4fe88f0f79592b1f8671af3ec8e03 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) { |
| + bool use_layer_lists = layer_tree_host_->GetSettings().use_layer_lists; |
| + if (!use_layer_lists && inputs_.element_id) { |
| layer_tree_host_->UnregisterElement(inputs_.element_id, |
| ElementListType::ACTIVE, this); |
| } |
| @@ -132,7 +133,8 @@ void Layer::SetLayerTreeHost(LayerTreeHost* host) { |
| if (host) { |
| host->property_trees()->needs_rebuild = true; |
| host->RegisterLayer(this); |
| - if (inputs_.element_id) { |
| + bool use_layer_lists = host->GetSettings().use_layer_lists; |
| + if (!use_layer_lists && inputs_.element_id) { |
| host->RegisterElement(inputs_.element_id, ElementListType::ACTIVE, this); |
| } |
| } |
| @@ -150,12 +152,15 @@ 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) |
| - host->SetNeedsCommit(); |
| + bool use_layer_lists = |
| + layer_tree_host_ && layer_tree_host_->GetSettings().use_layer_lists; |
| + if (!use_layer_lists) { |
|
pdr.
2017/05/16 02:46:35
can this be simplified like:
if (host && host->Get
wkorman
2017/05/16 21:42:42
Done and combined the two if's into one with an ad
|
| + const bool has_any_animation = |
| + layer_tree_host_ ? GetMutatorHost()->HasAnyAnimation(element_id()) |
| + : false; |
| + if (host && has_any_animation) |
| + host->SetNeedsCommit(); |
| + } |
| } |
| void Layer::SetNeedsCommit() { |