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

Commit b79dcf1b authored by Cairn Overturf's avatar Cairn Overturf
Browse files

Draw box shadows using custom nine slicing

Previous drawRRect with blur paint had two limitations
1. It would only use nine slicing in the axis aligned case. None axis aligned fell back to multi pass blur
2. Nine slice source textures would be generated on-demand and cached. This also resulted in jank if all possible radii+sigma combinations were not enumerated during shader precaching.

This CL addresses these issues by doing nine slicing in all situations and computing a finite ste of corner radii + sigma combinations.
The benefit is that a much simpler shader is used (essentially just a single texture sample) and there are no GPU performance cliffs.
As a tradeoff, the requested corner radius is necessarily approximated. In my testing, the discrete set of shadow parameters is not perceivable.

Bug: 433558891, 253168053
Flag: com.android.wm.shell.enable_pip_box_shadows
Test: Test PiP and freeform window CUJs
Change-Id: I5f9c0b28d4c1721e32a8cbb1db53b2ae59252eed
parent 16141748
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment