From 421ffb0be94bbacb4bed18524ea5f36695061e08 Mon Sep 17 00:00:00 2001 From: Sally Qi Date: Mon, 21 Mar 2022 19:41:33 -0700 Subject: [SurfaceFlinger] Disable HDR dimming when screen rotates. - Disable dimming for screenshot layer Bug: 224860402 Test: check HDR vidoes when rotation, atest libcompositionengine_test Change-Id: Ib07a5af1d4e3e91737b3d5f3e5869c166759563f --- libs/gui/LayerState.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libs/gui/LayerState.cpp') diff --git a/libs/gui/LayerState.cpp b/libs/gui/LayerState.cpp index 49b669eb3f..9d4d99fddc 100644 --- a/libs/gui/LayerState.cpp +++ b/libs/gui/LayerState.cpp @@ -134,6 +134,7 @@ status_t layer_state_t::write(Parcel& output) const SAFE_PARCEL(output.writeByte, changeFrameRateStrategy); SAFE_PARCEL(output.writeUint32, fixedTransformHint); SAFE_PARCEL(output.writeBool, autoRefresh); + SAFE_PARCEL(output.writeBool, dimmingEnabled); SAFE_PARCEL(output.writeUint32, blurRegions.size()); for (auto region : blurRegions) { @@ -243,6 +244,7 @@ status_t layer_state_t::read(const Parcel& input) SAFE_PARCEL(input.readUint32, &tmpUint32); fixedTransformHint = static_cast(tmpUint32); SAFE_PARCEL(input.readBool, &autoRefresh); + SAFE_PARCEL(input.readBool, &dimmingEnabled); uint32_t numRegions = 0; SAFE_PARCEL(input.readUint32, &numRegions); @@ -598,6 +600,10 @@ void layer_state_t::merge(const layer_state_t& other) { what |= eColorSpaceAgnosticChanged; colorSpaceAgnostic = other.colorSpaceAgnostic; } + if (other.what & eDimmingEnabledChanged) { + what |= eDimmingEnabledChanged; + dimmingEnabled = other.dimmingEnabled; + } if ((other.what & what) != other.what) { ALOGE("Unmerged SurfaceComposer Transaction properties. LayerState::merge needs updating? " "other.what=0x%" PRIX64 " what=0x%" PRIX64 " unmerged flags=0x%" PRIX64, -- cgit v1.2.3-59-g8ed1b