Internal cleanup in the GL renderer

Separate the image cache from the texture cache.
The latter needs additional data in the key. The two have less in common that it seemed.

This also fixes a small issue with `CachedImage::upload_to_gpu` that for
SVGs would return a decoded (rendered) SVG image, instead of a texture.
That was harmless because we always call `ensure_uploaded_to_gpu`
later, but now we assert that the texture cache only holds textures,
because clear() (former remove_textures()) just clears everything.
This commit is contained in:
Simon Hausmann 2021-12-10 17:26:58 +01:00 committed by Simon Hausmann
parent 6bc69c2fe9
commit 2dae2a01d2
3 changed files with 71 additions and 25 deletions

View file

@ -902,7 +902,7 @@ impl GLItemRenderer {
let image = source_property.get();
let image_inner = (&image).into();
ImageCacheKey::new(image_inner, Some(image_rendering))
TextureCacheKey::new(image_inner, image_rendering)
.and_then(|cache_key| {
self.graphics_window
.texture_cache