From cd04aa1cd4dfceca8e58e5771e0aaec5f9c4bbe3 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 11 Aug 2024 16:13:49 -0400 Subject: [PATCH] gsk: Change a precondition It is nicer if gsk_gpu_color_states_create_explicit (a, a) works regardless of whether the two are default colorstates or not. The gradient shaders will rely on this when the ics is a non-default color state and we use ccs == ics. --- gsk/gpu/gskgpucolorstatesprivate.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gsk/gpu/gskgpucolorstatesprivate.h b/gsk/gpu/gskgpucolorstatesprivate.h index c761bfe84e..49aaa6251b 100644 --- a/gsk/gpu/gskgpucolorstatesprivate.h +++ b/gsk/gpu/gskgpucolorstatesprivate.h @@ -27,12 +27,12 @@ gsk_gpu_color_states_create (GdkColorState *output_color_state, GdkColorState *alt_color_state, gboolean alt_is_premultiplied) { - g_assert (GDK_IS_DEFAULT_COLOR_STATE (output_color_state)); - g_assert (GDK_IS_DEFAULT_COLOR_STATE (alt_color_state)); - if (gdk_color_state_equal (output_color_state, alt_color_state)) return gsk_gpu_color_states_create_equal (output_is_premultiplied, alt_is_premultiplied); + g_assert (GDK_IS_DEFAULT_COLOR_STATE (output_color_state)); + g_assert (GDK_IS_DEFAULT_COLOR_STATE (alt_color_state)); + return (GDK_DEFAULT_COLOR_STATE_ID (output_color_state) << COLOR_SPACE_OUTPUT_SHIFT) | (output_is_premultiplied ? COLOR_SPACE_OUTPUT_PREMULTIPLIED : 0) | (GDK_DEFAULT_COLOR_STATE_ID (alt_color_state) << COLOR_SPACE_ALT_SHIFT) |