Don't use GL_SRGB for premultiplied textures

GL_SRGB is doing postmultiplied alpha, so if the texture is
premultiplied, we can't use this optimization.

The optimization still works for unpremultiplied and opaque images,
because those don't do that step.
This commit is contained in:
Benjamin Otte 2024-07-06 13:29:09 +02:00
parent b801eae00f
commit ad757cccb6

View File

@ -301,10 +301,14 @@ gsk_gpu_upload_texture_op_try (GskGpuFrame *frame,
{
GskGpuUploadTextureOp *self;
GskGpuImage *image;
GdkMemoryFormat format;
format = gdk_texture_get_format (texture);
image = gsk_gpu_device_create_upload_image (gsk_gpu_frame_get_device (frame),
with_mipmap,
gdk_texture_get_format (texture),
format,
gdk_memory_format_alpha (format) != GDK_MEMORY_ALPHA_PREMULTIPLIED &&
gdk_color_state_get_no_srgb_tf (gdk_texture_get_color_state (texture)) != NULL,
gdk_texture_get_width (texture),
gdk_texture_get_height (texture));