From 65fb1c6daa8234ddc9f2d06972efcb40a425522e Mon Sep 17 00:00:00 2001 From: YCairn Overturf Date: Mon, 24 Feb 2025 22:57:09 +0000 Subject: Add border API to surface control See go/sf-box-shadows-api for more details Bug: b/367464660 Flag: com.android.window.flags.enable_border_settings Test: atest SurfaceFlinger_test Change-Id: I1190edb97693004d9f46058fd0165451470a65b3 --- libs/gui/LayerState.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libs/gui/LayerState.cpp') diff --git a/libs/gui/LayerState.cpp b/libs/gui/LayerState.cpp index ad95d1a85a..86bc97e9d3 100644 --- a/libs/gui/LayerState.cpp +++ b/libs/gui/LayerState.cpp @@ -180,6 +180,7 @@ status_t layer_state_t::write(Parcel& output) const SAFE_PARCEL(output.writeParcelableVector, listener.callbackIds); } SAFE_PARCEL(output.writeFloat, shadowRadius); + SAFE_PARCEL(output.writeParcelable, borderSettings); SAFE_PARCEL(output.writeInt32, frameRateSelectionPriority); SAFE_PARCEL(output.writeFloat, frameRate); SAFE_PARCEL(output.writeByte, frameRateCompatibility); @@ -328,6 +329,8 @@ status_t layer_state_t::read(const Parcel& input) listeners.emplace_back(listener, callbackIds); } SAFE_PARCEL(input.readFloat, &shadowRadius); + SAFE_PARCEL(input.readParcelable, &borderSettings); + SAFE_PARCEL(input.readInt32, &frameRateSelectionPriority); SAFE_PARCEL(input.readFloat, &frameRate); SAFE_PARCEL(input.readByte, &frameRateCompatibility); @@ -727,6 +730,10 @@ void layer_state_t::merge(const layer_state_t& other) { what |= eShadowRadiusChanged; shadowRadius = other.shadowRadius; } + if (other.what & eBorderSettingsChanged) { + what |= eBorderSettingsChanged; + borderSettings = other.borderSettings; + } if (other.what & eLutsChanged) { what |= eLutsChanged; luts = other.luts; @@ -881,6 +888,7 @@ uint64_t layer_state_t::diff(const layer_state_t& other) const { CHECK_DIFF2(diff, eBackgroundColorChanged, other, bgColor, bgColorDataspace); if (other.what & eMetadataChanged) diff |= eMetadataChanged; CHECK_DIFF(diff, eShadowRadiusChanged, other, shadowRadius); + CHECK_DIFF(diff, eBorderSettingsChanged, other, borderSettings); CHECK_DIFF(diff, eDefaultFrameRateCompatibilityChanged, other, defaultFrameRateCompatibility); CHECK_DIFF(diff, eFrameRateSelectionPriority, other, frameRateSelectionPriority); CHECK_DIFF3(diff, eFrameRateChanged, other, frameRate, frameRateCompatibility, -- cgit v1.2.3-59-g8ed1b