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

Unified Diff: cc/trees/layer_tree_host_common.cc

Issue 1865693003: cc : Remove subtree skipping in LayerTreeHostCommon (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_common.cc
diff --git a/cc/trees/layer_tree_host_common.cc b/cc/trees/layer_tree_host_common.cc
index fd636302fc6ae8ebfd21c4c7b5d988f0157f9324..70655244bfe47d7d7606bfc7d11228dbc2a7bb03 100644
--- a/cc/trees/layer_tree_host_common.cc
+++ b/cc/trees/layer_tree_host_common.cc
@@ -535,40 +535,43 @@ void CalculateRenderTarget(LayerImpl* layer,
DCHECK_GE(layer->effect_tree_index(), 0);
layer_is_drawn = property_trees->effect_tree.Node(layer->effect_tree_index())
->data.is_drawn;
+ bool can_render_to_separate_surface_for_children =
+ can_render_to_separate_surface;
// The root layer cannot be skipped.
if (!IsRootLayer(layer) &&
draw_property_utils::LayerShouldBeSkipped(
layer, layer_is_drawn, property_trees->transform_tree)) {
layer->draw_properties().render_target = nullptr;
- return;
- }
-
- bool render_to_separate_surface =
- IsRootLayer(layer) ||
- (can_render_to_separate_surface && layer->render_surface());
+ can_render_to_separate_surface_for_children = false;
ajuma 2016/04/06 22:02:41 If I'm understanding, in order to completely clean
jaydasika 2016/04/07 00:32:21 Just removing it should handle it, right?
ajuma 2016/04/07 15:19:56 Yes, that works.
+ } else {
+ bool render_to_separate_surface =
+ IsRootLayer(layer) ||
+ (can_render_to_separate_surface && layer->render_surface());
- if (render_to_separate_surface) {
- DCHECK(layer->render_surface()) << IsRootLayer(layer)
- << can_render_to_separate_surface
- << layer->has_render_surface();
- layer->draw_properties().render_target = layer;
+ if (render_to_separate_surface) {
+ DCHECK(layer->render_surface()) << IsRootLayer(layer)
+ << can_render_to_separate_surface
+ << layer->has_render_surface();
+ layer->draw_properties().render_target = layer;
- if (layer->mask_layer())
- layer->mask_layer()->draw_properties().render_target = layer;
+ if (layer->mask_layer())
+ layer->mask_layer()->draw_properties().render_target = layer;
- if (layer->replica_layer() && layer->replica_layer()->mask_layer())
- layer->replica_layer()->mask_layer()->draw_properties().render_target =
- layer;
+ if (layer->replica_layer() && layer->replica_layer()->mask_layer())
+ layer->replica_layer()->mask_layer()->draw_properties().render_target =
+ layer;
- } else {
- DCHECK(!IsRootLayer(layer));
- layer->draw_properties().render_target = layer->parent()->render_target();
+ } else {
+ DCHECK(!IsRootLayer(layer));
+ layer->draw_properties().render_target = layer->parent()->render_target();
+ }
}
for (size_t i = 0; i < layer->children().size(); ++i) {
CalculateRenderTarget(
LayerTreeHostCommon::get_layer_as_raw_ptr(layer->children(), i),
- property_trees, layer_is_drawn, can_render_to_separate_surface);
+ property_trees, layer_is_drawn,
+ can_render_to_separate_surface_for_children);
}
}
@@ -609,6 +612,13 @@ void CalculateRenderSurfaceLayerList(
if (layer->render_surface())
layer->ClearRenderSurfaceLayerList();
layer->draw_properties().render_target = nullptr;
+ for (auto* child_layer : layer->children()) {
+ CalculateRenderSurfaceLayerList(
+ child_layer, property_trees, render_surface_layer_list, descendants,
+ nearest_occlusion_immune_ancestor, layer_is_drawn,
+ can_render_to_separate_surface, current_render_surface_layer_list_id,
+ max_texture_size);
+ }
return;
}
@@ -873,8 +883,6 @@ void CalculateDrawPropertiesInternal(
DCHECK(inputs->can_render_to_separate_surface ==
inputs->property_trees->non_root_surfaces_enabled);
const bool subtree_visible_from_ancestor = true;
- for (auto* layer : *inputs->root_layer->layer_tree_impl())
- layer->draw_properties().render_target = nullptr;
CalculateRenderTarget(inputs->root_layer, inputs->property_trees,
subtree_visible_from_ancestor,
inputs->can_render_to_separate_surface);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698