gltexture: Rewrite downloading code
authorMatthias Clasen <mclasen@redhat.com>
Mon, 29 May 2023 16:51:22 +0000 (12:51 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 30 May 2023 19:57:18 +0000 (15:57 -0400)
commit1c72f46eed18e5f00af4dfca905973d8711e1e3d
treea691677eeab108a7952c2d47104300d2ebd8bd1a
parent0f61c52593f963f773cd630735350f75ceece86f
gltexture: Rewrite downloading code

For non-gles, make it handle unpremultiplied formats,
and everything else, by downloading the texture in its
preferred format and, in most cases, doing a
gdk_memory_convert afterwards.

For gles, keep using glReadPixels, but handle cases
where the gl read format doesn't match the texture
format by doing the necessary swizzling before calling
gdk_memory_convert.
gdk/gdkgltexture.c