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/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index d47e423..2d3b237 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -1157,11 +1157,13 @@
     return StretchEffect{};
 }
 
-bool Layer::enableBorder(bool shouldEnable) {
-    if (mBorderEnabled == shouldEnable) {
+bool Layer::enableBorder(bool shouldEnable, float width, const half4& color) {
+    if (mBorderEnabled == shouldEnable && mBorderWidth == width && mBorderColor == color) {
         return false;
     }
     mBorderEnabled = shouldEnable;
+    mBorderWidth = width;
+    mBorderColor = color;
     return true;
 }
 
@@ -1169,6 +1171,14 @@
     return mBorderEnabled;
 }
 
+float Layer::getBorderWidth() {
+    return mBorderWidth;
+}
+
+const half4& Layer::getBorderColor() {
+    return mBorderColor;
+}
+
 bool Layer::propagateFrameRateForLayerTree(FrameRate parentFrameRate, bool* transactionNeeded) {
     // The frame rate for layer tree is this layer's frame rate if present, or the parent frame rate
     const auto frameRate = [&] {