Enable drawing layers' borders in SurfaceFlinger.
Provide an API on SurfaceComposerClient::Transaction for enabling
a border to be drawn for a specified hierarchy. The caller requests a
border to be drawn at a certain Layer and all its children will be
included when computing the visible region. The border will draw around
the union of all the layers' visible regions, starting from the
requested layer.
Test: go/wm-smoke
Test: LayerBorder_test
Bug: 225977175
Change-Id: I7760b51b68cdf01bb9146ec91a270a9d63927995
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index ff18fd0..85187e1 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -895,6 +895,8 @@
bool setStretchEffect(const StretchEffect& effect);
StretchEffect getStretchEffect() const;
+ bool enableBorder(bool shouldEnable);
+ bool isBorderEnabled();
virtual bool setBufferCrop(const Rect& /* bufferCrop */) { return false; }
virtual bool setDestinationFrame(const Rect& /* destinationFrame */) { return false; }
@@ -1143,7 +1145,10 @@
bool mIsAtRoot = false;
uint32_t mLayerCreationFlags;
+
bool findInHierarchy(const sp<Layer>&);
+
+ bool mBorderEnabled = false;
};
std::ostream& operator<<(std::ostream& stream, const Layer::FrameRate& rate);