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/renderengine/skia/SkiaGLRenderEngine.cpp b/libs/renderengine/skia/SkiaGLRenderEngine.cpp
index ec9ad54..c9f9ec3 100644
--- a/libs/renderengine/skia/SkiaGLRenderEngine.cpp
+++ b/libs/renderengine/skia/SkiaGLRenderEngine.cpp
@@ -1247,15 +1247,11 @@
}
for (const auto& borderRenderInfo : display.borderInfoList) {
SkPaint p;
- // TODO (b/225977175): Use specified color
- p.setColor(SkColor4f{.fR = 255 / 255.0f,
- .fG = 128 / 255.0f,
- .fB = 0 / 255.0f,
- .fA = 255 / 255.0f});
+ p.setColor(SkColor4f{borderRenderInfo.color.r, borderRenderInfo.color.g,
+ borderRenderInfo.color.b, borderRenderInfo.color.a});
p.setAntiAlias(true);
p.setStyle(SkPaint::kStroke_Style);
- // TODO (b/225977175): Use specified width
- p.setStrokeWidth(20);
+ p.setStrokeWidth(borderRenderInfo.width);
SkRegion sk_region;
SkPath path;