From: Matthias Clasen Date: Wed, 31 May 2023 18:33:52 +0000 (-0400) Subject: gsk: Support straight alpha textures X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~1^2~197^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=957fa87fce32b4545dddc73b54c70c2ce9e52961;p=gtk4.git gsk: Support straight alpha textures This is not the optimal way of doing it: we're reuploading the texture with client-side conversion. But it fits nicely into our current handling of mipmaps. We can do better once we use shaders for colorspace conversions. --- diff --git a/gsk/gl/gskgldriver.c b/gsk/gl/gskgldriver.c index dec77c947a..cc27a89ef6 100644 --- a/gsk/gl/gskgldriver.c +++ b/gsk/gl/gskgldriver.c @@ -761,7 +761,8 @@ gsk_gl_driver_load_texture (GskGLDriver *self, GdkGLContext *texture_context = gdk_gl_texture_get_context (gl_texture); if (gdk_gl_context_is_shared (context, texture_context) && - (!ensure_mipmap || gdk_gl_texture_has_mipmap (gl_texture))) + (!ensure_mipmap || gdk_gl_texture_has_mipmap (gl_texture)) && + gdk_memory_format_alpha (gdk_texture_get_format (texture)) != GDK_MEMORY_ALPHA_STRAIGHT) { /* A GL texture from the same GL context is a simple task... */ return gdk_gl_texture_get_id (gl_texture);