diff --git a/gsk/gl/gskglrenderjob.c b/gsk/gl/gskglrenderjob.c index 19768662d7..0461cb8899 100644 --- a/gsk/gl/gskglrenderjob.c +++ b/gsk/gl/gskglrenderjob.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -989,11 +990,23 @@ gsk_gl_render_job_update_clip (GskGLRenderJob *job, return TRUE; } +/* Convert from sRGB floats to linear sRGB half-floats */ static inline void rgba_to_half (const GdkRGBA *rgba, guint16 h[4]) { - float_to_half4 ((const float *)rgba, h); + GdkRGBA d; + gdk_memory_convert ((guchar *) &d, + sizeof (float) * 4, + GDK_MEMORY_R32G32B32A32_FLOAT, + gdk_color_profile_get_srgb_linear (), + (guchar *) rgba, + sizeof (float) * 4, + GDK_MEMORY_R32G32B32A32_FLOAT, + gdk_color_profile_get_srgb (), + 1, + 1); + float_to_half4 ((const float *)&d, h); } /* fill_vertex_data */