1
0
Fork 0

clutter: Drop Color.to_pixel

Keep the function around as Color.hash

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3802>
This commit is contained in:
Bilal Elmoussaoui 2024-06-11 20:39:35 +02:00 committed by Marge Bot
parent 74ece2ad92
commit 408cb6ee57
2 changed files with 8 additions and 26 deletions

View file

@ -184,26 +184,6 @@ clutter_color_from_hls (ClutterColor *color,
color->blue = floorf (clr[2] * 255.0 + 0.5);
}
/**
* clutter_color_to_pixel:
* @color: a #ClutterColor
*
* Converts @color into a packed 32 bit integer, containing
* all the four 8 bit channels used by #ClutterColor.
*
* Return value: a packed color
*/
guint32
clutter_color_to_pixel (const ClutterColor *color)
{
g_return_val_if_fail (color != NULL, 0);
return (color->alpha |
color->blue << 8 |
color->green << 16 |
color->red << 24);
}
static inline void
skip_whitespace (gchar **str)
{
@ -592,7 +572,12 @@ clutter_color_equal (gconstpointer v1,
guint
clutter_color_hash (gconstpointer v)
{
return clutter_color_to_pixel ((const ClutterColor *) v);
const ClutterColor *color = v;
return (color->alpha |
color->blue << 8 |
color->green << 16 |
color->red << 24);
}
/**
@ -778,8 +763,8 @@ param_color_values_cmp (GParamSpec *pspec,
if (color1 == NULL)
return color2 == NULL ? 0 : -1;
pixel1 = clutter_color_to_pixel (color1);
pixel2 = clutter_color_to_pixel (color2);
pixel1 = clutter_color_hash (color1);
pixel2 = clutter_color_hash (color2);
if (pixel1 < pixel2)
return -1;

View file

@ -101,9 +101,6 @@ void clutter_color_from_hls (ClutterColor *color,
gfloat luminance,
gfloat saturation);
CLUTTER_EXPORT
guint32 clutter_color_to_pixel (const ClutterColor *color);
CLUTTER_EXPORT
guint clutter_color_hash (gconstpointer v);
CLUTTER_EXPORT