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

Unified Diff: cc/trees/draw_property_utils.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/proto/property_tree.proto ('k') | cc/trees/layer_tree_host_common.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/draw_property_utils.cc
diff --git a/cc/trees/draw_property_utils.cc b/cc/trees/draw_property_utils.cc
index 6899816caee13f3def3c77fd030cb72cb6760f26..fa522368a32906f731ec11a2e986cfad063a7587 100644
--- a/cc/trees/draw_property_utils.cc
+++ b/cc/trees/draw_property_utils.cc
@@ -344,7 +344,7 @@ static inline bool SubtreeShouldBeSkipped(LayerImpl* layer,
// The opacity of a layer always applies to its children (either implicitly
// via a render surface or explicitly if the parent preserves 3D), so the
// entire subtree can be skipped if this layer is fully transparent.
- return !layer->EffectiveOpacity();
+ return !layer->opacity();
}
static inline bool SubtreeShouldBeSkipped(Layer* layer,
@@ -380,8 +380,7 @@ static inline bool SubtreeShouldBeSkipped(Layer* layer,
// In particular, it should not cause the subtree to be skipped.
// Similarly, for layers that might animate opacity using an impl-only
// animation, their subtree should also not be skipped.
- return !layer->EffectiveOpacity() &&
- !layer->HasPotentiallyRunningOpacityAnimation() &&
+ return !layer->opacity() && !layer->HasPotentiallyRunningOpacityAnimation() &&
!layer->OpacityCanAnimateOnImplThread();
}
@@ -431,19 +430,18 @@ static bool LayerShouldBeSkipped(LayerType* layer,
template <typename LayerType>
void FindLayersThatNeedUpdates(
LayerType* layer,
- const TransformTree& transform_tree,
- const EffectTree& effect_tree,
+ const TransformTree& tree,
+ bool subtree_is_visible_from_ancestor,
typename LayerType::LayerListType* update_layer_list,
std::vector<LayerType*>* visible_layer_list) {
- DCHECK_GE(layer->effect_tree_index(), 0);
bool layer_is_drawn =
- effect_tree.Node(layer->effect_tree_index())->data.is_drawn;
+ layer->HasCopyRequest() ||
+ (subtree_is_visible_from_ancestor && !layer->hide_layer_and_subtree());
- if (layer->parent() &&
- SubtreeShouldBeSkipped(layer, layer_is_drawn, transform_tree))
+ if (layer->parent() && SubtreeShouldBeSkipped(layer, layer_is_drawn, tree))
return;
- if (!LayerShouldBeSkipped(layer, layer_is_drawn, transform_tree)) {
+ if (!LayerShouldBeSkipped(layer, layer_is_drawn, tree)) {
visible_layer_list->push_back(layer);
update_layer_list->push_back(layer);
}
@@ -459,7 +457,7 @@ void FindLayersThatNeedUpdates(
}
for (size_t i = 0; i < layer->children().size(); ++i) {
- FindLayersThatNeedUpdates(layer->child_at(i), transform_tree, effect_tree,
+ FindLayersThatNeedUpdates(layer->child_at(i), tree, layer_is_drawn,
update_layer_list, visible_layer_list);
}
}
@@ -681,8 +679,9 @@ static void ComputeVisibleRectsUsingPropertyTreesInternal(
can_render_to_separate_surface);
ComputeEffects(&property_trees->effect_tree);
+ const bool subtree_is_visible_from_ancestor = true;
FindLayersThatNeedUpdates(root_layer, property_trees->transform_tree,
- property_trees->effect_tree, update_layer_list,
+ subtree_is_visible_from_ancestor, update_layer_list,
visible_layer_list);
CalculateVisibleRects<LayerType>(
*visible_layer_list, property_trees->clip_tree,
« no previous file with comments | « cc/proto/property_tree.proto ('k') | cc/trees/layer_tree_host_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698