| Index: cc/trees/tree_synchronizer.cc
|
| diff --git a/cc/trees/tree_synchronizer.cc b/cc/trees/tree_synchronizer.cc
|
| index 52f1bb384c752137b6ca7f2bfc72139e4bc42ad1..30502a9daf0e1803fe142353dc92ed48b56fcd37 100644
|
| --- a/cc/trees/tree_synchronizer.cc
|
| +++ b/cc/trees/tree_synchronizer.cc
|
| @@ -74,17 +74,36 @@ std::unique_ptr<LayerImpl> ReuseOrCreateLayerImpl(OwnedLayerImplMap* old_layers,
|
| return layer_impl;
|
| }
|
|
|
| +static bool IsHidden(Layer* layer) {
|
| + return layer->is_hidden();
|
| +}
|
| +
|
| +static bool IsHidden(LayerImpl* layer) {
|
| + return false;
|
| +}
|
| +
|
| +static void RemoveLayerShouldPushProperties(LayerTreeHost* host, Layer* layer) {
|
| + host->RemoveLayerShouldPushProperties(layer);
|
| +}
|
| +
|
| +static void RemoveLayerShouldPushProperties(LayerTreeImpl* host_impl,
|
| + LayerImpl* layer) {}
|
| +
|
| 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));
|
| -
|
| - tree_impl->AddToLayerList(layer_impl.get());
|
| - tree_impl->AddLayer(std::move(layer_impl));
|
| + if (!IsHidden(layer)) {
|
| + std::unique_ptr<LayerImpl> layer_impl(
|
| + ReuseOrCreateLayerImpl(old_layers, layer, tree_impl));
|
| +
|
| + tree_impl->AddToLayerList(layer_impl.get());
|
| + tree_impl->AddLayer(std::move(layer_impl));
|
| + } else {
|
| + RemoveLayerShouldPushProperties(host, layer);
|
| + }
|
| }
|
| tree_impl->OnCanDrawStateChangedForTree();
|
| }
|
|
|