diff --git a/app/core/gimplayer.c b/app/core/gimplayer.c index 9330604cc6..5e2f2854ad 100644 --- a/app/core/gimplayer.c +++ b/app/core/gimplayer.c @@ -1992,7 +1992,7 @@ gimp_layer_create_mask (GimpLayer *layer, GimpLayerMask *mask; GimpImage *image; gchar *mask_name; - GimpRGB black = { 0.0, 0.0, 0.0, GIMP_OPACITY_OPAQUE }; + GeglColor *black = gegl_color_new ("black"); g_return_val_if_fail (GIMP_IS_LAYER (layer), NULL); g_return_val_if_fail (add_mask_type != GIMP_ADD_MASK_CHANNEL || @@ -2008,9 +2008,10 @@ gimp_layer_create_mask (GimpLayer *layer, mask = gimp_layer_mask_new (image, gimp_item_get_width (item), gimp_item_get_height (item), - mask_name, &black); + mask_name, black); g_free (mask_name); + g_object_unref (black); switch (add_mask_type) { diff --git a/app/core/gimplayermask.c b/app/core/gimplayermask.c index e1b3ba7187..ecab528fa1 100644 --- a/app/core/gimplayermask.c +++ b/app/core/gimplayermask.c @@ -243,19 +243,18 @@ gimp_layer_mask_convert_type (GimpDrawable *drawable, } GimpLayerMask * -gimp_layer_mask_new (GimpImage *image, - gint width, - gint height, - const gchar *name, - const GimpRGB *rgb) +gimp_layer_mask_new (GimpImage *image, + gint width, + gint height, + const gchar *name, + GeglColor *color) { GimpLayerMask *layer_mask; - GeglColor *color; g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); g_return_val_if_fail (width > 0, NULL); g_return_val_if_fail (height > 0, NULL); - g_return_val_if_fail (rgb != NULL, NULL); + g_return_val_if_fail (GEGL_IS_COLOR (color), NULL); layer_mask = GIMP_LAYER_MASK (gimp_drawable_new (GIMP_TYPE_LAYER_MASK, @@ -264,8 +263,6 @@ gimp_layer_mask_new (GimpImage *image, gimp_image_get_mask_format (image))); /* set the layer_mask color and opacity */ - color = gegl_color_new (NULL); - gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), rgb); gimp_channel_set_color (GIMP_CHANNEL (layer_mask), color, FALSE); gimp_channel_set_show_masked (GIMP_CHANNEL (layer_mask), TRUE); diff --git a/app/core/gimplayermask.h b/app/core/gimplayermask.h index 5ee77fd019..7f07450d16 100644 --- a/app/core/gimplayermask.h +++ b/app/core/gimplayermask.h @@ -51,7 +51,7 @@ GimpLayerMask * gimp_layer_mask_new (GimpImage *image, gint width, gint height, const gchar *name, - const GimpRGB *color); + GeglColor *color); void gimp_layer_mask_set_layer (GimpLayerMask *layer_mask, GimpLayer *layer); diff --git a/app/xcf/xcf-load.c b/app/xcf/xcf-load.c index 4a28f6138c..31492e4e9c 100644 --- a/app/xcf/xcf-load.c +++ b/app/xcf/xcf-load.c @@ -3458,7 +3458,7 @@ xcf_load_layer_mask (XcfInfo *info, gint height; gboolean is_fs_drawable; gchar *name; - GimpRGB color = { 0.0, 0.0, 0.0, GIMP_OPACITY_OPAQUE }; + GeglColor *color = gegl_color_new ("black"); goffset cur_offset; /* check and see if this is the drawable the floating selection @@ -3481,7 +3481,8 @@ xcf_load_layer_mask (XcfInfo *info, width, height, name); /* create a new layer mask */ - layer_mask = gimp_layer_mask_new (image, width, height, name, &color); + layer_mask = gimp_layer_mask_new (image, width, height, name, color); + g_object_unref (color); g_free (name); if (! layer_mask) return NULL;