Chromium Code Reviews| Index: cc/trees/layer_tree_host_common.cc |
| diff --git a/cc/trees/layer_tree_host_common.cc b/cc/trees/layer_tree_host_common.cc |
| index 2af828a6b0617878b88c5e513850892128fd874d..9c68c521cdcac117d5fe8b8ed84447f886cd798d 100644 |
| --- a/cc/trees/layer_tree_host_common.cc |
| +++ b/cc/trees/layer_tree_host_common.cc |
| @@ -769,10 +769,15 @@ static inline void RemoveSurfaceForEarlyExit( |
| } |
| struct PreCalculateMetaInformationRecursiveData { |
| - bool layer_or_descendent_has_copy_request; |
| + bool layer_or_descendant_has_copy_request; |
| PreCalculateMetaInformationRecursiveData() |
| - : layer_or_descendent_has_copy_request(false) {} |
| + : layer_or_descendant_has_copy_request(false) {} |
| + |
| + void Merge(const PreCalculateMetaInformationRecursiveData& data) { |
| + layer_or_descendant_has_copy_request |= |
| + data.layer_or_descendant_has_copy_request; |
| + } |
| }; |
| // Recursively walks the layer tree to compute any information that is needed |
| @@ -797,7 +802,9 @@ static void PreCalculateMetaInformation( |
| for (size_t i = 0; i < layer->children().size(); ++i) { |
| LayerType* child_layer = |
| LayerTreeHostCommon::get_child_as_raw_ptr(layer->children(), i); |
| - PreCalculateMetaInformation<LayerType>(child_layer, recursive_data); |
| + |
| + PreCalculateMetaInformationRecursiveData data_for_child; |
| + PreCalculateMetaInformation<LayerType>(child_layer, &data_for_child); |
|
piman
2013/07/11 23:18:25
nit: no need for <LayerType> since it'll guess the
danakj
2013/07/12 18:48:05
Done.
|
| if (!has_delegated_content) { |
| bool sublayer_transform_prevents_clip = |
| @@ -813,17 +820,19 @@ static void PreCalculateMetaInformation( |
| !child_layer->transform().IsPositiveScaleOrTranslation()) |
| descendants_can_clip_selves = false; |
| } |
| + |
| + recursive_data->Merge(data_for_child); |
| } |
| if (layer->HasCopyRequest()) |
| - recursive_data->layer_or_descendent_has_copy_request = true; |
| + recursive_data->layer_or_descendant_has_copy_request = true; |
| layer->draw_properties().num_descendants_that_draw_content = |
| num_descendants_that_draw_content; |
| layer->draw_properties().descendants_can_clip_selves = |
| descendants_can_clip_selves; |
| layer->draw_properties().layer_or_descendant_has_copy_request = |
| - recursive_data->layer_or_descendent_has_copy_request; |
| + recursive_data->layer_or_descendant_has_copy_request; |
| } |
| static void RoundTranslationComponents(gfx::Transform* transform) { |