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

Unified Diff: cc/layers/layer.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/layers/layer.cc
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc
index 2c2bb97f40ba055cdca1d6c2c2c92f79a57e94bd..1224bd2187352701c1ac5da7dac45370378667e4 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),
@@ -1305,6 +1306,17 @@ 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();
+ SetNeedsPushProperties();
+}
+
void Layer::SetSubtreePropertyChanged() {
if (subtree_property_changed_)
return;

Powered by Google App Engine
This is Rietveld 408576698