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

Unified Diff: cc/layers/draw_properties.h

Issue 563313002: Revert of Generalize scroll parent work in CalculateDrawProperties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | cc/trees/layer_tree_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/draw_properties.h
diff --git a/cc/layers/draw_properties.h b/cc/layers/draw_properties.h
index affb57aaffcfef04695b8e5c7bb80244bbd13d23..4bbce727deff70f122c131dad21a4b756a01d72c 100644
--- a/cc/layers/draw_properties.h
+++ b/cc/layers/draw_properties.h
@@ -29,6 +29,8 @@
num_unclipped_descendants(0),
layer_or_descendant_has_copy_request(false),
layer_or_descendant_has_input_handler(false),
+ has_child_with_a_scroll_parent(false),
+ sorted_for_recursion(false),
index_of_first_descendants_addition(0),
num_descendants_added(0),
index_of_first_render_surface_layer_list_addition(0),
@@ -37,12 +39,7 @@
ideal_contents_scale(0.f),
maximum_animation_contents_scale(0.f),
page_scale_factor(0.f),
- device_scale_factor(0.f),
- children_need_sorting(false),
- sequence_number(0),
- sort_weight(0),
- sort_weight_sequence_number(0),
- depth(0) {}
+ device_scale_factor(0.f) {}
// Transforms objects from content space to target surface space, where
// this layer would be drawn.
@@ -109,6 +106,16 @@
// If true, the layer or one of its descendants has a wheel or touch handler.
bool layer_or_descendant_has_input_handler;
+ // This is true if the layer has any direct child that has a scroll parent.
+ // This layer will not be the scroll parent in this case. This information
+ // lets us avoid work in CalculateDrawPropertiesInternal -- if none of our
+ // children have scroll parents, we will not need to recur out of order.
+ bool has_child_with_a_scroll_parent;
+
+ // This is true if the order (wrt to its siblings in the tree) in which the
+ // layer will be visited while computing draw properties has been determined.
+ bool sorted_for_recursion;
+
// If this layer is visited out of order, its contribution to the descendant
// and render surface layer lists will be put aside in a temporary list.
// These values will allow for an efficient reordering of these additions.
@@ -140,30 +147,6 @@
// The device scale factor that is applied to the layer.
float device_scale_factor;
-
- // This is used to detect cases when a layer needs to sort its children to
- // ensure that scroll parents are visited before scroll children.
- bool children_need_sorting;
-
- // This sequence number is used to determine if we've visited this layer in
- // PreCalculateMetaInformation.
- int sequence_number;
-
- // Determines the order the layer should be processed in
- // CalculateDrawProperties wrt to its siblings. If you have lower
- // |sort_weight| you get visited first.
- int sort_weight;
-
- // This sequence number is used to determine if a sort weight has already been
- // assigned for a layer. We may assign a sort weight before we visit a layer,
- // and it's important that we don't clobber it when we do eventually visit the
- // layer.
- int sort_weight_sequence_number;
-
- // This is the topological depth in the tree. (E.g., root has depth zero).
- // This is used to make it faster to find the lowest common ancestor of two
- // layers.
- int depth;
};
} // namespace cc
« no previous file with comments | « no previous file | cc/trees/layer_tree_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698