OLD | NEW |
---|---|
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/trees/layer_tree_host_common.h" | 5 #include "cc/trees/layer_tree_host_common.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 1110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1121 | 1121 |
1122 if (layer->clip_children()) { | 1122 if (layer->clip_children()) { |
1123 size_t num_clip_children = layer->clip_children()->size(); | 1123 size_t num_clip_children = layer->clip_children()->size(); |
1124 DCHECK_GE(recursive_data->num_unclipped_descendants, num_clip_children); | 1124 DCHECK_GE(recursive_data->num_unclipped_descendants, num_clip_children); |
1125 recursive_data->num_unclipped_descendants -= num_clip_children; | 1125 recursive_data->num_unclipped_descendants -= num_clip_children; |
1126 } | 1126 } |
1127 | 1127 |
1128 if (layer->HasCopyRequest()) | 1128 if (layer->HasCopyRequest()) |
1129 recursive_data->num_layer_or_descendants_with_copy_request++; | 1129 recursive_data->num_layer_or_descendants_with_copy_request++; |
1130 | 1130 |
1131 if (!layer->touch_event_handler_region().IsEmpty() || | 1131 if (!layer->touch_event_handler_region().IsEmpty()) |
1132 layer->have_wheel_event_handlers()) | |
1133 recursive_data->num_layer_or_descendants_with_input_handler++; | 1132 recursive_data->num_layer_or_descendants_with_input_handler++; |
Rick Byers
2016/01/28 00:18:31
nit: rename this from "input_handlers" to "touch_h
dtapuska
2016/01/28 16:23:06
Done.
| |
1134 | 1133 |
1135 layer->set_num_unclipped_descendants( | 1134 layer->set_num_unclipped_descendants( |
1136 recursive_data->num_unclipped_descendants); | 1135 recursive_data->num_unclipped_descendants); |
1137 | 1136 |
1138 if (IsRootLayer(layer)) | 1137 if (IsRootLayer(layer)) |
1139 layer->layer_tree_host()->SetNeedsMetaInfoRecomputation(false); | 1138 layer->layer_tree_host()->SetNeedsMetaInfoRecomputation(false); |
1140 } | 1139 } |
1141 | 1140 |
1142 static void PreCalculateMetaInformationInternal( | 1141 static void PreCalculateMetaInformationInternal( |
1143 LayerImpl* layer, | 1142 LayerImpl* layer, |
(...skipping 25 matching lines...) Expand all Loading... | |
1169 | 1168 |
1170 if (layer->clip_children()) { | 1169 if (layer->clip_children()) { |
1171 size_t num_clip_children = layer->clip_children()->size(); | 1170 size_t num_clip_children = layer->clip_children()->size(); |
1172 DCHECK_GE(recursive_data->num_unclipped_descendants, num_clip_children); | 1171 DCHECK_GE(recursive_data->num_unclipped_descendants, num_clip_children); |
1173 recursive_data->num_unclipped_descendants -= num_clip_children; | 1172 recursive_data->num_unclipped_descendants -= num_clip_children; |
1174 } | 1173 } |
1175 | 1174 |
1176 if (layer->HasCopyRequest()) | 1175 if (layer->HasCopyRequest()) |
1177 recursive_data->num_layer_or_descendants_with_copy_request++; | 1176 recursive_data->num_layer_or_descendants_with_copy_request++; |
1178 | 1177 |
1179 if (!layer->touch_event_handler_region().IsEmpty() || | 1178 if (!layer->touch_event_handler_region().IsEmpty()) |
1180 layer->have_wheel_event_handlers()) | |
1181 recursive_data->num_layer_or_descendants_with_input_handler++; | 1179 recursive_data->num_layer_or_descendants_with_input_handler++; |
1182 | 1180 |
1183 layer->draw_properties().num_unclipped_descendants = | 1181 layer->draw_properties().num_unclipped_descendants = |
1184 recursive_data->num_unclipped_descendants; | 1182 recursive_data->num_unclipped_descendants; |
1185 layer->set_layer_or_descendant_has_input_handler( | 1183 layer->set_layer_or_descendant_has_input_handler( |
1186 (recursive_data->num_layer_or_descendants_with_input_handler != 0)); | 1184 (recursive_data->num_layer_or_descendants_with_input_handler != 0)); |
1187 // TODO(enne): this should be synced from the main thread, so is only | 1185 // TODO(enne): this should be synced from the main thread, so is only |
1188 // for tests constructing layers on the compositor thread. | 1186 // for tests constructing layers on the compositor thread. |
1189 layer->SetNumDescendantsThatDrawContent( | 1187 layer->SetNumDescendantsThatDrawContent( |
1190 recursive_data->num_descendants_that_draw_content); | 1188 recursive_data->num_descendants_that_draw_content); |
(...skipping 1642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2833 | 2831 |
2834 PropertyTrees* GetPropertyTrees(Layer* layer) { | 2832 PropertyTrees* GetPropertyTrees(Layer* layer) { |
2835 return layer->layer_tree_host()->property_trees(); | 2833 return layer->layer_tree_host()->property_trees(); |
2836 } | 2834 } |
2837 | 2835 |
2838 PropertyTrees* GetPropertyTrees(LayerImpl* layer) { | 2836 PropertyTrees* GetPropertyTrees(LayerImpl* layer) { |
2839 return layer->layer_tree_impl()->property_trees(); | 2837 return layer->layer_tree_impl()->property_trees(); |
2840 } | 2838 } |
2841 | 2839 |
2842 } // namespace cc | 2840 } // namespace cc |
OLD | NEW |