memoryformat: Don't always convert to rec2100-linear and back

It turns out we lost the check to see if color states are equal when we
multithreaded things in !7657

Whoops.
This commit is contained in:
Benjamin Otte 2024-09-14 19:16:27 +02:00
parent fa86bfcb55
commit 01aafc6e65

View File

@ -2092,16 +2092,19 @@ gdk_memory_convert_generic (gpointer data)
gint64 before = GDK_PROFILER_CURRENT_TIME;
gsize rows;
convert_func = gdk_color_state_get_convert_to (mc->src_cs, mc->dest_cs);
if (!convert_func)
convert_func2 = gdk_color_state_get_convert_from (mc->dest_cs, mc->src_cs);
if (!convert_func && !convert_func2)
if (!gdk_color_state_equal (mc->src_cs, mc->dest_cs))
{
GdkColorState *connection = GDK_COLOR_STATE_REC2100_LINEAR;
convert_func = gdk_color_state_get_convert_to (mc->src_cs, connection);
convert_func2 = gdk_color_state_get_convert_from (mc->dest_cs, connection);
convert_func = gdk_color_state_get_convert_to (mc->src_cs, mc->dest_cs);
if (!convert_func)
convert_func2 = gdk_color_state_get_convert_from (mc->dest_cs, mc->src_cs);
if (!convert_func && !convert_func2)
{
GdkColorState *connection = GDK_COLOR_STATE_REC2100_LINEAR;
convert_func = gdk_color_state_get_convert_to (mc->src_cs, connection);
convert_func2 = gdk_color_state_get_convert_from (mc->dest_cs, connection);
}
}
if (convert_func)