diff options
author | 2024-11-14 23:06:27 +0000 | |
---|---|---|
committer | 2025-01-06 13:15:49 -0800 | |
commit | 9674ffa1d161cd04b20789b4a960dfafc8cc140c (patch) | |
tree | a26dff51e5f11557d18065fed0a86c40a1162fc8 /libs/gui/SurfaceComposerClient.cpp | |
parent | 9bf3e87d645649bc7f29a3e46d9cad090a6d2ce2 (diff) |
surfaceflinger: Add clientDrawnCornerRadius and clientDrawnShadowLength layer properties
Modify RoundedCornerState and ShadowSettings to account for client drawn corners and shadows. When equal to the requested values, SurfaceFlinger will not draw corners and shadows for the layer.
Bug: 375624570
Flag: com.android.window.flags.ignore_corner_radius_and_shadows
Test: atest SurfaceFlinger_test; manual test - PIP, freeform window, recents, app launch
Change-Id: Idde115b51a253a34cfadfbd1ff6c7b15c44518ef
Diffstat (limited to 'libs/gui/SurfaceComposerClient.cpp')
-rw-r--r-- | libs/gui/SurfaceComposerClient.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp index cabde22c6d..2beeae0201 100644 --- a/libs/gui/SurfaceComposerClient.cpp +++ b/libs/gui/SurfaceComposerClient.cpp @@ -1695,6 +1695,29 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setCorne return *this; } +SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setClientDrawnCornerRadius( + const sp<SurfaceControl>& sc, float clientDrawnCornerRadius) { + layer_state_t* s = getLayerState(sc); + if (!s) { + mStatus = BAD_INDEX; + return *this; + } + s->what |= layer_state_t::eClientDrawnCornerRadiusChanged; + s->clientDrawnCornerRadius = clientDrawnCornerRadius; + return *this; +} + +SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setClientDrawnShadowRadius( + const sp<SurfaceControl>& sc, float clientDrawnShadowRadius) { + layer_state_t* s = getLayerState(sc); + if (!s) { + mStatus = BAD_INDEX; + return *this; + } + s->what |= layer_state_t::eClientDrawnShadowsChanged; + s->clientDrawnShadowRadius = clientDrawnShadowRadius; + return *this; +} SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setBackgroundBlurRadius( const sp<SurfaceControl>& sc, int backgroundBlurRadius) { layer_state_t* s = getLayerState(sc); |