diff options
author | vollick@chromium.org <vollick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-10 01:18:33 +0000 |
---|---|---|
committer | vollick@chromium.org <vollick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-10 01:18:33 +0000 |
commit | 1cdf6668b7665cbc984d1f7eb75548ec4b8af3b0 (patch) | |
tree | 3ffe5c41fb829ba78a1e4873e8beb13d6a773872 /cc/layers | |
parent | cdc0b690e1547515b9b94530c3eeaf9a5ce94454 (diff) | |
download | chromium_src-1cdf6668b7665cbc984d1f7eb75548ec4b8af3b0.zip chromium_src-1cdf6668b7665cbc984d1f7eb75548ec4b8af3b0.tar.gz chromium_src-1cdf6668b7665cbc984d1f7eb75548ec4b8af3b0.tar.bz2 |
Improve perf of CalculateDrawPropertiesInternal when there are no scroll parents.
When we have scroll parents/children, we have to, potentially, reorder the children.
Previously, we had incurred a portion of this cost, even if we didn't have any scroll
parents/children in the tree. We would still populate a vector of pointers to the
children (representing the order that they would be visited in). Of course, this
order was the same as visiting layer->children() in order, so this work is wasted.
This patch stores a bool on a layer's draw properties indicating that it has a
child with a scroll parent. If this value is false, the reordering work may be
safely skipped.
BUG=305565
Review URL: https://codereview.chromium.org/26685002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@227852 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/layers')
-rw-r--r-- | cc/layers/draw_properties.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/cc/layers/draw_properties.h b/cc/layers/draw_properties.h index bb8dcc0..b81bec7 100644 --- a/cc/layers/draw_properties.h +++ b/cc/layers/draw_properties.h @@ -30,6 +30,7 @@ struct CC_EXPORT DrawProperties { num_unclipped_descendants(0), can_draw_directly_to_backbuffer(false), layer_or_descendant_has_copy_request(false), + has_child_with_a_scroll_parent(false), sorted_for_recursion(false), index_of_first_descendants_addition(0), num_descendants_added(0), @@ -103,6 +104,12 @@ struct CC_EXPORT DrawProperties { // present on it. bool layer_or_descendant_has_copy_request; + // 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; |