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

Unified Diff: cc/layers/layer.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/layers/layer.h ('k') | cc/layers/layer_impl_test_properties.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer.cc
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc
index 4740816bbb011a2908c9156a93f347d7680fafa3..3cf721462e5290e6b6ebbbfee918b2bf322125da 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -88,6 +88,7 @@ Layer::Layer()
property_tree_sequence_number_(-1),
should_flatten_transform_from_property_tree_(false),
draws_content_(false),
+ is_hidden_(false),
should_check_backface_visibility_(false),
force_render_surface_for_testing_(false),
subtree_property_changed_(false),
@@ -1296,6 +1297,16 @@ void Layer::didUpdateMainThreadScrollingReasons() {
inputs_.client->didUpdateMainThreadScrollingReasons();
}
+void Layer::SetIsHidden(bool is_hidden) {
+ DCHECK(layer_tree_host_);
+ if (is_hidden == is_hidden_)
+ return;
+ is_hidden_ = is_hidden;
+ // We don't push layers that are hidden to compositor thread at commit. So,
+ // we need a full tree sync when is_hidden changes.
+ layer_tree_host_->SetNeedsFullTreeSync();
+}
+
void Layer::SetSubtreePropertyChanged() {
if (subtree_property_changed_)
return;
« no previous file with comments | « cc/layers/layer.h ('k') | cc/layers/layer_impl_test_properties.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698