From 9674ffa1d161cd04b20789b4a960dfafc8cc140c Mon Sep 17 00:00:00 2001 From: Surbhi Kadam Date: Thu, 14 Nov 2024 23:06:27 +0000 Subject: 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 --- libs/gui/SurfaceComposerClient.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'libs/gui/SurfaceComposerClient.cpp') 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& 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& 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& sc, int backgroundBlurRadius) { layer_state_t* s = getLayerState(sc); -- cgit v1.2.3-59-g8ed1b