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
Loading
Please register or sign in to comment