| 46 | } |
| 47 | |
| 48 | QPixmap TexturePack::image(QSize size) |
| 49 | { |
| 50 | QPixmap cached_image; |
| 51 | if (QPixmapCache::find(m_pack_image_cache_key.key, &cached_image)) { |
| 52 | if (size.isNull()) |
| 53 | return cached_image; |
| 54 | return cached_image.scaled(size); |
| 55 | } |
| 56 | |
| 57 | // No valid image we can get |
| 58 | if (!m_pack_image_cache_key.was_ever_used) |
| 59 | return {}; |
| 60 | |
| 61 | // Imaged got evicted from the cache. Re-process it and retry. |
| 62 | TexturePackUtils::process(*this); |
| 63 | return image(size); |
| 64 | } |
no test coverage detected