summaryrefslogtreecommitdiff
path: root/libs/gui/LayerState.cpp
diff options
context:
space:
mode:
author John Reck <jreck@google.com> 2023-01-25 13:47:12 -0500
committer John Reck <jreck@google.com> 2023-01-25 17:19:47 -0500
commit6879659d589a17d362f91bba4bec5737504a75e7 (patch)
tree5b7dc6d0fa14fe1fbd925854c760b75841f9231b /libs/gui/LayerState.cpp
parent6caf98c5d0033ad009ae822fb22ddb5802aa5e03 (diff)
Add extended brightness range impl
Bug: 241001465 Test: manual currently, flagged off Change-Id: I707281b9acaf6ea218f1d9ce888fc7cdbf1cf7c9
Diffstat (limited to 'libs/gui/LayerState.cpp')
-rw-r--r--libs/gui/LayerState.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/libs/gui/LayerState.cpp b/libs/gui/LayerState.cpp
index 43acb16299..8372363185 100644
--- a/libs/gui/LayerState.cpp
+++ b/libs/gui/LayerState.cpp
@@ -187,6 +187,8 @@ status_t layer_state_t::write(Parcel& output) const
}
SAFE_PARCEL(output.writeParcelable, trustedPresentationThresholds);
SAFE_PARCEL(output.writeParcelable, trustedPresentationListener);
+ SAFE_PARCEL(output.writeFloat, currentSdrHdrRatio);
+ SAFE_PARCEL(output.writeFloat, desiredSdrHdrRatio);
return NO_ERROR;
}
@@ -321,6 +323,11 @@ status_t layer_state_t::read(const Parcel& input)
SAFE_PARCEL(input.readParcelable, &trustedPresentationThresholds);
SAFE_PARCEL(input.readParcelable, &trustedPresentationListener);
+ SAFE_PARCEL(input.readFloat, &tmpFloat);
+ currentSdrHdrRatio = tmpFloat;
+ SAFE_PARCEL(input.readFloat, &tmpFloat);
+ desiredSdrHdrRatio = tmpFloat;
+
return NO_ERROR;
}
@@ -568,6 +575,11 @@ void layer_state_t::merge(const layer_state_t& other) {
what |= eDataspaceChanged;
dataspace = other.dataspace;
}
+ if (other.what & eExtendedRangeBrightnessChanged) {
+ what |= eExtendedRangeBrightnessChanged;
+ desiredSdrHdrRatio = other.desiredSdrHdrRatio;
+ currentSdrHdrRatio = other.currentSdrHdrRatio;
+ }
if (other.what & eHdrMetadataChanged) {
what |= eHdrMetadataChanged;
hdrMetadata = other.hdrMetadata;
@@ -714,6 +726,8 @@ uint64_t layer_state_t::diff(const layer_state_t& other) const {
CHECK_DIFF(diff, eCropChanged, other, crop);
if (other.what & eBufferChanged) diff |= eBufferChanged;
CHECK_DIFF(diff, eDataspaceChanged, other, dataspace);
+ CHECK_DIFF2(diff, eExtendedRangeBrightnessChanged, other, currentSdrHdrRatio,
+ desiredSdrHdrRatio);
CHECK_DIFF(diff, eHdrMetadataChanged, other, hdrMetadata);
if (other.what & eSurfaceDamageRegionChanged &&
(!surfaceDamageRegion.hasSameRects(other.surfaceDamageRegion))) {