From 04842393aadf3bb32864ff805e40dce5db7b377b Mon Sep 17 00:00:00 2001 From: Bilal Elmoussaoui Date: Tue, 11 Jun 2024 02:46:54 +0200 Subject: [PATCH] clutter: Drop Color.from_pixel Goes along with https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3367 Helps https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3544 Part-of: --- clutter/clutter/clutter-color.c | 20 -------------------- clutter/clutter/clutter-color.h | 3 --- src/tests/clutter/conform/color.c | 18 ------------------ 3 files changed, 41 deletions(-) diff --git a/clutter/clutter/clutter-color.c b/clutter/clutter/clutter-color.c index d0e07609a..e5e720b66 100644 --- a/clutter/clutter/clutter-color.c +++ b/clutter/clutter/clutter-color.c @@ -204,26 +204,6 @@ clutter_color_to_pixel (const ClutterColor *color) color->red << 24); } -/** - * clutter_color_from_pixel: - * @color: (out caller-allocates): return location for a #ClutterColor - * @pixel: a 32 bit packed integer containing a color - * - * Converts @pixel from the packed representation of a four 8 bit channel - * color to a #ClutterColor. - */ -void -clutter_color_from_pixel (ClutterColor *color, - guint32 pixel) -{ - g_return_if_fail (color != NULL); - - color->red = pixel >> 24; - color->green = (pixel >> 16) & 0xff; - color->blue = (pixel >> 8) & 0xff; - color->alpha = pixel & 0xff; -} - static inline void skip_whitespace (gchar **str) { diff --git a/clutter/clutter/clutter-color.h b/clutter/clutter/clutter-color.h index 3414354c4..e23a8ec49 100644 --- a/clutter/clutter/clutter-color.h +++ b/clutter/clutter/clutter-color.h @@ -116,9 +116,6 @@ void clutter_color_from_hls (ClutterColor *color, CLUTTER_EXPORT guint32 clutter_color_to_pixel (const ClutterColor *color); -CLUTTER_EXPORT -void clutter_color_from_pixel (ClutterColor *color, - guint32 pixel); CLUTTER_EXPORT guint clutter_color_hash (gconstpointer v); diff --git a/src/tests/clutter/conform/color.c b/src/tests/clutter/conform/color.c index 8e3d79681..cc137ff10 100644 --- a/src/tests/clutter/conform/color.c +++ b/src/tests/clutter/conform/color.c @@ -256,28 +256,10 @@ color_to_string (void) g_free (str); } -static void -color_operators (void) -{ - ClutterColor op1, op2; - - clutter_color_from_pixel (&op1, 0xff0000ff); - g_assert_cmpuint (op1.red, ==, 0xff); - g_assert_cmpuint (op1.green, ==, 0); - g_assert_cmpuint (op1.blue, ==, 0); - g_assert_cmpuint (op1.alpha, ==, 0xff); - - clutter_color_from_pixel (&op2, 0x00ff00ff); - g_assert_cmpuint (op2.red, ==, 0); - g_assert_cmpuint (op2.green, ==, 0xff); - g_assert_cmpuint (op2.blue, ==, 0); - g_assert_cmpuint (op2.alpha, ==, 0xff); -} CLUTTER_TEST_SUITE ( CLUTTER_TEST_UNIT ("/color/hls-roundtrip", color_hls_roundtrip) CLUTTER_TEST_UNIT ("/color/from-string/invalid", color_from_string_invalid) CLUTTER_TEST_UNIT ("/color/from-string/valid", color_from_string_valid) CLUTTER_TEST_UNIT ("/color/to-string", color_to_string) - CLUTTER_TEST_UNIT ("/color/operators", color_operators) )