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

Unified Diff: cc/trees/tree_synchronizer.cc

Issue 2846653002: cc : Stop pushing layers from hidden subtrees at commit
Patch Set: . Created 3 years, 8 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
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();
}
« cc/trees/layer_tree_host_common_unittest.cc ('K') | « cc/trees/property_tree_builder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698