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

Unified Diff: cc/trees/layer_tree_host_common.cc

Issue 373113003: Keeping track of descendants that draw content instead of recalcualting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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/trees/damage_tracker_unittest.cc ('k') | cc/trees/layer_tree_host_common_unittest.cc » ('j') | 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 3bbbf6340b623d5e0dd95258d4cf3e00ec0308d6..6a335e6b44a42000942c55b4cf09f986317f309a 100644
--- a/cc/trees/layer_tree_host_common.cc
+++ b/cc/trees/layer_tree_host_common.cc
@@ -583,7 +583,7 @@ static bool SubtreeShouldRenderToSeparateSurface(
}
int num_descendants_that_draw_content =
- layer->draw_properties().num_descendants_that_draw_content;
+ layer->NumDescendantsThatDrawContent();
// If the layer flattens its subtree, but it is treated as a 3D object by its
// parent (i.e. parent participates in a 3D rendering context).
@@ -1242,8 +1242,6 @@ template <typename LayerType>
static void PreCalculateMetaInformation(
LayerType* layer,
PreCalculateMetaInformationRecursiveData* recursive_data) {
- bool has_delegated_content = layer->HasDelegatedContent();
- int num_descendants_that_draw_content = 0;
layer->draw_properties().sorted_for_recursion = false;
layer->draw_properties().has_child_with_a_scroll_parent = false;
@@ -1254,14 +1252,6 @@ static void PreCalculateMetaInformation(
return;
}
- if (has_delegated_content) {
- // Layers with delegated content need to be treated as if they have as
- // many children as the number of layers they own delegated quads for.
- // Since we don't know this number right now, we choose one that acts like
- // infinity for our purposes.
- num_descendants_that_draw_content = 1000;
- }
-
if (layer->clip_parent())
recursive_data->num_unclipped_descendants++;
@@ -1272,10 +1262,6 @@ static void PreCalculateMetaInformation(
PreCalculateMetaInformationRecursiveData data_for_child;
PreCalculateMetaInformation(child_layer, &data_for_child);
- num_descendants_that_draw_content += child_layer->DrawsContent() ? 1 : 0;
- num_descendants_that_draw_content +=
- child_layer->draw_properties().num_descendants_that_draw_content;
-
if (child_layer->scroll_parent())
layer->draw_properties().has_child_with_a_scroll_parent = true;
recursive_data->Merge(data_for_child);
@@ -1294,8 +1280,6 @@ static void PreCalculateMetaInformation(
layer->have_wheel_event_handlers())
recursive_data->layer_or_descendant_has_input_handler = true;
- layer->draw_properties().num_descendants_that_draw_content =
- num_descendants_that_draw_content;
layer->draw_properties().num_unclipped_descendants =
recursive_data->num_unclipped_descendants;
layer->draw_properties().layer_or_descendant_has_copy_request =
« no previous file with comments | « cc/trees/damage_tracker_unittest.cc ('k') | cc/trees/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698