qt: keep placeholder images in VRAM for instantenous rendering
Placeholder images must load fast, here I propose that we load one large copy of placeholder images as a texture and keep in the video memory.
The advantages:
-
Not needing to load placeholder image from the disk when the resolution changes, but aspect ratio remains the same. I make use of GPU linear filtering for down-scaling.Not done anymore. - Not needing to create a texture from image again and again (no RAM -> VRAM upload).
- Not needing to create multiple textures for each instance of the placeholder image (here, multiple items in the UI will use the same texture. Often times items within a view use the same placeholder texture)
- Not needing to exhaust the limited atlas texture with placeholders. Atlas should be preserved for more important textures. It is also not clear if Qt properly purges the textures from the atlas when the actual textures arrive (to put them in) that the placeholders stand for.
Edited by Fatih Uzunoğlu