diff options
author | 2024-01-29 10:26:21 -0800 | |
---|---|---|
committer | 2024-01-29 23:34:12 +0000 | |
commit | 59a6be3c5d547a02850bf486cfe1036f4008df83 (patch) | |
tree | b6ee4ce0fc04d354695b8a71548d265dd2ab76e8 /libs/gui/LayerState.cpp | |
parent | ca103c0ad43e964d46be8de5fb1313292655c98c (diff) |
Introduce eCanOccludePresentation layer flag
Sets a property on a layer hierarchy indicating that its visible region
should be considered when computing TrustedPresentation
Thresholds. This property is set on a layer and inherited by all its
children. The property is then passed via windowinfos so the
TrustedPresentation controller can determine which windows to
use when computing the thresholds.
Test: presubmit
Bug: b/275574214
Change-Id: Ide384c64cb7b5a9b2b3ce293b20e2be64da8ad69
Diffstat (limited to 'libs/gui/LayerState.cpp')
-rw-r--r-- | libs/gui/LayerState.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libs/gui/LayerState.cpp b/libs/gui/LayerState.cpp index 38fab9cdaa..7564c26316 100644 --- a/libs/gui/LayerState.cpp +++ b/libs/gui/LayerState.cpp @@ -199,7 +199,7 @@ status_t layer_state_t::write(Parcel& output) const SAFE_PARCEL(output.writeParcelable, trustedPresentationListener); SAFE_PARCEL(output.writeFloat, currentHdrSdrRatio); SAFE_PARCEL(output.writeFloat, desiredHdrSdrRatio); - SAFE_PARCEL(output.writeInt32, static_cast<int32_t>(cachingHint)) + SAFE_PARCEL(output.writeInt32, static_cast<int32_t>(cachingHint)); return NO_ERROR; } @@ -484,6 +484,12 @@ void layer_state_t::sanitize(int32_t permissions) { flags &= ~eLayerIsDisplayDecoration; ALOGE("Stripped attempt to set LayerIsDisplayDecoration in sanitize"); } + if ((mask & eCanOccludePresentation) && + !(permissions & Permission::ACCESS_SURFACE_FLINGER)) { + flags &= ~eCanOccludePresentation; + mask &= ~eCanOccludePresentation; + ALOGE("Stripped attempt to set eCanOccludePresentation in sanitize"); + } } if (what & layer_state_t::eInputInfoChanged) { |