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 1065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1076 if (layer->clip_children()) { | 1076 if (layer->clip_children()) { |
1077 size_t num_clip_children = layer->clip_children()->size(); | 1077 size_t num_clip_children = layer->clip_children()->size(); |
1078 DCHECK_GE(recursive_data->num_unclipped_descendants, num_clip_children); | 1078 DCHECK_GE(recursive_data->num_unclipped_descendants, num_clip_children); |
1079 recursive_data->num_unclipped_descendants -= num_clip_children; | 1079 recursive_data->num_unclipped_descendants -= num_clip_children; |
1080 } | 1080 } |
1081 | 1081 |
1082 if (layer->HasCopyRequest()) | 1082 if (layer->HasCopyRequest()) |
1083 recursive_data->num_layer_or_descendants_with_copy_request++; | 1083 recursive_data->num_layer_or_descendants_with_copy_request++; |
1084 | 1084 |
1085 if (!layer->touch_event_handler_region().IsEmpty() || | 1085 if (!layer->touch_event_handler_region().IsEmpty() || |
1086 layer->have_wheel_event_handlers()) | 1086 layer->wheel_event_properties() != EventListenerProperties::NONE) |
1087 recursive_data->num_layer_or_descendants_with_input_handler++; | 1087 recursive_data->num_layer_or_descendants_with_input_handler++; |
1088 | 1088 |
1089 layer->set_num_unclipped_descendants( | 1089 layer->set_num_unclipped_descendants( |
1090 recursive_data->num_unclipped_descendants); | 1090 recursive_data->num_unclipped_descendants); |
1091 | 1091 |
1092 if (IsRootLayer(layer)) | 1092 if (IsRootLayer(layer)) |
1093 layer->layer_tree_host()->SetNeedsMetaInfoRecomputation(false); | 1093 layer->layer_tree_host()->SetNeedsMetaInfoRecomputation(false); |
1094 } | 1094 } |
1095 | 1095 |
1096 static void PreCalculateMetaInformationInternal( | 1096 static void PreCalculateMetaInformationInternal( |
(...skipping 27 matching lines...) Expand all Loading... |
1124 if (layer->clip_children()) { | 1124 if (layer->clip_children()) { |
1125 size_t num_clip_children = layer->clip_children()->size(); | 1125 size_t num_clip_children = layer->clip_children()->size(); |
1126 DCHECK_GE(recursive_data->num_unclipped_descendants, num_clip_children); | 1126 DCHECK_GE(recursive_data->num_unclipped_descendants, num_clip_children); |
1127 recursive_data->num_unclipped_descendants -= num_clip_children; | 1127 recursive_data->num_unclipped_descendants -= num_clip_children; |
1128 } | 1128 } |
1129 | 1129 |
1130 if (layer->HasCopyRequest()) | 1130 if (layer->HasCopyRequest()) |
1131 recursive_data->num_layer_or_descendants_with_copy_request++; | 1131 recursive_data->num_layer_or_descendants_with_copy_request++; |
1132 | 1132 |
1133 if (!layer->touch_event_handler_region().IsEmpty() || | 1133 if (!layer->touch_event_handler_region().IsEmpty() || |
1134 layer->have_wheel_event_handlers()) | 1134 layer->wheel_event_properties() != EventListenerProperties::NONE) |
1135 recursive_data->num_layer_or_descendants_with_input_handler++; | 1135 recursive_data->num_layer_or_descendants_with_input_handler++; |
1136 | 1136 |
1137 layer->draw_properties().num_unclipped_descendants = | 1137 layer->draw_properties().num_unclipped_descendants = |
1138 recursive_data->num_unclipped_descendants; | 1138 recursive_data->num_unclipped_descendants; |
1139 layer->set_layer_or_descendant_has_input_handler( | 1139 layer->set_layer_or_descendant_has_input_handler( |
1140 (recursive_data->num_layer_or_descendants_with_input_handler != 0)); | 1140 (recursive_data->num_layer_or_descendants_with_input_handler != 0)); |
1141 // TODO(enne): this should be synced from the main thread, so is only | 1141 // TODO(enne): this should be synced from the main thread, so is only |
1142 // for tests constructing layers on the compositor thread. | 1142 // for tests constructing layers on the compositor thread. |
1143 layer->SetNumDescendantsThatDrawContent( | 1143 layer->SetNumDescendantsThatDrawContent( |
1144 recursive_data->num_descendants_that_draw_content); | 1144 recursive_data->num_descendants_that_draw_content); |
(...skipping 1637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2782 | 2782 |
2783 PropertyTrees* GetPropertyTrees(Layer* layer) { | 2783 PropertyTrees* GetPropertyTrees(Layer* layer) { |
2784 return layer->layer_tree_host()->property_trees(); | 2784 return layer->layer_tree_host()->property_trees(); |
2785 } | 2785 } |
2786 | 2786 |
2787 PropertyTrees* GetPropertyTrees(LayerImpl* layer) { | 2787 PropertyTrees* GetPropertyTrees(LayerImpl* layer) { |
2788 return layer->layer_tree_impl()->property_trees(); | 2788 return layer->layer_tree_impl()->property_trees(); |
2789 } | 2789 } |
2790 | 2790 |
2791 } // namespace cc | 2791 } // namespace cc |
OLD | NEW |