From 403c8a7b632bc3a882dd5660130d65e6c14c3a41 Mon Sep 17 00:00:00 2001 From: Joan Torres Date: Mon, 28 Oct 2024 16:57:51 +0100 Subject: [PATCH] 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: --- clutter/clutter/clutter-color-state.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/clutter/clutter/clutter-color-state.c b/clutter/clutter/clutter-color-state.c index 7d6a94c3c..d7d9b8c6a 100644 --- a/clutter/clutter/clutter-color-state.c +++ b/clutter/clutter/clutter-color-state.c @@ -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);