Add automatically generated mipmaps to smallest mipmap level to improve tiny image quality

This commit is contained in:
Yousef Khadadeh 2026-02-20 00:01:28 +03:00
parent e20ae17759
commit 5d1b7678f0
2 changed files with 5 additions and 2 deletions

View file

@ -28,6 +28,7 @@ class ImageResourceDisplay : public ResourceDisplay {
// Mipmap level calculation is done using the smaller dimension, not the bigger one, to ensure that the dimensions are never invalid
std::vector<sk_sp<SkImage>> mipmapLevels;
sk_sp<SkImage> smallestMipmapLevel; // Smaller dimension of this should be around SMALLEST_MIPMAP_RESOLUTION pixels. Is always allocated and used when cachedMipmapLevel is unavailable or when the image is viewed from far away
// Has auto generated mipmaps
float duration = -1.0f;
};