Commit 8634b5cb authored by Michael Natterer's avatar Michael Natterer 😴

app: make layer blend color space and compositing color space configurable

...they say it's going to get worse before it gets better...
parent b119fc99
......@@ -50,8 +50,16 @@ static const GimpActionEntry layers_actions[] =
NC_("layers-action", "Layers Menu"), NULL, NULL, NULL,
GIMP_HELP_LAYER_DIALOG },
{ "layers-composite-menu", NULL,
NC_("layers-action", "Composite"), NULL, NULL, NULL,
{ "layers-blend-space-menu", NULL,
NC_("layers-action", "Blend Space"), NULL, NULL, NULL,
NULL },
{ "layers-composite-space-menu", NULL,
NC_("layers-action", "Composite Space"), NULL, NULL, NULL,
NULL },
{ "layers-composite-mode-menu", NULL,
NC_("layers-action", "Composite Mode"), NULL, NULL, NULL,
NULL },
{ "layers-color-tag-menu", GIMP_STOCK_CLOSE /* abused */,
......@@ -319,29 +327,75 @@ static const GimpToggleActionEntry layers_toggle_actions[] =
GIMP_HELP_LAYER_LOCK_ALPHA },
};
static const GimpRadioActionEntry layers_composite_actions[] =
static const GimpRadioActionEntry layers_blend_space_actions[] =
{
{ "layers-blend-space-auto", NULL,
NC_("layers-action", "Auto"), NULL, NULL,
GIMP_LAYER_COLOR_SPACE_AUTO,
NULL },
{ "layers-blend-space-rgb-linear", NULL,
NC_("layers-action", "RGB (linear)"), NULL, NULL,
GIMP_LAYER_COLOR_SPACE_RGB_LINEAR,
NULL },
{ "layers-blend-space-rgb-perceptual", NULL,
NC_("layers-action", "RGB (perceptual)"), NULL, NULL,
GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL,
NULL },
{ "layers-blend-space-lab", NULL,
NC_("layers-action", "LAB"), NULL, NULL,
GIMP_LAYER_COLOR_SPACE_LAB,
NULL }
};
static const GimpRadioActionEntry layers_composite_space_actions[] =
{
{ "layers-composite-space-auto", NULL,
NC_("layers-action", "Auto"), NULL, NULL,
GIMP_LAYER_COLOR_SPACE_AUTO,
NULL },
{ "layers-composite-space-rgb-linear", NULL,
NC_("layers-action", "RGB (linear)"), NULL, NULL,
GIMP_LAYER_COLOR_SPACE_RGB_LINEAR,
NULL },
{ "layers-composite-space-rgb-perceptual", NULL,
NC_("layers-action", "RGB (perceptual)"), NULL, NULL,
GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL,
NULL },
{ "layers-composite-space-lab", NULL,
NC_("layers-action", "LAB"), NULL, NULL,
GIMP_LAYER_COLOR_SPACE_LAB,
NULL }
};
static const GimpRadioActionEntry layers_composite_mode_actions[] =
{
{ "layers-composite-auto", NULL,
{ "layers-composite-mode-auto", NULL,
NC_("layers-action", "Auto"), NULL, NULL,
GIMP_LAYER_COMPOSITE_AUTO,
NULL },
{ "layers-composite-src-over", NULL,
{ "layers-composite-mode-src-over", NULL,
NC_("layers-action", "Source over"), NULL, NULL,
GIMP_LAYER_COMPOSITE_SRC_OVER,
NULL },
{ "layers-composite-src-atop", NULL,
{ "layers-composite-mode-src-atop", NULL,
NC_("layers-action", "Source atop"), NULL, NULL,
GIMP_LAYER_COMPOSITE_SRC_ATOP,
NULL },
{ "layers-composite-src-in", NULL,
{ "layers-composite-mode-src-in", NULL,
NC_("layers-action", "Source in"), NULL, NULL,
GIMP_LAYER_COMPOSITE_SRC_IN,
NULL },
{ "layers-composite-dst-atop", NULL,
{ "layers-composite-mode-dst-atop", NULL,
NC_("layers-action", "Destination atop"), NULL, NULL,
GIMP_LAYER_COMPOSITE_DST_ATOP,
NULL }
......@@ -615,10 +669,22 @@ layers_actions_setup (GimpActionGroup *group)
G_N_ELEMENTS (layers_toggle_actions));
gimp_action_group_add_radio_actions (group, "layers-action",
layers_composite_actions,
G_N_ELEMENTS (layers_composite_actions),
layers_blend_space_actions,
G_N_ELEMENTS (layers_blend_space_actions),
NULL, 0,
G_CALLBACK (layers_blend_space_cmd_callback));
gimp_action_group_add_radio_actions (group, "layers-action",
layers_composite_space_actions,
G_N_ELEMENTS (layers_composite_space_actions),
NULL, 0,
G_CALLBACK (layers_composite_space_cmd_callback));
gimp_action_group_add_radio_actions (group, "layers-action",
layers_composite_mode_actions,
G_N_ELEMENTS (layers_composite_mode_actions),
NULL, 0,
G_CALLBACK (layers_composite_cmd_callback));
G_CALLBACK (layers_composite_mode_cmd_callback));
gimp_action_group_add_enum_actions (group, "layers-action",
layers_color_tag_actions,
......@@ -704,18 +770,46 @@ layers_actions_update (GimpActionGroup *group,
GList *layer_list;
GList *list;
switch (gimp_layer_get_composite (layer))
switch (gimp_layer_get_blend_space (layer))
{
case GIMP_LAYER_COLOR_SPACE_AUTO:
action = "layers-blend-space-auto"; break;
case GIMP_LAYER_COLOR_SPACE_RGB_LINEAR:
action = "layers-blend-space-rgb-linear"; break;
case GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL:
action = "layers-blend-space-rgb-perceptual"; break;
case GIMP_LAYER_COLOR_SPACE_LAB:
action = "layers-blend-space-lab"; break;
}
gimp_action_group_set_action_active (group, action, TRUE);
switch (gimp_layer_get_composite_space (layer))
{
case GIMP_LAYER_COLOR_SPACE_AUTO:
action = "layers-composite-space-auto"; break;
case GIMP_LAYER_COLOR_SPACE_RGB_LINEAR:
action = "layers-composite-space-rgb-linear"; break;
case GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL:
action = "layers-composite-space-rgb-perceptual"; break;
case GIMP_LAYER_COLOR_SPACE_LAB:
action = "layers-composite-space-lab"; break;
}
gimp_action_group_set_action_active (group, action, TRUE);
switch (gimp_layer_get_composite_mode (layer))
{
case GIMP_LAYER_COMPOSITE_AUTO:
action = "layers-composite-auto"; break;
action = "layers-composite-mode-auto"; break;
case GIMP_LAYER_COMPOSITE_SRC_OVER:
action = "layers-composite-src-over"; break;
action = "layers-composite-mode-src-over"; break;
case GIMP_LAYER_COMPOSITE_SRC_ATOP:
action = "layers-composite-src-atop"; break;
action = "layers-composite-mode-src-atop"; break;
case GIMP_LAYER_COMPOSITE_SRC_IN:
action = "layers-composite-src-in"; break;
action = "layers-composite-mode-src-in"; break;
case GIMP_LAYER_COMPOSITE_DST_ATOP:
action = "layers-composite-dst-atop"; break;
action = "layers-composite-mode-dst-atop"; break;
}
gimp_action_group_set_action_active (group, action, TRUE);
......@@ -825,11 +919,21 @@ layers_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("layers-lock-alpha", can_lock_alpha);
SET_ACTIVE ("layers-lock-alpha", lock_alpha);
SET_SENSITIVE ("layers-composite-auto", layer);
SET_SENSITIVE ("layers-composite-src-over", layer);
SET_SENSITIVE ("layers-composite-src-atop", layer);
SET_SENSITIVE ("layers-composite-src-in", layer);
SET_SENSITIVE ("layers-composite-dst-atop", layer);
SET_SENSITIVE ("layers-blend-space-auto", layer);
SET_SENSITIVE ("layers-blend-space-rgb-linear", layer);
SET_SENSITIVE ("layers-blend-space-rgb-perceptual", layer);
SET_SENSITIVE ("layers-blend-space-lab", layer);
SET_SENSITIVE ("layers-composite-space-auto", layer);
SET_SENSITIVE ("layers-composite-space-rgb-linear", layer);
SET_SENSITIVE ("layers-composite-space-rgb-perceptual", layer);
SET_SENSITIVE ("layers-composite-space-lab", layer);
SET_SENSITIVE ("layers-composite-mode-auto", layer);
SET_SENSITIVE ("layers-composite-mode-src-over", layer);
SET_SENSITIVE ("layers-composite-mode-src-atop", layer);
SET_SENSITIVE ("layers-composite-mode-src-in", layer);
SET_SENSITIVE ("layers-composite-mode-dst-atop", layer);
SET_SENSITIVE ("layers-mask-add", layer && !fs && !ac && !mask && !children);
SET_SENSITIVE ("layers-mask-add-button", layer && !fs && !ac && !children);
......
......@@ -120,7 +120,9 @@ static void layers_new_callback (GtkWidget *dialog,
GimpContext *context,
const gchar *layer_name,
GimpLayerMode layer_mode,
GimpLayerCompositeMode layer_composite,
GimpLayerColorSpace layer_blend_space,
GimpLayerColorSpace layer_composite_space,
GimpLayerCompositeMode layer_composite_mode,
gdouble layer_opacity,
GimpFillType layer_fill_type,
gint layer_width,
......@@ -141,7 +143,9 @@ static void layers_edit_attributes_callback (GtkWidget *dialog,
GimpContext *context,
const gchar *layer_name,
GimpLayerMode layer_mode,
GimpLayerCompositeMode layer_composite,
GimpLayerColorSpace layer_blend_space,
GimpLayerColorSpace layer_composite_space,
GimpLayerCompositeMode layer_composite_mode,
gdouble layer_opacity,
GimpFillType layer_fill_type,
gint layer_width,
......@@ -262,7 +266,9 @@ layers_edit_attributes_cmd_callback (GtkAction *action,
GIMP_HELP_LAYER_EDIT,
gimp_object_get_name (layer),
gimp_layer_get_mode (layer),
gimp_layer_get_composite (layer),
gimp_layer_get_blend_space (layer),
gimp_layer_get_composite_space (layer),
gimp_layer_get_composite_mode (layer),
gimp_layer_get_opacity (layer),
0 /* unused */,
gimp_item_get_visible (item),
......@@ -329,6 +335,8 @@ layers_new_cmd_callback (GtkAction *action,
GIMP_HELP_LAYER_NEW,
config->layer_new_name,
config->layer_new_mode,
config->layer_new_blend_space,
config->layer_new_composite_space,
config->layer_new_composite_mode,
config->layer_new_opacity,
config->layer_new_fill_type,
......@@ -1139,18 +1147,74 @@ layers_mode_cmd_callback (GtkAction *action,
}
void
layers_composite_cmd_callback (GtkAction *action,
GtkAction *current,
gpointer data)
layers_blend_space_cmd_callback (GtkAction *action,
GtkAction *current,
gpointer data)
{
GimpImage *image;
GimpLayer *layer;
GimpLayerColorSpace blend_space;
return_if_no_layer (image, layer, data);
blend_space = gtk_radio_action_get_current_value (GTK_RADIO_ACTION (action));
if (blend_space != gimp_layer_get_blend_space (layer))
{
GimpUndo *undo;
gboolean push_undo = TRUE;
undo = gimp_image_undo_can_compress (image, GIMP_TYPE_LAYER_PROP_UNDO,
GIMP_UNDO_LAYER_MODE);
if (undo && GIMP_ITEM_UNDO (undo)->item == GIMP_ITEM (layer))
push_undo = FALSE;
gimp_layer_set_blend_space (layer, blend_space, push_undo);
gimp_image_flush (image);
}
}
void
layers_composite_space_cmd_callback (GtkAction *action,
GtkAction *current,
gpointer data)
{
GimpImage *image;
GimpLayer *layer;
GimpLayerColorSpace composite_space;
return_if_no_layer (image, layer, data);
composite_space = gtk_radio_action_get_current_value (GTK_RADIO_ACTION (action));
if (composite_space != gimp_layer_get_composite_space (layer))
{
GimpUndo *undo;
gboolean push_undo = TRUE;
undo = gimp_image_undo_can_compress (image, GIMP_TYPE_LAYER_PROP_UNDO,
GIMP_UNDO_LAYER_MODE);
if (undo && GIMP_ITEM_UNDO (undo)->item == GIMP_ITEM (layer))
push_undo = FALSE;
gimp_layer_set_composite_space (layer, composite_space, push_undo);
gimp_image_flush (image);
}
}
void
layers_composite_mode_cmd_callback (GtkAction *action,
GtkAction *current,
gpointer data)
{
GimpImage *image;
GimpLayer *layer;
GimpLayerCompositeMode composite;
GimpLayerCompositeMode composite_mode;
return_if_no_layer (image, layer, data);
composite = gtk_radio_action_get_current_value (GTK_RADIO_ACTION (action));
composite_mode = gtk_radio_action_get_current_value (GTK_RADIO_ACTION (action));
if (composite != gimp_layer_get_composite (layer))
if (composite_mode != gimp_layer_get_composite_mode (layer))
{
GimpUndo *undo;
gboolean push_undo = TRUE;
......@@ -1161,7 +1225,7 @@ layers_composite_cmd_callback (GtkAction *action,
if (undo && GIMP_ITEM_UNDO (undo)->item == GIMP_ITEM (layer))
push_undo = FALSE;
gimp_layer_set_composite (layer, composite, push_undo);
gimp_layer_set_composite_mode (layer, composite_mode, push_undo);
gimp_image_flush (image);
}
}
......@@ -1260,7 +1324,9 @@ layers_new_callback (GtkWidget *dialog,
GimpContext *context,
const gchar *layer_name,
GimpLayerMode layer_mode,
GimpLayerCompositeMode layer_composite,
GimpLayerColorSpace layer_blend_space,
GimpLayerColorSpace layer_composite_space,
GimpLayerCompositeMode layer_composite_mode,
gdouble layer_opacity,
GimpFillType layer_fill_type,
gint layer_width,
......@@ -1279,11 +1345,13 @@ layers_new_callback (GtkWidget *dialog,
GimpDialogConfig *config = GIMP_DIALOG_CONFIG (image->gimp->config);
g_object_set (config,
"layer-new-name", layer_name,
"layer-new-mode", layer_mode,
"layer-new-composite-mode", layer_composite,
"layer-new-opacity", layer_opacity,
"layer-new-fill-type", layer_fill_type,
"layer-new-name", layer_name,
"layer-new-mode", layer_mode,
"layer-new-blend-space", layer_blend_space,
"layer-new-composite-space", layer_composite_space,
"layer-new-composite-mode", layer_composite_mode,
"layer-new-opacity", layer_opacity,
"layer-new-fill-type", layer_fill_type,
NULL);
layer = gimp_layer_new (image, layer_width, layer_height,
......@@ -1305,7 +1373,9 @@ layers_new_callback (GtkWidget *dialog,
gimp_item_set_lock_position (GIMP_ITEM (layer), layer_lock_position,
FALSE);
gimp_layer_set_lock_alpha (layer, layer_lock_alpha, FALSE);
gimp_layer_set_composite (layer, layer_composite, FALSE);
gimp_layer_set_blend_space (layer, layer_blend_space, FALSE);
gimp_layer_set_composite_space (layer, layer_composite_space, FALSE);
gimp_layer_set_composite_mode (layer, layer_composite_mode, FALSE);
gimp_image_add_layer (image, layer,
GIMP_IMAGE_ACTIVE_PARENT, -1, TRUE);
......@@ -1326,7 +1396,9 @@ layers_edit_attributes_callback (GtkWidget *dialog,
GimpContext *context,
const gchar *layer_name,
GimpLayerMode layer_mode,
GimpLayerCompositeMode layer_composite,
GimpLayerColorSpace layer_blend_space,
GimpLayerColorSpace layer_composite_space,
GimpLayerCompositeMode layer_composite_mode,
gdouble layer_opacity,
GimpFillType unused1,
gint unused2,
......@@ -1344,18 +1416,20 @@ layers_edit_attributes_callback (GtkWidget *dialog,
{
GimpItem *item = GIMP_ITEM (layer);
if (strcmp (layer_name, gimp_object_get_name (layer)) ||
layer_mode != gimp_layer_get_mode (layer) ||
layer_composite != gimp_layer_get_composite (layer) ||
layer_opacity != gimp_layer_get_opacity (layer) ||
layer_offset_x != gimp_item_get_offset_x (item) ||
layer_offset_y != gimp_item_get_offset_y (item) ||
layer_visible != gimp_item_get_visible (item) ||
layer_linked != gimp_item_get_linked (item) ||
layer_color_tag != gimp_item_get_color_tag (item) ||
layer_lock_pixels != gimp_item_get_lock_content (item) ||
layer_lock_position != gimp_item_get_lock_position (item) ||
layer_lock_alpha != gimp_layer_get_lock_alpha (layer))
if (strcmp (layer_name, gimp_object_get_name (layer)) ||
layer_mode != gimp_layer_get_mode (layer) ||
layer_blend_space != gimp_layer_get_blend_space (layer) ||
layer_composite_space != gimp_layer_get_composite_space (layer) ||
layer_composite_mode != gimp_layer_get_composite_mode (layer) ||
layer_opacity != gimp_layer_get_opacity (layer) ||
layer_offset_x != gimp_item_get_offset_x (item) ||
layer_offset_y != gimp_item_get_offset_y (item) ||
layer_visible != gimp_item_get_visible (item) ||
layer_linked != gimp_item_get_linked (item) ||
layer_color_tag != gimp_item_get_color_tag (item) ||
layer_lock_pixels != gimp_item_get_lock_content (item) ||
layer_lock_position != gimp_item_get_lock_position (item) ||
layer_lock_alpha != gimp_layer_get_lock_alpha (layer))
{
gimp_image_undo_group_start (image,
GIMP_UNDO_GROUP_ITEM_PROPERTIES,
......@@ -1377,8 +1451,14 @@ layers_edit_attributes_callback (GtkWidget *dialog,
if (layer_mode != gimp_layer_get_mode (layer))
gimp_layer_set_mode (layer, layer_mode, TRUE);
if (layer_composite != gimp_layer_get_composite (layer))
gimp_layer_set_composite (layer, layer_composite, TRUE);
if (layer_blend_space != gimp_layer_get_blend_space (layer))
gimp_layer_set_blend_space (layer, layer_blend_space, TRUE);
if (layer_composite_space != gimp_layer_get_composite_space (layer))
gimp_layer_set_composite_space (layer, layer_composite_space, TRUE);
if (layer_composite_mode != gimp_layer_get_composite_mode (layer))
gimp_layer_set_composite_mode (layer, layer_composite_mode, TRUE);
if (layer_opacity != gimp_layer_get_opacity (layer))
gimp_layer_set_opacity (layer, layer_opacity, TRUE);
......
......@@ -106,7 +106,13 @@ void layers_opacity_cmd_callback (GtkAction *action,
void layers_mode_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void layers_composite_cmd_callback (GtkAction *action,
void layers_blend_space_cmd_callback (GtkAction *action,
GtkAction *current,
gpointer data);
void layers_composite_space_cmd_callback (GtkAction *action,
GtkAction *current,
gpointer data);
void layers_composite_mode_cmd_callback (GtkAction *action,
GtkAction *current,
gpointer data);
......
......@@ -68,6 +68,8 @@ enum
PROP_LAYER_NEW_NAME,
PROP_LAYER_NEW_MODE,
PROP_LAYER_NEW_BLEND_SPACE,
PROP_LAYER_NEW_COMPOSITE_SPACE,
PROP_LAYER_NEW_COMPOSITE_MODE,
PROP_LAYER_NEW_OPACITY,
PROP_LAYER_NEW_FILL_TYPE,
......@@ -303,6 +305,22 @@ gimp_dialog_config_class_init (GimpDialogConfigClass *klass)
GIMP_LAYER_MODE_NORMAL,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_PROP_ENUM (object_class, PROP_LAYER_NEW_BLEND_SPACE,
"layer-new-blend-space",
"Default new layer blend space",
LAYER_NEW_BLEND_SPACE_BLURB,
GIMP_TYPE_LAYER_COLOR_SPACE,
GIMP_LAYER_COLOR_SPACE_AUTO,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_PROP_ENUM (object_class, PROP_LAYER_NEW_COMPOSITE_SPACE,
"layer-new-composite-space",
"Default new layer composite space",
LAYER_NEW_COMPOSITE_SPACE_BLURB,
GIMP_TYPE_LAYER_COLOR_SPACE,
GIMP_LAYER_COLOR_SPACE_AUTO,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_PROP_ENUM (object_class, PROP_LAYER_NEW_COMPOSITE_MODE,
"layer-new-composite-mode",
"Default new layer composite mode",
......@@ -649,6 +667,12 @@ gimp_dialog_config_set_property (GObject *object,
case PROP_LAYER_NEW_MODE:
config->layer_new_mode = g_value_get_enum (value);
break;
case PROP_LAYER_NEW_BLEND_SPACE:
config->layer_new_blend_space = g_value_get_enum (value);
break;
case PROP_LAYER_NEW_COMPOSITE_SPACE:
config->layer_new_composite_space = g_value_get_enum (value);
break;
case PROP_LAYER_NEW_COMPOSITE_MODE:
config->layer_new_composite_mode = g_value_get_enum (value);
break;
......@@ -832,6 +856,12 @@ gimp_dialog_config_get_property (GObject *object,
case PROP_LAYER_NEW_MODE:
g_value_set_enum (value, config->layer_new_mode);
break;
case PROP_LAYER_NEW_BLEND_SPACE:
g_value_set_enum (value, config->layer_new_blend_space);
break;
case PROP_LAYER_NEW_COMPOSITE_SPACE:
g_value_set_enum (value, config->layer_new_composite_space);
break;
case PROP_LAYER_NEW_COMPOSITE_MODE:
g_value_set_enum (value, config->layer_new_composite_mode);
break;
......
......@@ -66,6 +66,8 @@ struct _GimpDialogConfig
gchar *layer_new_name;
GimpLayerMode layer_new_mode;
GimpLayerColorSpace layer_new_blend_space;
GimpLayerColorSpace layer_new_composite_space;
GimpLayerCompositeMode layer_new_composite_mode;
gdouble layer_new_opacity;
GimpFillType layer_new_fill_type;
......
......@@ -482,6 +482,12 @@ _("Sets the default layer name for the 'New Layer' dialog.")
#define LAYER_NEW_MODE_BLURB \
_("Sets the default mode for the 'New Layer' dialog.")
#define LAYER_NEW_BLEND_SPACE_BLURB \
_("Sets the default blend space for the 'New Layer' dialog.")
#define LAYER_NEW_COMPOSITE_SPACE_BLURB \
_("Sets the default composite space for the 'New Layer' dialog.")
#define LAYER_NEW_COMPOSITE_MODE_BLURB \
_("Sets the default composite mode for the 'New Layer' dialog.")
......
......@@ -623,6 +623,8 @@ gimp_edit_fill (GimpImage *image,
TRUE, undo_desc,
gimp_context_get_opacity (GIMP_CONTEXT (options)),
gimp_context_get_paint_mode (GIMP_CONTEXT (options)),
GIMP_LAYER_COLOR_SPACE_AUTO,
GIMP_LAYER_COLOR_SPACE_AUTO,
GIMP_LAYER_COMPOSITE_AUTO,
NULL, x, y);
......@@ -662,6 +664,8 @@ gimp_edit_fade (GimpImage *image,
gimp_object_get_name (undo),
gimp_context_get_opacity (context),
gimp_context_get_paint_mode (context),
GIMP_LAYER_COLOR_SPACE_AUTO,
GIMP_LAYER_COLOR_SPACE_AUTO,
GIMP_LAYER_COMPOSITE_AUTO,
NULL, undo->x, undo->y);
......
......@@ -164,7 +164,9 @@ static void gimp_channel_apply_buffer (GimpDrawable *drawable,
const gchar *undo_desc,
gdouble opacity,
GimpLayerMode mode,
GimpLayerCompositeMode composite,
GimpLayerColorSpace blend_space,
GimpLayerColorSpace composite_space,
GimpLayerCompositeMode composite_mode,
GeglBuffer *base_buffer,
gint base_x,
gint base_y);
......@@ -1015,7 +1017,9 @@ gimp_channel_apply_buffer (GimpDrawable *drawable,
const gchar *undo_desc,
gdouble opacity,
GimpLayerMode mode,
GimpLayerCompositeMode composite,
GimpLayerColorSpace blend_space,
GimpLayerColorSpace composite_space,
GimpLayerCompositeMode composite_mode,
GeglBuffer *base_buffer,
gint base_x,
gint base_y)
......@@ -1025,7 +1029,10 @@ gimp_channel_apply_buffer (GimpDrawable *drawable,
GIMP_DRAWABLE_CLASS (parent_class)->apply_buffer (drawable, buffer,
buffer_region,
push_undo, undo_desc,
opacity, mode, composite,
opacity, mode,
blend_space,
composite_space,
composite_mode,
base_buffer,
base_x, base_y);
......
......@@ -148,7 +148,10 @@ gimp_drawable_blend (GimpDrawable *drawable,
gimp_drawable_apply_buffer (drawable, buffer,
GEGL_RECTANGLE (x, y, width, height),
TRUE, C_("undo-type", "Blend"),
opacity, paint_mode, GIMP_LAYER_COMPOSITE_AUTO,
opacity, paint_mode,
GIMP_LAYER_COLOR_SPACE_AUTO,
GIMP_LAYER_COLOR_SPACE_AUTO,
GIMP_LAYER_COMPOSITE_AUTO,
NULL, x, y);
gimp_drawable_update (drawable, x, y, width, height);
......
......@@ -180,6 +180,8 @@ gimp_drawable_bucket_fill (GimpDrawable *drawable,
TRUE, C_("undo-type", "Bucket Fill"),
gimp_context_get_opacity (GIMP_CONTEXT (options)),
gimp_context_get_paint_mode (GIMP_CONTEXT (options)),
GIMP_LAYER_COLOR_SPACE_AUTO,
GIMP_LAYER_COLOR_SPACE_AUTO,
GIMP_LAYER_COMPOSITE_AUTO,
NULL, x, y);
......
......@@ -47,7 +47,9 @@ gimp_drawable_real_apply_buffer (GimpDrawable *drawable,
const gchar *undo_desc,
gdouble opacity,
GimpLayerMode mode,
GimpLayerCompositeMode composite,
GimpLayerColorSpace blend_space,
GimpLayerColorSpace composite_space,
GimpLayerCompositeMode composite_mode,
GeglBuffer *base_buffer,
gint base_x,
gint base_y)
......@@ -103,9 +105,11 @@ gimp_drawable_real_apply_buffer (GimpDrawable *drawable,
if (undo)
{
undo->paint_mode = mode;
undo->composite_mode = composite;
undo->opacity = opacity;
undo->paint_mode = mode;
undo->blend_space = blend_space;
undo->composite_space = composite_space;
undo->composite_mode = composite_mode;
undo->opacity = opacity;
undo->applied_buffer =
gegl_buffer_new (GEGL_RECTANGLE (0, 0, width, height),
......@@ -143,7 +147,8 @@ gimp_drawable_real_apply_buffer (GimpDrawable *drawable,
base_y - buffer_region->y);
gimp_applicator_set_opacity (applicator, opacity);
gimp_applicator_set_mode (applicator, mode, composite);
gimp_applicator_set_mode (applicator, mode,
blend_space, composite_space, composite_mode);
gimp_applicator_set_affect (applicator,
gimp_drawable_get_active_mask (drawable));
......
......@@ -28,7 +28,9 @@ void gimp_drawable_real_apply_buffer (GimpDrawable *drawable,
const gchar *undo_desc,
gdouble opacity,
GimpLayerMode mode,
GimpLayerCompositeMode composite,
GimpLayerColorSpace blend_space,
GimpLayerColorSpace composite_space,
GimpLayerCompositeMode composite_mode,
GeglBuffer *base_buffer,
gint base_x,
gint base_y);
......
......@@ -256,6 +256,8 @@ gimp_drawable_fill_scan_convert (GimpDrawable *drawable,
push_undo, C_("undo-type", "Render Stroke"),
gimp_context_get_opacity (context),
gimp_context_get_paint_mode (context),
GIMP_LAYER_COLOR_SPACE_AUTO,
GIMP_LAYER_COLOR_SPACE_AUTO,
GIMP_LAYER_COMPOSITE_AUTO,
NULL, x, y);
......
......@@ -305,7 +305,9 @@ gimp_drawable_sync_fs_filter (GimpDrawable *drawable)
gimp_layer_get_opacity (fs));
gimp_applicator_set_mode (private->fs_applicator,
gimp_layer_get_mode (fs),
gimp_layer_get_composite (fs));
gimp_layer_get_blend_space (fs),
gimp_layer_get_composite_space (fs),
gimp_layer_get_composite_mode (fs));
gimp_applicator_set_affect (private->fs_applicator,
gimp_drawable_get_active_mask (drawable));
}
......
......@@ -103,6 +103,8 @@ gimp_drawable_merge_shadow_buffer (GimpDrawable *drawable,
push_undo, undo_desc,
GIMP_OPACITY_OPAQUE,
GIMP_LAYER_MODE_REPLACE,
GIMP_LAYER_COLOR_SPACE_AUTO,
GIMP_LAYER_COLOR_SPACE_AUTO,
GIMP_LAYER_COMPOSITE_AUTO,
NULL, x, y);
......
......@@ -1104,7 +1104,9 @@ gimp_drawable_apply_buffer (GimpDrawable *drawable,
const gchar *undo_desc,
gdouble opacity,
GimpLayerMode mode,
GimpLayerCompositeMode composite,
GimpLayerColorSpace blend_space,
GimpLayerColorSpace composite_space,
GimpLayerCompositeMode composite_mode,
GeglBuffer *base_buffer,
gint base_x,
gint base_y)
......@@ -1118,7 +1120,10 @@ gimp_drawable_apply_buffer (GimpDrawable *drawable,
GIMP_DRAWABLE_GET_CLASS (drawable)->apply_buffer (drawable, buffer,
buffer_region,
push_undo, undo_desc,
opacity, mode, composite,
opacity, mode,
blend_space,
composite_space,
composite_mode,
base_buffer,
base_x, base_y);
}
......
......@@ -76,7 +76,9 @@ struct _GimpDrawableClass
const gchar *undo_desc,
gdouble opacity,
GimpLayerMode mode,
GimpLayerCompositeMode composite,
GimpLayerColorSpace blend_space,
GimpLayerColorSpace composite_space,
GimpLayerCompositeMode composite_mode