Rename GDK_COLOR_INIT_SRGB

Rename the macro to GDK_COLOR_SRGB, and make it usable as
a compound literal as well.

Update all users.
This commit is contained in:
Matthias Clasen
2024-08-05 20:06:32 -04:00
parent 884974eeaa
commit dbd16cd9da
3 changed files with 3 additions and 6 deletions

View File

@@ -65,7 +65,7 @@ G_STATIC_ASSERT (G_STRUCT_OFFSET (GdkColor, b) == G_STRUCT_OFFSET (GdkColor, val
G_STATIC_ASSERT (G_STRUCT_OFFSET (GdkColor, a) == G_STRUCT_OFFSET (GdkColor, values[3]));
#endif
#define GDK_COLOR_INIT_SRGB(r,g,b,a) { \
#define GDK_COLOR_SRGB(r,g,b,a) (GdkColor) { \
.color_state = GDK_COLOR_STATE_SRGB, \
.values = { (r), (g), (b), (a) } \
}

View File

@@ -2521,16 +2521,13 @@ static void
gsk_gpu_node_processor_add_gl_shader_node (GskGpuNodeProcessor *self,
GskRenderNode *node)
{
GdkColor pink = GDK_COLOR_INIT_SRGB (1, 105/255., 180/255., 1);
gsk_gpu_color_op (self->frame,
gsk_gpu_clip_get_shader_clip (&self->clip, &self->offset, &node->bounds),
self->ccs,
self->opacity,
&self->offset,
&node->bounds,
&pink);
gdk_color_finish (&pink);
&GDK_COLOR_SRGB (1, 105/255., 180/255., 1));
}
static void

View File

@@ -1704,7 +1704,7 @@ parse_color_node (GtkCssParser *parser,
Context *context)
{
graphene_rect_t bounds = GRAPHENE_RECT_INIT (0, 0, 50, 50);
GdkColor color = GDK_COLOR_INIT_SRGB (1, 0, 0.8, 1);
GdkColor color = GDK_COLOR_SRGB (1, 0, 0.8, 1);
const Declaration declarations[] = {
{ "bounds", parse_rect, NULL, &bounds },
{ "color", parse_color2, NULL, &color },