Merge "Add visible region to list of visibility reasons" into sc-dev am: 0c7313d8c7

Original change: https://googleplex-android-review.googlesource.com/c/platform/development/+/13589847

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I11e4fe8de5c41619941cfd2281c1cf5df38bec8f
This commit is contained in:
TreeHugger Robot
2021-02-17 09:22:13 +00:00
committed by Automerger Merge Worker

View File

@@ -144,7 +144,7 @@ function is_visible(layer, hiddenByPolicy, includesCompositionState) {
return true;
}
function get_visibility_reason(layer) {
function get_visibility_reason(layer, includesCompositionState) {
if (layer.type === 'ContainerLayer') {
return 'ContainerLayer';
}
@@ -193,6 +193,10 @@ function get_visibility_reason(layer) {
return 'Layer is occluded by:' + layer.occludedBy.join();
}
if (includesCompositionState && is_empty(layer.visibleRegion)) {
return 'Visible region calculated by Composition Engine is empty';
}
if (layer.visible) {
return 'Unknown';
};
@@ -256,7 +260,7 @@ function fill_occlusion_state(layerMap, rootLayers, includesCompositionState) {
layer.visible = is_visible(layer, layer.hidden, includesCompositionState);
if (!layer.visible) {
layer.invisibleDueTo = get_visibility_reason(layer);
layer.invisibleDueTo = get_visibility_reason(layer, includesCompositionState);
}
});
}