| Index: cc/trees/tree_synchronizer.cc
|
| diff --git a/cc/trees/tree_synchronizer.cc b/cc/trees/tree_synchronizer.cc
|
| index 87efee06cab3859b3382d1fbd7e7c8d6e07037b5..5fc2e42cc108086747ee5ea26e0758d18eb98faf 100644
|
| --- a/cc/trees/tree_synchronizer.cc
|
| +++ b/cc/trees/tree_synchronizer.cc
|
| @@ -93,26 +93,35 @@ 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));
|
| + 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 +131,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);
|
| + }
|
| }
|
| }
|
|
|
| @@ -132,12 +143,20 @@ void TreeSynchronizer::PushLayerProperties(LayerTreeImpl* pending_tree,
|
| LayerTreeImpl* active_tree) {
|
| PushLayerPropertiesInternal(pending_tree->LayersThatShouldPushProperties(),
|
| active_tree);
|
| + active_tree->ClearSurfaceLayerIds();
|
| + active_tree->SetSurfaceLayerIds(pending_tree->SurfaceLayerIds());
|
| + // Reset for next update.
|
| + pending_tree->ClearSurfaceLayerIds();
|
| }
|
|
|
| void TreeSynchronizer::PushLayerProperties(LayerTreeHost* host_tree,
|
| LayerTreeImpl* impl_tree) {
|
| PushLayerPropertiesInternal(host_tree->LayersThatShouldPushProperties(),
|
| impl_tree);
|
| + impl_tree->ClearSurfaceLayerIds();
|
| + impl_tree->SetSurfaceLayerIds(host_tree->SurfaceLayerIds());
|
| + // Reset for next update.
|
| + host_tree->ClearSurfaceLayerIds();
|
| }
|
|
|
| } // namespace cc
|
|
|