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

Unified Diff: cc/layers/layer_impl.cc

Issue 1621013002: Revert of Compute if a layer is drawn without LayerTree hierarchy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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
« no previous file with comments | « cc/layers/layer_impl.h ('k') | cc/proto/property_tree.proto » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer_impl.cc
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc
index f585bde06ceebf656f8f514cbdffd8437104a6ab..57b62f880ed30c978e7f608cab61187810e7be72 100644
--- a/cc/layers/layer_impl.cc
+++ b/cc/layers/layer_impl.cc
@@ -100,7 +100,8 @@ LayerImpl::LayerImpl(LayerTreeImpl* tree_impl,
visited_(false),
layer_or_descendant_is_drawn_(false),
layer_or_descendant_has_input_handler_(false),
- sorted_for_recursion_(false) {
+ sorted_for_recursion_(false),
+ is_hidden_from_property_trees_(false) {
DCHECK_GT(layer_id_, 0);
DCHECK(layer_tree_impl_);
layer_tree_impl_->RegisterLayer(this);
@@ -658,6 +659,7 @@ 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_) {
@@ -960,7 +962,7 @@ void LayerImpl::UpdatePropertyTreeOpacity() {
// started, but might have finished since then on the compositor thread.
if (node->owner_id != id())
return;
- node->data.opacity = EffectiveOpacity();
+ node->data.opacity = opacity_;
effect_tree.set_needs_update(true);
}
}
@@ -989,10 +991,7 @@ void LayerImpl::OnFilterAnimated(const FilterOperations& filters) {
void LayerImpl::OnOpacityAnimated(float opacity) {
SetOpacity(opacity);
- // When hide_layer_and_subtree is true, the effective opacity is zero and we
- // need not update the opacity on property trees.
- if (!hide_layer_and_subtree_)
- UpdatePropertyTreeOpacity();
+ UpdatePropertyTreeOpacity();
}
void LayerImpl::OnTransformAnimated(const gfx::Transform& transform) {
@@ -1249,10 +1248,6 @@ void LayerImpl::SetOpacity(float opacity) {
NoteLayerPropertyChangedForSubtree();
}
-float LayerImpl::EffectiveOpacity() const {
- return hide_layer_and_subtree_ ? 0.f : opacity_;
-}
-
bool LayerImpl::OpacityIsAnimating() const {
LayerAnimationController::ObserverType observer_type =
IsActive() ? LayerAnimationController::ObserverType::ACTIVE
@@ -1928,13 +1923,11 @@ gfx::Rect LayerImpl::GetScaledEnclosingRectInTargetSpace(float scale) const {
gfx::Rect(scaled_bounds));
}
-bool LayerImpl::IsHidden() const {
+bool LayerImpl::LayerIsHidden() const {
if (layer_tree_impl()->settings().use_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;
+ return is_hidden_from_property_trees_;
} else {
- return EffectiveOpacity() == 0.f || (parent() && parent()->IsHidden());
+ return hide_layer_and_subtree_ || (parent() && parent()->LayerIsHidden());
}
}
« no previous file with comments | « cc/layers/layer_impl.h ('k') | cc/proto/property_tree.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698