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.
This commit is contained in:
Matthias Clasen
2024-08-11 16:13:49 -04:00
parent ac1c0d37c6
commit cd04aa1cd4

View File

@@ -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) |