summaryrefslogtreecommitdiff
path: root/libs/androidfw/StringPool.cpp
diff options
context:
space:
mode:
author Aurélien Pomini <pomini@google.com> 2024-04-03 14:46:29 +0000
committer Aurélien Pomini <pomini@google.com> 2024-04-09 15:29:29 +0000
commit67f87795ef4a89fc0c3748b41c950b0ef74db3b7 (patch)
tree563967c0518ac49478499cf433354884a7beedc4 /libs/androidfw/StringPool.cpp
parent7dca5acb828f5ad978494275be26ff2114e6b9d6 (diff)
Improve the wallpaper crop & rescale logic
The current crop/rescale logic is... weird. See the associated bug for moe details. Instead, let's do the following: - if all crops for all orientations have more height in px than their associated screen, downsample the image - if the "total crop" width or height is more than twice the screen largest dimension or the max openGL texture size, downsample (note: "twice" is to let room for parallax, or to let have a too high res image (to some extent) as long as the crops are low res. This is more a security check and should not be used in practice.) Also, move from using ImageDecoder.decodeBitmap() with sampleSize then Bitmap.createScaledBitmap, to using ImageDecoder.decodeBitmap() with targetSize, which should reduce the amount of IO. Test: manual Test: atest WallpaperManagerTest, WallpaperCropperTest Bug: 332695334 Flag: aconfig com.android.window.flags.multi_crop Change-Id: I68f1b48d136c4942880fc55e79cbbf7a16763b66
Diffstat (limited to 'libs/androidfw/StringPool.cpp')
0 files changed, 0 insertions, 0 deletions