Allow using custom widths and colors for layer borders.
Update the enableBorder API in SurfaceComposerClient so
that width and color can be specified for the border.
The information propagates through the pipe all the
way to the render engine so it can render the correct color
and width for the border
Test:go/wm-smoke.
Test: LayerBorder_test
Bug: 226529222
Change-Id: Id3ab853d5b4d6899a915f729b0d7be701cb5b167
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp
index caab506..6fc813b 100644
--- a/libs/gui/SurfaceComposerClient.cpp
+++ b/libs/gui/SurfaceComposerClient.cpp
@@ -1940,7 +1940,7 @@
}
SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::enableBorder(
- const sp<SurfaceControl>& sc, bool shouldEnable) {
+ const sp<SurfaceControl>& sc, bool shouldEnable, float width, const half4& color) {
layer_state_t* s = getLayerState(sc);
if (!s) {
mStatus = BAD_INDEX;
@@ -1949,6 +1949,8 @@
s->what |= layer_state_t::eRenderBorderChanged;
s->borderEnabled = shouldEnable;
+ s->borderWidth = width;
+ s->borderColor = color;
registerSurfaceControlForCallback(sc);
return *this;