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

Unified Diff: cc/trees/tree_synchronizer.cc

Issue 2846653002: cc : Stop pushing layers from hidden subtrees at commit
Patch Set: rebase Created 3 years, 6 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
« no previous file with comments | « cc/trees/property_tree_builder.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
+ }
}
}
« no previous file with comments | « cc/trees/property_tree_builder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698