diff options
| author | 2022-02-22 17:48:33 +0000 | |
|---|---|---|
| committer | 2022-05-04 11:46:47 -0500 | |
| commit | 67dd7126b52bf8ab25d89470392b887bccf0ad6f (patch) | |
| tree | c5afc1ef4838d1de70df6195fb25948e17a770a1 /libs/gui/LayerState.cpp | |
| parent | ff4b9b8d6c4e059b4ad6eefdb5d418fae45cf897 (diff) | |
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
Diffstat (limited to 'libs/gui/LayerState.cpp')
| -rw-r--r-- | libs/gui/LayerState.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libs/gui/LayerState.cpp b/libs/gui/LayerState.cpp index 3ab9e974bc..0d3b412842 100644 --- a/libs/gui/LayerState.cpp +++ b/libs/gui/LayerState.cpp @@ -66,6 +66,7 @@ layer_state_t::layer_state_t() fixedTransformHint(ui::Transform::ROT_INVALID), autoRefresh(false), isTrustedOverlay(false), + borderEnabled(false), bufferCrop(Rect::INVALID_RECT), destinationFrame(Rect::INVALID_RECT), dropInputMode(gui::DropInputMode::NONE) { @@ -100,7 +101,7 @@ status_t layer_state_t::write(Parcel& output) const SAFE_PARCEL(output.write, transparentRegion); SAFE_PARCEL(output.writeUint32, transform); SAFE_PARCEL(output.writeBool, transformToDisplayInverse); - + SAFE_PARCEL(output.writeBool, borderEnabled); SAFE_PARCEL(output.writeUint32, static_cast<uint32_t>(dataspace)); SAFE_PARCEL(output.write, hdrMetadata); SAFE_PARCEL(output.write, surfaceDamageRegion); @@ -200,6 +201,7 @@ status_t layer_state_t::read(const Parcel& input) SAFE_PARCEL(input.read, transparentRegion); SAFE_PARCEL(input.readUint32, &transform); SAFE_PARCEL(input.readBool, &transformToDisplayInverse); + SAFE_PARCEL(input.readBool, &borderEnabled); uint32_t tmpUint32 = 0; SAFE_PARCEL(input.readUint32, &tmpUint32); @@ -550,6 +552,10 @@ void layer_state_t::merge(const layer_state_t& other) { what |= eShadowRadiusChanged; shadowRadius = other.shadowRadius; } + if (other.what & eRenderBorderChanged) { + what |= eRenderBorderChanged; + borderEnabled = other.borderEnabled; + } if (other.what & eFrameRateSelectionPriority) { what |= eFrameRateSelectionPriority; frameRateSelectionPriority = other.frameRateSelectionPriority; |