Skip to content
Commit f33d1634 authored by Riddle Hsu's avatar Riddle Hsu
Browse files

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
parent 58946d06
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