summaryrefslogtreecommitdiff
path: root/libs/gui/LayerState.cpp
diff options
context:
space:
mode:
author Xin Li <delphij@google.com> 2024-06-14 10:46:06 -0700
committer Xin Li <delphij@google.com> 2024-06-14 10:46:06 -0700
commitfd63570c39c1c327fe015148467401dfb351a965 (patch)
tree0ebb93cf07d2b6ac2fc16c91db7006764dfead3e /libs/gui/LayerState.cpp
parentebe488b67cf38fb23c1da36c220bd35ee64dde56 (diff)
parent068476a119f551bdc80e0d3dbad0bebe116d127f (diff)
Merge Android 14 QPR3 to AOSP main
Bug: 346855327 Merged-In: Icba8588a9f7047e673b271065553c5c2861ecaac Change-Id: I1bd780c35ada6b873ae8c4c64f69573f4ef1f378
Diffstat (limited to 'libs/gui/LayerState.cpp')
-rw-r--r--libs/gui/LayerState.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/libs/gui/LayerState.cpp b/libs/gui/LayerState.cpp
index 38fab9cdaa..1e0aacddab 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) {
@@ -605,6 +611,10 @@ void layer_state_t::merge(const layer_state_t& other) {
desiredHdrSdrRatio = other.desiredHdrSdrRatio;
currentHdrSdrRatio = other.currentHdrSdrRatio;
}
+ if (other.what & eDesiredHdrHeadroomChanged) {
+ what |= eDesiredHdrHeadroomChanged;
+ desiredHdrSdrRatio = other.desiredHdrSdrRatio;
+ }
if (other.what & eCachingHintChanged) {
what |= eCachingHintChanged;
cachingHint = other.cachingHint;
@@ -768,6 +778,7 @@ uint64_t layer_state_t::diff(const layer_state_t& other) const {
CHECK_DIFF(diff, eDataspaceChanged, other, dataspace);
CHECK_DIFF2(diff, eExtendedRangeBrightnessChanged, other, currentHdrSdrRatio,
desiredHdrSdrRatio);
+ CHECK_DIFF(diff, eDesiredHdrHeadroomChanged, other, desiredHdrSdrRatio);
CHECK_DIFF(diff, eCachingHintChanged, other, cachingHint);
CHECK_DIFF(diff, eHdrMetadataChanged, other, hdrMetadata);
if (other.what & eSurfaceDamageRegionChanged &&