clutter: Drop set_source_color helper
The helper doesn't do anything that makes it worth to be exposed as public API. End-users, such as GNOME Shell could have an in-tree helper if they end up using it that much. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3086>
This commit is contained in:

committed by
Marge Bot

parent
7bd4e18231
commit
c0fdf0a470
@ -32,42 +32,6 @@
|
||||
#include "clutter/clutter-cairo.h"
|
||||
#include "clutter/clutter-color.h"
|
||||
|
||||
/**
|
||||
* clutter_cairo_set_source_color:
|
||||
* @cr: a Cairo context
|
||||
* @color: a #ClutterColor
|
||||
*
|
||||
* Utility function for setting the source color of @cr using
|
||||
* a #ClutterColor. This function is the equivalent of:
|
||||
*
|
||||
* ```c
|
||||
* cairo_set_source_rgba (cr,
|
||||
* color->red / 255.0,
|
||||
* color->green / 255.0,
|
||||
* color->blue / 255.0,
|
||||
* color->alpha / 255.0);
|
||||
* ```
|
||||
*/
|
||||
void
|
||||
clutter_cairo_set_source_color (cairo_t *cr,
|
||||
const ClutterColor *color)
|
||||
{
|
||||
g_return_if_fail (cr != NULL);
|
||||
g_return_if_fail (color != NULL);
|
||||
|
||||
if (color->alpha == 0xff)
|
||||
cairo_set_source_rgb (cr,
|
||||
color->red / 255.0,
|
||||
color->green / 255.0,
|
||||
color->blue / 255.0);
|
||||
else
|
||||
cairo_set_source_rgba (cr,
|
||||
color->red / 255.0,
|
||||
color->green / 255.0,
|
||||
color->blue / 255.0,
|
||||
color->alpha / 255.0);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_cairo_clear:
|
||||
* @cr: a Cairo context
|
||||
|
@ -49,8 +49,5 @@ G_BEGIN_DECLS
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_cairo_clear (cairo_t *cr);
|
||||
CLUTTER_EXPORT
|
||||
void clutter_cairo_set_source_color (cairo_t *cr,
|
||||
const ClutterColor *color);
|
||||
|
||||
G_END_DECLS
|
||||
|
Reference in New Issue
Block a user