Correctly compute diffWidth and diffHeight.
The previous calculation was wrong and lead to less parallax than
expected in some cases. This is the OP part of the CL.
Also, this CL makes sure we scale by width if the crop is
proportionally taller than the screen: this way, the window will always
be filled with content (and could support vertical parallax).
Note that given our implementation of WallpaperCropper, the wallpaper
is always wide enough for the screen, so we always scale by height
(make the wallpaper match the screen height) and only have horizontal
parallax.
A honest alternative would be to remove (under flag) the whole logic
for vertical parallax.
Flag: aconfig com.android.window.flags.multi_crop DEVELOPMENT
Test: atest WallpaperControllerTest
Bug: 327042053
Change-Id: I8aac1b0d4b85fed0a446aed794fdb525b21d8e3a
1 file changed