Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit a49deeee authored by Leon Scroggins III's avatar Leon Scroggins III
Browse files

ScreenDecorHwcLayer: better debugging for the transparent region

When DEBUG_COLOR is set, the ScreenDecorHwcLayer becomes a full color
buffer (instead of A8) and draws green for the cutouts and transparent
green for the transparent region. But the old method calculated the
transparent region during every draw call, which doesn't match how it
happens when we actually set the transparent region. Instead, do the
following:

Always call requestTransparentRegion in onAttachedToWindow. This means
that gatherTransparentRegion will be called to calculate the transparent
region. Do *not* call calculateTransparentRect in onDraw, which would
update the rect. The final result is that onDraw will draw using the
rect computed for passing to native.

When DEBUG_COLOR is set, still compute the rect in
gatherTransparentRegion, but set the region to empty. The method is
supposed to remove parts of the Region that are not transparent, and
with the debug drawing, it essentially draws everywhere.

Only call setDisplayDecoration when !DEBUG_COLOR. With DEBUG_COLOR set,
we cannot take advantage of DISPLAY_DECORATION layers anyway.

Bug: 225212638
Test: debug.screenshot_rounded_corners
Change-Id: Ic91d3b22e5c5d768cc1c6f1f8baefe1546ac2006
parent bce590e3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment