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

Unified Diff: cc/trees/property_tree_builder.cc

Issue 2053193002: cc : Move LayerImpl::children to test properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« cc/layers/layer_impl.cc ('K') | « cc/trees/layer_tree_impl_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/property_tree_builder.cc
diff --git a/cc/trees/property_tree_builder.cc b/cc/trees/property_tree_builder.cc
index aa17b8e70614099f70f1b4b1148769460e223e05..3bf0ac606f6ed460d675a6ddf2d1ef150cd8af50 100644
--- a/cc/trees/property_tree_builder.cc
+++ b/cc/trees/property_tree_builder.cc
@@ -140,8 +140,8 @@ static void PreCalculateMetaInformationInternalForTesting(
if (layer->test_properties()->clip_parent)
recursive_data->num_unclipped_descendants++;
- for (size_t i = 0; i < layer->children().size(); ++i) {
- LayerImpl* child_layer = layer->child_at(i);
+ for (size_t i = 0; i < layer->test_properties()->children.size(); ++i) {
+ LayerImpl* child_layer = layer->test_properties()->children[i];
PreCalculateMetaInformationRecursiveData data_for_child;
PreCalculateMetaInformationInternalForTesting(child_layer, &data_for_child);
@@ -165,6 +165,22 @@ static void PreCalculateMetaInformationInternalForTesting(
recursive_data->num_descendants_that_draw_content++;
}
+static LayerImplList& Children(LayerImpl* layer) {
+ return layer->test_properties()->children;
+}
+
+static const LayerList& Children(Layer* layer) {
+ return layer->children();
+}
+
+static LayerImpl* ChildAt(LayerImpl* layer, int index) {
+ return layer->test_properties()->children[index];
+}
+
+static Layer* ChildAt(Layer* layer, int index) {
+ return layer->child_at(index);
+}
+
static Layer* ScrollParent(Layer* layer) {
return layer->scroll_parent();
}
@@ -1078,18 +1094,18 @@ void BuildPropertyTreesInternal(
SetBackfaceVisibilityTransform(layer, created_transform_node);
SetSafeOpaqueBackgroundColor(data_from_parent, layer, &data_for_children);
- for (size_t i = 0; i < layer->children().size(); ++i) {
- SetLayerPropertyChangedForChild(layer, layer->child_at(i));
- if (!ScrollParent(layer->child_at(i))) {
+ for (size_t i = 0; i < Children(layer).size(); ++i) {
+ LayerType* current_child = ChildAt(layer, i);
+ SetLayerPropertyChangedForChild(layer, current_child);
+ if (!ScrollParent(current_child)) {
DataForRecursionFromChild<LayerType> data_from_child;
- BuildPropertyTreesInternal(layer->child_at(i), data_for_children,
+ BuildPropertyTreesInternal(current_child, data_for_children,
&data_from_child);
data_to_parent->Merge(data_from_child);
} else {
// The child should be included in its scroll parent's list of scroll
// children.
- DCHECK(ScrollChildren(ScrollParent(layer->child_at(i)))
- ->count(layer->child_at(i)));
+ DCHECK(ScrollChildren(ScrollParent(current_child))->count(current_child));
}
}
« cc/layers/layer_impl.cc ('K') | « cc/trees/layer_tree_impl_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698