summaryrefslogtreecommitdiff
path: root/libs/gui/BufferQueueThreadState.cpp
diff options
context:
space:
mode:
author Alec Mouri <alecmouri@google.com> 2024-09-28 23:46:58 +0000
committer Alec Mouri <alecmouri@google.com> 2024-09-30 18:05:26 +0000
commitda128516a50957900a3767a34be2baa149231b18 (patch)
tree8117ffa4c8d77710ecbd84b6a55c1440d36f827a /libs/gui/BufferQueueThreadState.cpp
parent322fb3b70d8151b984ed98b1909b9e0bd59e7601 (diff)
Extend shadow display frame by 2x shadow length instead of 1x
Some HWC implementations try to save bandwidth by scanning out the union of client composited display frames within the client target buffer. To prevent clipping shadows casted from a window, we expanded the displayFrame by the size of the shadow. But, in practice, shadows are blurred, so they fade out over more pixels than might be expected. So, expand the displayFrame by double the size of the shadow. 2x the shadow length is chosen, because: * The shadow length is converted to a sigma parameter for a gaussian blur by dividing by sqrt(3) * Skia's gaussian blur implementation bounds the blur 3 * sigma * So, casting a shadow should draw about sqrt(3) * length pixels beyond the edge of the window. * Round sqrt(3) up to 2, to be conservative This should be low risk change, as we're already forcing client composition for casting a shadow, so no HWC implementations ought to be inspecting the display frame except for the optimization described above, and this patch can only relax that optimization. Bug: 327427072 Flag: EXEMPT bug fix Test: Enable desktop windowing, and check that shadows aren't clipping Change-Id: Ia2d8b4a02aeab3cfeb9f2a01c08cc136cb221aea
Diffstat (limited to 'libs/gui/BufferQueueThreadState.cpp')
0 files changed, 0 insertions, 0 deletions