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:
parent
74ece2ad92
commit
408cb6ee57
@ -184,26 +184,6 @@ clutter_color_from_hls (ClutterColor *color,
|
|||||||
color->blue = floorf (clr[2] * 255.0 + 0.5);
|
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
|
static inline void
|
||||||
skip_whitespace (gchar **str)
|
skip_whitespace (gchar **str)
|
||||||
{
|
{
|
||||||
@ -592,7 +572,12 @@ clutter_color_equal (gconstpointer v1,
|
|||||||
guint
|
guint
|
||||||
clutter_color_hash (gconstpointer v)
|
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)
|
if (color1 == NULL)
|
||||||
return color2 == NULL ? 0 : -1;
|
return color2 == NULL ? 0 : -1;
|
||||||
|
|
||||||
pixel1 = clutter_color_to_pixel (color1);
|
pixel1 = clutter_color_hash (color1);
|
||||||
pixel2 = clutter_color_to_pixel (color2);
|
pixel2 = clutter_color_hash (color2);
|
||||||
|
|
||||||
if (pixel1 < pixel2)
|
if (pixel1 < pixel2)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -101,9 +101,6 @@ void clutter_color_from_hls (ClutterColor *color,
|
|||||||
gfloat luminance,
|
gfloat luminance,
|
||||||
gfloat saturation);
|
gfloat saturation);
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
guint32 clutter_color_to_pixel (const ClutterColor *color);
|
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
guint clutter_color_hash (gconstpointer v);
|
guint clutter_color_hash (gconstpointer v);
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
|
Loading…
x
Reference in New Issue
Block a user