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

Unified Diff: cc/trees/layer_tree_host_common.cc

Issue 19075002: cc: layer_or_descendant_has_copy_request is inherited by siblings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: copy-output-request-sibling-inherits: templatez Created 7 years, 5 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
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..405652a1ae52f9232777dcd6c3dfe2dd9a0c492e 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(child_layer, &data_for_child);
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) {
@@ -1609,7 +1618,7 @@ void LayerTreeHostCommon::CalculateDrawProperties(
DCHECK(IsRootLayer(root_layer));
PreCalculateMetaInformationRecursiveData recursive_data;
- PreCalculateMetaInformation<Layer>(root_layer, &recursive_data);
+ PreCalculateMetaInformation(root_layer, &recursive_data);
CalculateDrawPropertiesInternal<Layer, LayerList, RenderSurface>(
root_layer,
@@ -1670,7 +1679,7 @@ void LayerTreeHostCommon::CalculateDrawProperties(
DCHECK(IsRootLayer(root_layer));
PreCalculateMetaInformationRecursiveData recursive_data;
- PreCalculateMetaInformation<LayerImpl>(root_layer, &recursive_data);
+ PreCalculateMetaInformation(root_layer, &recursive_data);
CalculateDrawPropertiesInternal<LayerImpl,
LayerImplList,
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698