clutter/color-state: When equals don't add color transform pipeline

The EOTFs snippets were only added when color states were not equal.

It makes more sense to only add the whole color transformation pipeline
in that case.

This makes the assumption to always append EOTFs snippets.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4144>
This commit is contained in:
Joan Torres 2024-10-28 16:57:51 +01:00 committed by Marge Bot
parent c3cc1338ec
commit 403c8a7b63

View File

@ -651,9 +651,6 @@ get_transfer_functions (ClutterColorState *color_state,
const TransferFunction **pre_transfer_function,
const TransferFunction **post_transfer_function)
{
if (clutter_color_state_equals (color_state, target_color_state))
return;
*pre_transfer_function = get_eotf (color_state);
*post_transfer_function = get_inv_eotf (target_color_state);
}
@ -1171,6 +1168,9 @@ clutter_color_state_add_pipeline_transform (ClutterColorState *color_state,
g_return_if_fail (CLUTTER_IS_COLOR_STATE (color_state));
g_return_if_fail (CLUTTER_IS_COLOR_STATE (target_color_state));
if (clutter_color_state_equals (color_state, target_color_state))
return;
snippet = clutter_color_state_get_transform_snippet (color_state,
target_color_state);
cogl_pipeline_add_snippet (pipeline, snippet);