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.h b/services/surfaceflinger/Layer.h
index 85187e1..60c97f9 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -895,8 +895,10 @@
bool setStretchEffect(const StretchEffect& effect);
StretchEffect getStretchEffect() const;
- bool enableBorder(bool shouldEnable);
+ bool enableBorder(bool shouldEnable, float width, const half4& color);
bool isBorderEnabled();
+ float getBorderWidth();
+ const half4& getBorderColor();
virtual bool setBufferCrop(const Rect& /* bufferCrop */) { return false; }
virtual bool setDestinationFrame(const Rect& /* destinationFrame */) { return false; }
@@ -1149,6 +1151,8 @@
bool findInHierarchy(const sp<Layer>&);
bool mBorderEnabled = false;
+ float mBorderWidth;
+ half4 mBorderColor;
};
std::ostream& operator<<(std::ostream& stream, const Layer::FrameRate& rate);