diff options
| author | 2022-10-14 20:27:47 +0800 | |
|---|---|---|
| committer | 2022-10-21 18:31:14 +0800 | |
| commit | f33d16345750bca2927fa9a6aedaeec6a30ef1bb (patch) | |
| tree | 356a1e4135656e35406a842559d02613aa9382a8 /libs/androidfw/ConfigDescription.cpp | |
| parent | 58946d06cc6300044827f0a6ef401b74979aa02f (diff) | |
Optimize luminance calculation for rotation animation
- Apply sampling for the border to reduce the amonut of pixel
for calculating luminance.
- Use getInt to get color rather than get a byte 4 times.
- Use a simpler formula to approximate luminance.
- Replace median with mode to represent the luminance. It is more
efficient (no need sort) and the visual result may be better if
the distribution is U-shaped.
- Extract common code to policy package to reduce duplicated
code in system server and shell.
The calculation is 10 times faster for the first execution,
and 5 times faster on average.
Bug: 253610885
Test: atest RotationAnimationUtilsTest
Change-Id: Ieca9968e843b68d733e178edd725b628c542e872
Diffstat (limited to 'libs/androidfw/ConfigDescription.cpp')
0 files changed, 0 insertions, 0 deletions