| Index: cc/trees/tree_synchronizer.cc
|
| diff --git a/cc/trees/tree_synchronizer.cc b/cc/trees/tree_synchronizer.cc
|
| index 87efee06cab3859b3382d1fbd7e7c8d6e07037b5..572333fef3e3c1644665b1f35cbfe774dfad95d2 100644
|
| --- a/cc/trees/tree_synchronizer.cc
|
| +++ b/cc/trees/tree_synchronizer.cc
|
| @@ -93,26 +93,37 @@ static bool LayerHasValidPropertyTreeIndices(LayerImpl* layer) {
|
| }
|
| #endif
|
|
|
| +static bool IsHidden(Layer* layer) {
|
| + return layer->is_hidden();
|
| +}
|
| +
|
| +static bool IsHidden(LayerImpl* layer) {
|
| + return false;
|
| +}
|
| +
|
| template <typename LayerTreeType>
|
| void PushLayerList(OwnedLayerImplMap* old_layers,
|
| LayerTreeType* host,
|
| LayerTreeImpl* tree_impl) {
|
| tree_impl->ClearLayerList();
|
| for (auto* layer : *host) {
|
| - std::unique_ptr<LayerImpl> layer_impl(
|
| - ReuseOrCreateLayerImpl(old_layers, layer, tree_impl));
|
| + // TODO(crbug.com/726535) : Try not pushing all skipped layers and not just
|
| + // the hidden layers here.
|
| + if (!IsHidden(layer)) {
|
| + std::unique_ptr<LayerImpl> layer_impl(
|
| + ReuseOrCreateLayerImpl(old_layers, layer, tree_impl));
|
|
|
| #if DCHECK_IS_ON()
|
| - // Every layer should have valid property tree indices
|
| - AssertValidPropertyTreeIndices(layer);
|
| - // Every layer_impl should either have valid property tree indices already
|
| - // or the corresponding layer should push them onto layer_impl.
|
| - DCHECK(LayerHasValidPropertyTreeIndices(layer_impl.get()) ||
|
| - host->LayerNeedsPushPropertiesForTesting(layer));
|
| + // Every layer should have valid property tree indices
|
| + AssertValidPropertyTreeIndices(layer);
|
| + // Every layer_impl should either have valid property tree indices already
|
| + // or the corresponding layer should push them onto layer_impl.
|
| + DCHECK(LayerHasValidPropertyTreeIndices(layer_impl.get()) ||
|
| + host->LayerNeedsPushPropertiesForTesting(layer));
|
| #endif
|
| -
|
| - tree_impl->AddToLayerList(layer_impl.get());
|
| - tree_impl->AddLayer(std::move(layer_impl));
|
| + tree_impl->AddToLayerList(layer_impl.get());
|
| + tree_impl->AddLayer(std::move(layer_impl));
|
| + }
|
| }
|
| tree_impl->OnCanDrawStateChangedForTree();
|
| }
|
| @@ -122,9 +133,11 @@ static void PushLayerPropertiesInternal(
|
| std::unordered_set<LayerType*> layers_that_should_push_properties,
|
| LayerTreeImpl* impl_tree) {
|
| for (auto layer : layers_that_should_push_properties) {
|
| - LayerImpl* layer_impl = impl_tree->LayerById(layer->id());
|
| - DCHECK(layer_impl);
|
| - layer->PushPropertiesTo(layer_impl);
|
| + if (!IsHidden(layer)) {
|
| + LayerImpl* layer_impl = impl_tree->LayerById(layer->id());
|
| + DCHECK(layer_impl);
|
| + layer->PushPropertiesTo(layer_impl);
|
| + }
|
| }
|
| }
|
|
|
|
|