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

Unified Diff: cc/layers/layer_impl.cc

Issue 1588093004: Compute if a layer is drawn without LayerTree hierarchy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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_impl.cc
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc
index 422de5cc3d270e16615018432b7f4c674c84ff41..318192e36bc80381c87ce7b677276671b2421816 100644
--- a/cc/layers/layer_impl.cc
+++ b/cc/layers/layer_impl.cc
@@ -98,8 +98,7 @@ LayerImpl::LayerImpl(LayerTreeImpl* tree_impl,
visited_(false),
layer_or_descendant_is_drawn_(false),
layer_or_descendant_has_input_handler_(false),
- sorted_for_recursion_(false),
- is_hidden_from_property_trees_(false) {
+ sorted_for_recursion_(false) {
DCHECK_GT(layer_id_, 0);
DCHECK(layer_tree_impl_);
layer_tree_impl_->RegisterLayer(this);
@@ -653,7 +652,6 @@ void LayerImpl::PushPropertiesTo(LayerImpl* layer) {
layer->SetClipTreeIndex(clip_tree_index_);
layer->SetEffectTreeIndex(effect_tree_index_);
layer->set_offset_to_transform_parent(offset_to_transform_parent_);
- layer->set_is_hidden_from_property_trees(is_hidden_from_property_trees_);
LayerImpl* scroll_parent = nullptr;
if (scroll_parent_) {
@@ -1917,11 +1915,13 @@ gfx::Rect LayerImpl::GetScaledEnclosingRectInTargetSpace(float scale) const {
gfx::Rect(scaled_bounds));
}
-bool LayerImpl::LayerIsHidden() const {
+bool LayerImpl::IsHidden() const {
if (layer_tree_impl()->settings().use_property_trees) {
- return is_hidden_from_property_trees_;
+ EffectTree& effect_tree = layer_tree_impl_->property_trees()->effect_tree;
+ EffectNode* node = effect_tree.Node(effect_tree_index_);
+ return node->data.screen_space_opacity == 0.f;
} else {
- return hide_layer_and_subtree_ || (parent() && parent()->LayerIsHidden());
+ return opacity() == 0.f || (parent() && parent()->IsHidden());
}
}
« no previous file with comments | « cc/layers/layer_impl.h ('k') | cc/proto/property_tree.proto » ('j') | cc/trees/property_tree.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698