| 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 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 layer->set_num_unclipped_descendants( | 319 layer->set_num_unclipped_descendants( |
| 320 recursive_data->num_unclipped_descendants); | 320 recursive_data->num_unclipped_descendants); |
| 321 | 321 |
| 322 if (IsRootLayer(layer)) | 322 if (IsRootLayer(layer)) |
| 323 layer->layer_tree_host()->SetNeedsMetaInfoRecomputation(false); | 323 layer->layer_tree_host()->SetNeedsMetaInfoRecomputation(false); |
| 324 } | 324 } |
| 325 | 325 |
| 326 static void PreCalculateMetaInformationInternalForTesting( | 326 static void PreCalculateMetaInformationInternalForTesting( |
| 327 LayerImpl* layer, | 327 LayerImpl* layer, |
| 328 PreCalculateMetaInformationRecursiveData* recursive_data) { | 328 PreCalculateMetaInformationRecursiveData* recursive_data) { |
| 329 if (layer->clip_parent()) | 329 if (layer->test_properties()->clip_parent) |
| 330 recursive_data->num_unclipped_descendants++; | 330 recursive_data->num_unclipped_descendants++; |
| 331 | 331 |
| 332 if (!HasInvertibleOrAnimatedTransformForTesting(layer)) { | 332 if (!HasInvertibleOrAnimatedTransformForTesting(layer)) { |
| 333 // Layers with singular transforms should not be drawn, the whole subtree | 333 // Layers with singular transforms should not be drawn, the whole subtree |
| 334 // can be skipped. | 334 // can be skipped. |
| 335 return; | 335 return; |
| 336 } | 336 } |
| 337 | 337 |
| 338 for (size_t i = 0; i < layer->children().size(); ++i) { | 338 for (size_t i = 0; i < layer->children().size(); ++i) { |
| 339 LayerImpl* child_layer = layer->child_at(i); | 339 LayerImpl* child_layer = layer->child_at(i); |
| 340 | 340 |
| 341 PreCalculateMetaInformationRecursiveData data_for_child; | 341 PreCalculateMetaInformationRecursiveData data_for_child; |
| 342 PreCalculateMetaInformationInternalForTesting(child_layer, &data_for_child); | 342 PreCalculateMetaInformationInternalForTesting(child_layer, &data_for_child); |
| 343 recursive_data->Merge(data_for_child); | 343 recursive_data->Merge(data_for_child); |
| 344 } | 344 } |
| 345 | 345 |
| 346 if (layer->clip_children()) { | 346 if (layer->test_properties()->clip_children) { |
| 347 size_t num_clip_children = layer->clip_children()->size(); | 347 size_t num_clip_children = layer->test_properties()->clip_children->size(); |
| 348 DCHECK_GE(recursive_data->num_unclipped_descendants, num_clip_children); | 348 DCHECK_GE(recursive_data->num_unclipped_descendants, num_clip_children); |
| 349 recursive_data->num_unclipped_descendants -= num_clip_children; | 349 recursive_data->num_unclipped_descendants -= num_clip_children; |
| 350 } | 350 } |
| 351 | 351 |
| 352 if (layer->HasCopyRequest()) | 352 if (layer->HasCopyRequest()) |
| 353 recursive_data->num_layer_or_descendants_with_copy_request++; | 353 recursive_data->num_layer_or_descendants_with_copy_request++; |
| 354 | 354 |
| 355 if (!layer->touch_event_handler_region().IsEmpty()) | 355 if (!layer->touch_event_handler_region().IsEmpty()) |
| 356 recursive_data->num_layer_or_descendants_with_touch_handler++; | 356 recursive_data->num_layer_or_descendants_with_touch_handler++; |
| 357 | 357 |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 867 | 867 |
| 868 PropertyTrees* GetPropertyTrees(Layer* layer) { | 868 PropertyTrees* GetPropertyTrees(Layer* layer) { |
| 869 return layer->layer_tree_host()->property_trees(); | 869 return layer->layer_tree_host()->property_trees(); |
| 870 } | 870 } |
| 871 | 871 |
| 872 PropertyTrees* GetPropertyTrees(LayerImpl* layer) { | 872 PropertyTrees* GetPropertyTrees(LayerImpl* layer) { |
| 873 return layer->layer_tree_impl()->property_trees(); | 873 return layer->layer_tree_impl()->property_trees(); |
| 874 } | 874 } |
| 875 | 875 |
| 876 } // namespace cc | 876 } // namespace cc |
| OLD | NEW |