diff options
author | 2025-02-24 22:57:09 +0000 | |
---|---|---|
committer | 2025-03-19 17:03:06 +0000 | |
commit | 65fb1c6daa8234ddc9f2d06972efcb40a425522e (patch) | |
tree | 8e67e9ea0b82d2393df31ef51477a1b8fe81bc75 /libs/gui/LayerState.cpp | |
parent | 2dc2afe2e0210dd42d80136ca425aed51ae69d4a (diff) |
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
Diffstat (limited to 'libs/gui/LayerState.cpp')
-rw-r--r-- | libs/gui/LayerState.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
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, |