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

Unified Diff: cc/trees/draw_property_utils.cc

Issue 1633203002: cc :: Reland compute if layer is drawn from property trees (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/trees/draw_property_utils.cc
diff --git a/cc/trees/draw_property_utils.cc b/cc/trees/draw_property_utils.cc
index fa522368a32906f731ec11a2e986cfad063a7587..6899816caee13f3def3c77fd030cb72cb6760f26 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->opacity();
+ return !layer->EffectiveOpacity();
}
static inline bool SubtreeShouldBeSkipped(Layer* layer,
@@ -380,7 +380,8 @@ 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->opacity() && !layer->HasPotentiallyRunningOpacityAnimation() &&
+ return !layer->EffectiveOpacity() &&
+ !layer->HasPotentiallyRunningOpacityAnimation() &&
!layer->OpacityCanAnimateOnImplThread();
}
@@ -430,18 +431,19 @@ static bool LayerShouldBeSkipped(LayerType* layer,
template <typename LayerType>
void FindLayersThatNeedUpdates(
LayerType* layer,
- const TransformTree& tree,
- bool subtree_is_visible_from_ancestor,
+ const TransformTree& transform_tree,
+ const EffectTree& effect_tree,
typename LayerType::LayerListType* update_layer_list,
std::vector<LayerType*>* visible_layer_list) {
+ DCHECK_GE(layer->effect_tree_index(), 0);
bool layer_is_drawn =
- layer->HasCopyRequest() ||
- (subtree_is_visible_from_ancestor && !layer->hide_layer_and_subtree());
+ effect_tree.Node(layer->effect_tree_index())->data.is_drawn;
- if (layer->parent() && SubtreeShouldBeSkipped(layer, layer_is_drawn, tree))
+ if (layer->parent() &&
+ SubtreeShouldBeSkipped(layer, layer_is_drawn, transform_tree))
return;
- if (!LayerShouldBeSkipped(layer, layer_is_drawn, tree)) {
+ if (!LayerShouldBeSkipped(layer, layer_is_drawn, transform_tree)) {
visible_layer_list->push_back(layer);
update_layer_list->push_back(layer);
}
@@ -457,7 +459,7 @@ void FindLayersThatNeedUpdates(
}
for (size_t i = 0; i < layer->children().size(); ++i) {
- FindLayersThatNeedUpdates(layer->child_at(i), tree, layer_is_drawn,
+ FindLayersThatNeedUpdates(layer->child_at(i), transform_tree, effect_tree,
update_layer_list, visible_layer_list);
}
}
@@ -679,9 +681,8 @@ 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,
- subtree_is_visible_from_ancestor, update_layer_list,
+ property_trees->effect_tree, update_layer_list,
visible_layer_list);
CalculateVisibleRects<LayerType>(
*visible_layer_list, property_trees->clip_tree,

Powered by Google App Engine
This is Rietveld 408576698