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

Unified Diff: cc/layers/layer.cc

Issue 2846653002: cc : Stop pushing layers from hidden subtrees at commit
Patch Set: hide mask layer also 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..c8e35cd3c73cebc4bdbc11da7700be1ba91ff233 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),
@@ -1127,6 +1128,14 @@ bool Layer::IsSnapped() {
return scrollable();
}
+bool Layer::IsSurfaceLayer() const {
+ return false;
+}
+
+const SurfaceId* Layer::GetSurfaceId() const {
+ return nullptr;
+}
+
void Layer::PushPropertiesTo(LayerImpl* layer) {
TRACE_EVENT0("cc", "Layer::PushPropertiesTo");
DCHECK(layer_tree_host_);
@@ -1283,6 +1292,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