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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3802>
This commit is contained in:
parent
9d11cc679e
commit
04842393aa
3 changed files with 0 additions and 41 deletions
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue