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

Unified Diff: cc/layers/layer.cc

Issue 2846653002: cc : Stop pushing layers from hidden subtrees at commit
Patch Set: . Created 3 years, 7 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/layers/layer.cc
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc
index d3100f3daa802322ca072e5be186709b65020bce..d403105711b00f0eb8e2da73e9f1a7a234938a10 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -86,6 +86,7 @@ Layer::Layer()
property_tree_sequence_number_(-1),
should_flatten_transform_from_property_tree_(false),
draws_content_(false),
+ is_hidden_(false),
use_local_transform_for_backface_visibility_(false),
should_check_backface_visibility_(false),
force_render_surface_for_testing_(false),
@@ -1283,6 +1284,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;

Powered by Google App Engine
This is Rietveld 408576698