Commit a7f3a2dd authored by Ell's avatar Ell

app, pdb, libgimp, plug-ins, menus: rename layer composite modes

Our composite modes don't correspond directly to the Porter-Duff
operators after which they're named, and these names aren't too
descriptive anyway.

Rename the composite modes as follows:

  Source Over       =>  Union
  Source Atop       =>  Clip to Backdrop
  Destination Atop  =>  Clip to Layer
  Source In         =>  Intersection

Update relevant code, including UI text, enumerator names, function
names, and action names.
parent d29facda
......@@ -385,28 +385,28 @@ static const GimpRadioActionEntry layers_composite_mode_actions[] =
GIMP_LAYER_COMPOSITE_AUTO,
NULL },
{ "layers-composite-mode-src-over", NULL,
NC_("layers-action", "Source Over"), NULL,
NC_("layers-action", "Layer Composite Mode: Source Over"),
GIMP_LAYER_COMPOSITE_SRC_OVER,
{ "layers-composite-mode-union", NULL,
NC_("layers-action", "Union"), NULL,
NC_("layers-action", "Layer Composite Mode: Union"),
GIMP_LAYER_COMPOSITE_UNION,
NULL },
{ "layers-composite-mode-src-atop", NULL,
NC_("layers-action", "Source Atop"), NULL,
NC_("layers-action", "Layer Composite Mode: Source Atop"),
GIMP_LAYER_COMPOSITE_SRC_ATOP,
{ "layers-composite-mode-clip-to-backdrop", NULL,
NC_("layers-action", "Clip to Backdrop"), NULL,
NC_("layers-action", "Layer Composite Mode: Clip to Backdrop"),
GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP,
NULL },
{ "layers-composite-mode-src-in", NULL,
NC_("layers-action", "Source In"), NULL,
NC_("layers-action", "Layer Composite Mode: Source In"),
GIMP_LAYER_COMPOSITE_SRC_IN,
{ "layers-composite-mode-clip-to-layer", NULL,
NC_("layers-action", "Clip to Layer"), NULL,
NC_("layers-action", "Layer Composite Mode: Clip to Layer"),
GIMP_LAYER_COMPOSITE_CLIP_TO_LAYER,
NULL },
{ "layers-composite-mode-dst-atop", NULL,
NC_("layers-action", "Destination Atop"), NULL,
NC_("layers-action", "Layer Composite Mode: Destination Atop"),
GIMP_LAYER_COMPOSITE_DST_ATOP,
{ "layers-composite-mode-intersection", NULL,
NC_("layers-action", "Intersection"), NULL,
NC_("layers-action", "Layer Composite Mode: Intersection"),
GIMP_LAYER_COMPOSITE_INTERSECTION,
NULL }
};
......@@ -823,14 +823,14 @@ layers_actions_update (GimpActionGroup *group,
{
case GIMP_LAYER_COMPOSITE_AUTO:
action = "layers-composite-mode-auto"; break;
case GIMP_LAYER_COMPOSITE_SRC_OVER:
action = "layers-composite-mode-src-over"; break;
case GIMP_LAYER_COMPOSITE_SRC_ATOP:
action = "layers-composite-mode-src-atop"; break;
case GIMP_LAYER_COMPOSITE_SRC_IN:
action = "layers-composite-mode-src-in"; break;
case GIMP_LAYER_COMPOSITE_DST_ATOP:
action = "layers-composite-mode-dst-atop"; break;
case GIMP_LAYER_COMPOSITE_UNION:
action = "layers-composite-mode-union"; break;
case GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP:
action = "layers-composite-mode-clip-to-backdrop"; break;
case GIMP_LAYER_COMPOSITE_CLIP_TO_LAYER:
action = "layers-composite-mode-clip-to-layer"; break;
case GIMP_LAYER_COMPOSITE_INTERSECTION:
action = "layers-composite-mode-intersection"; break;
}
gimp_action_group_set_action_active (group, action, TRUE);
......@@ -969,11 +969,11 @@ layers_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("layers-composite-space-rgb-linear", layer && cs_mutable);
SET_SENSITIVE ("layers-composite-space-rgb-perceptual", layer && cs_mutable);
SET_SENSITIVE ("layers-composite-mode-auto", layer && cm_mutable);
SET_SENSITIVE ("layers-composite-mode-src-over", layer && cm_mutable);
SET_SENSITIVE ("layers-composite-mode-src-atop", layer && cm_mutable);
SET_SENSITIVE ("layers-composite-mode-src-in", layer && cm_mutable);
SET_SENSITIVE ("layers-composite-mode-dst-atop", layer && cm_mutable);
SET_SENSITIVE ("layers-composite-mode-auto", layer && cm_mutable);
SET_SENSITIVE ("layers-composite-mode-union", layer && cm_mutable);
SET_SENSITIVE ("layers-composite-mode-clip-to-backdrop", layer && cm_mutable);
SET_SENSITIVE ("layers-composite-mode-clip-to-layer", layer && cm_mutable);
SET_SENSITIVE ("layers-composite-mode-intersection", layer && cm_mutable);
SET_SENSITIVE ("layers-mask-add", layer && !fs && !ac && !mask);
SET_SENSITIVE ("layers-mask-add-button", layer && !fs && !ac);
......
......@@ -1128,8 +1128,8 @@ gimp_group_layer_get_effective_mode (GimpLayer *layer,
* - the group has a single active child; or,
*
* - the effective mode of all the active children is normal, their
* effective composite mode is src-over, and their effective
* blend and composite spaces are equal;
* effective composite mode is UNION, and their effective blend and
* composite spaces are equal;
*
* - and,
*
......@@ -1178,7 +1178,7 @@ gimp_group_layer_get_effective_mode (GimpLayer *layer,
GimpLayerCompositeMode other_composite_mode;
if (*mode != GIMP_LAYER_MODE_NORMAL ||
*composite_mode != GIMP_LAYER_COMPOSITE_SRC_OVER)
*composite_mode != GIMP_LAYER_COMPOSITE_UNION)
{
reduce = FALSE;
......
......@@ -2635,7 +2635,7 @@ gimp_layer_get_composite_mode (GimpLayer *layer)
GimpLayerCompositeMode
gimp_layer_get_real_composite_mode (GimpLayer *layer)
{
g_return_val_if_fail (GIMP_IS_LAYER (layer), GIMP_LAYER_COMPOSITE_SRC_OVER);
g_return_val_if_fail (GIMP_IS_LAYER (layer), GIMP_LAYER_COMPOSITE_UNION);
if (layer->composite_mode == GIMP_LAYER_COMPOSITE_AUTO)
return gimp_layer_mode_get_composite_mode (layer->mode);
......
......@@ -84,7 +84,7 @@ gimp_operation_anti_erase_process (GeglOperation *op,
switch (layer_mode->real_composite_mode)
{
case GIMP_LAYER_COMPOSITE_SRC_OVER:
case GIMP_LAYER_COMPOSITE_UNION:
case GIMP_LAYER_COMPOSITE_AUTO:
while (samples--)
{
......@@ -110,7 +110,7 @@ gimp_operation_anti_erase_process (GeglOperation *op,
}
break;
case GIMP_LAYER_COMPOSITE_SRC_ATOP:
case GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP:
while (samples--)
{
gint b;
......@@ -127,7 +127,7 @@ gimp_operation_anti_erase_process (GeglOperation *op,
}
break;
case GIMP_LAYER_COMPOSITE_DST_ATOP:
case GIMP_LAYER_COMPOSITE_CLIP_TO_LAYER:
while (samples--)
{
gfloat value = opacity;
......@@ -152,7 +152,7 @@ gimp_operation_anti_erase_process (GeglOperation *op,
}
break;
case GIMP_LAYER_COMPOSITE_SRC_IN:
case GIMP_LAYER_COMPOSITE_INTERSECTION:
while (samples--)
{
gfloat value = opacity;
......
......@@ -82,7 +82,7 @@ gimp_operation_behind_process (GeglOperation *op,
switch (layer_mode->real_composite_mode)
{
case GIMP_LAYER_COMPOSITE_SRC_OVER:
case GIMP_LAYER_COMPOSITE_UNION:
case GIMP_LAYER_COMPOSITE_AUTO:
while (samples--)
{
......@@ -125,7 +125,7 @@ gimp_operation_behind_process (GeglOperation *op,
}
break;
case GIMP_LAYER_COMPOSITE_SRC_ATOP:
case GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP:
while (samples--)
{
gfloat src1_alpha = in[ALPHA];
......@@ -153,7 +153,7 @@ gimp_operation_behind_process (GeglOperation *op,
}
break;
case GIMP_LAYER_COMPOSITE_DST_ATOP:
case GIMP_LAYER_COMPOSITE_CLIP_TO_LAYER:
while (samples--)
{
gfloat src1_alpha = in[ALPHA];
......@@ -192,7 +192,7 @@ gimp_operation_behind_process (GeglOperation *op,
}
break;
case GIMP_LAYER_COMPOSITE_SRC_IN:
case GIMP_LAYER_COMPOSITE_INTERSECTION:
while (samples--)
{
gfloat src1_alpha = in[ALPHA];
......
......@@ -120,8 +120,8 @@ gimp_operation_dissolve_process (GeglOperation *op,
out[1] = in[1];
out[2] = in[2];
if (layer_mode->real_composite_mode == GIMP_LAYER_COMPOSITE_SRC_OVER ||
layer_mode->real_composite_mode == GIMP_LAYER_COMPOSITE_SRC_ATOP)
if (layer_mode->real_composite_mode == GIMP_LAYER_COMPOSITE_UNION ||
layer_mode->real_composite_mode == GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP)
{
out[3] = in[3];
}
......@@ -136,8 +136,8 @@ gimp_operation_dissolve_process (GeglOperation *op,
out[1] = layer[1];
out[2] = layer[2];
if (layer_mode->real_composite_mode == GIMP_LAYER_COMPOSITE_SRC_OVER ||
layer_mode->real_composite_mode == GIMP_LAYER_COMPOSITE_DST_ATOP)
if (layer_mode->real_composite_mode == GIMP_LAYER_COMPOSITE_UNION ||
layer_mode->real_composite_mode == GIMP_LAYER_COMPOSITE_CLIP_TO_LAYER)
{
out[3] = 1.0f;
}
......
......@@ -81,7 +81,7 @@ gimp_operation_erase_process (GeglOperation *op,
switch (layer_mode->real_composite_mode)
{
case GIMP_LAYER_COMPOSITE_SRC_OVER:
case GIMP_LAYER_COMPOSITE_UNION:
while (samples--)
{
gfloat layer_alpha;
......@@ -125,7 +125,7 @@ gimp_operation_erase_process (GeglOperation *op,
}
break;
case GIMP_LAYER_COMPOSITE_SRC_ATOP:
case GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP:
case GIMP_LAYER_COMPOSITE_AUTO:
while (samples--)
{
......@@ -156,7 +156,7 @@ gimp_operation_erase_process (GeglOperation *op,
}
break;
case GIMP_LAYER_COMPOSITE_DST_ATOP:
case GIMP_LAYER_COMPOSITE_CLIP_TO_LAYER:
while (samples--)
{
gfloat layer_alpha;
......@@ -192,7 +192,7 @@ gimp_operation_erase_process (GeglOperation *op,
}
break;
case GIMP_LAYER_COMPOSITE_SRC_IN:
case GIMP_LAYER_COMPOSITE_INTERSECTION:
while (samples--)
{
gint b;
......
......@@ -45,21 +45,21 @@
void
gimp_operation_layer_mode_composite_src_atop_sse2 (const gfloat *in,
const gfloat *layer,
const gfloat *comp,
const gfloat *mask,
gfloat opacity,
gfloat *out,
gint samples)
gimp_operation_layer_mode_composite_clip_to_backdrop_sse2 (const gfloat *in,
const gfloat *layer,
const gfloat *comp,
const gfloat *mask,
gfloat opacity,
gfloat *out,
gint samples)
{
if ((((uintptr_t)in) | /* alignment check */
((uintptr_t)comp) |
((uintptr_t)out) ) & 0x0F)
{
gimp_operation_layer_mode_composite_src_atop (in, layer, comp,
mask, opacity, out,
samples);
gimp_operation_layer_mode_composite_clip_to_backdrop (in, layer, comp,
mask, opacity, out,
samples);
}
else
{
......
......@@ -39,13 +39,13 @@
void
gimp_operation_layer_mode_composite_src_over (const gfloat *in,
const gfloat *layer,
const gfloat *comp,
const gfloat *mask,
gfloat opacity,
gfloat *out,
gint samples)
gimp_operation_layer_mode_composite_union (const gfloat *in,
const gfloat *layer,
const gfloat *comp,
const gfloat *mask,
gfloat opacity,
gfloat *out,
gint samples)
{
while (samples--)
{
......@@ -92,13 +92,13 @@ gimp_operation_layer_mode_composite_src_over (const gfloat *in,
}
void
gimp_operation_layer_mode_composite_src_atop (const gfloat *in,
const gfloat *layer,
const gfloat *comp,
const gfloat *mask,
gfloat opacity,
gfloat *out,
gint samples)
gimp_operation_layer_mode_composite_clip_to_backdrop (const gfloat *in,
const gfloat *layer,
const gfloat *comp,
const gfloat *mask,
gfloat opacity,
gfloat *out,
gint samples)
{
while (samples--)
{
......@@ -133,13 +133,13 @@ gimp_operation_layer_mode_composite_src_atop (const gfloat *in,
}
void
gimp_operation_layer_mode_composite_dst_atop (const gfloat *in,
const gfloat *layer,
const gfloat *comp,
const gfloat *mask,
gfloat opacity,
gfloat *out,
gint samples)
gimp_operation_layer_mode_composite_clip_to_layer (const gfloat *in,
const gfloat *layer,
const gfloat *comp,
const gfloat *mask,
gfloat opacity,
gfloat *out,
gint samples)
{
while (samples--)
{
......@@ -181,13 +181,13 @@ gimp_operation_layer_mode_composite_dst_atop (const gfloat *in,
}
void
gimp_operation_layer_mode_composite_src_in (const gfloat *in,
const gfloat *layer,
const gfloat *comp,
const gfloat *mask,
gfloat opacity,
gfloat *out,
gint samples)
gimp_operation_layer_mode_composite_intersection (const gfloat *in,
const gfloat *layer,
const gfloat *comp,
const gfloat *mask,
gfloat opacity,
gfloat *out,
gint samples)
{
while (samples--)
{
......@@ -228,13 +228,13 @@ gimp_operation_layer_mode_composite_src_in (const gfloat *in,
*/
void
gimp_operation_layer_mode_composite_src_over_sub (const gfloat *in,
const gfloat *layer,
const gfloat *comp,
const gfloat *mask,
gfloat opacity,
gfloat *out,
gint samples)
gimp_operation_layer_mode_composite_union_sub (const gfloat *in,
const gfloat *layer,
const gfloat *comp,
const gfloat *mask,
gfloat opacity,
gfloat *out,
gint samples)
{
while (samples--)
{
......@@ -284,13 +284,13 @@ gimp_operation_layer_mode_composite_src_over_sub (const gfloat *in,
}
void
gimp_operation_layer_mode_composite_src_atop_sub (const gfloat *in,
const gfloat *layer,
const gfloat *comp,
const gfloat *mask,
gfloat opacity,
gfloat *out,
gint samples)
gimp_operation_layer_mode_composite_clip_to_backdrop_sub (const gfloat *in,
const gfloat *layer,
const gfloat *comp,
const gfloat *mask,
gfloat opacity,
gfloat *out,
gint samples)
{
while (samples--)
{
......@@ -335,13 +335,13 @@ gimp_operation_layer_mode_composite_src_atop_sub (const gfloat *in,
}
void
gimp_operation_layer_mode_composite_dst_atop_sub (const gfloat *in,
const gfloat *layer,
const gfloat *comp,
const gfloat *mask,
gfloat opacity,
gfloat *out,
gint samples)
gimp_operation_layer_mode_composite_clip_to_layer_sub (const gfloat *in,
const gfloat *layer,
const gfloat *comp,
const gfloat *mask,
gfloat opacity,
gfloat *out,
gint samples)
{
while (samples--)
{
......@@ -393,13 +393,13 @@ gimp_operation_layer_mode_composite_dst_atop_sub (const gfloat *in,
}
void
gimp_operation_layer_mode_composite_src_in_sub (const gfloat *in,
const gfloat *layer,
const gfloat *comp,
const gfloat *mask,
gfloat opacity,
gfloat *out,
gint samples)
gimp_operation_layer_mode_composite_intersection_sub (const gfloat *in,
const gfloat *layer,
const gfloat *comp,
const gfloat *mask,
gfloat opacity,
gfloat *out,
gint samples)
{
while (samples--)
{
......
......@@ -24,73 +24,73 @@
#define __GIMP_OPERATION_LAYER_MODE_COMPOSITE_H__
void gimp_operation_layer_mode_composite_src_over (const gfloat *in,
const gfloat *layer,
const gfloat *comp,
const gfloat *mask,
gfloat opacity,
gfloat *out,
gint samples);
void gimp_operation_layer_mode_composite_src_atop (const gfloat *in,
const gfloat *layer,
const gfloat *comp,
const gfloat *mask,
gfloat opacity,
gfloat *out,
gint samples);
void gimp_operation_layer_mode_composite_dst_atop (const gfloat *in,
const gfloat *layer,
const gfloat *comp,
const gfloat *mask,
gfloat opacity,
gfloat *out,
gint samples);
void gimp_operation_layer_mode_composite_src_in (const gfloat *in,
const gfloat *layer,
const gfloat *comp,
const gfloat *mask,
gfloat opacity,
gfloat *out,
gint samples);
void gimp_operation_layer_mode_composite_union (const gfloat *in,
const gfloat *layer,
const gfloat *comp,
const gfloat *mask,
gfloat opacity,
gfloat *out,
gint samples);
void gimp_operation_layer_mode_composite_clip_to_backdrop (const gfloat *in,
const gfloat *layer,
const gfloat *comp,
const gfloat *mask,
gfloat opacity,
gfloat *out,
gint samples);
void gimp_operation_layer_mode_composite_clip_to_layer (const gfloat *in,
const gfloat *layer,
const gfloat *comp,
const gfloat *mask,
gfloat opacity,
gfloat *out,
gint samples);
void gimp_operation_layer_mode_composite_intersection (const gfloat *in,
const gfloat *layer,
const gfloat *comp,
const gfloat *mask,
gfloat opacity,
gfloat *out,
gint samples);
void gimp_operation_layer_mode_composite_src_over_sub (const gfloat *in,
const gfloat *layer,
const gfloat *comp,
const gfloat *mask,
gfloat opacity,
gfloat *out,
gint samples);
void gimp_operation_layer_mode_composite_src_atop_sub (const gfloat *in,
const gfloat *layer,
const gfloat *comp,
const gfloat *mask,
gfloat opacity,
gfloat *out,
gint samples);
void gimp_operation_layer_mode_composite_dst_atop_sub (const gfloat *in,
const gfloat *layer,
const gfloat *comp,
const gfloat *mask,
gfloat opacity,
gfloat *out,
gint samples);
void gimp_operation_layer_mode_composite_src_in_sub (const gfloat *in,
const gfloat *layer,
const gfloat *comp,
const gfloat *mask,
gfloat opacity,
gfloat *out,
gint samples);
void gimp_operation_layer_mode_composite_union_sub (const gfloat *in,
const gfloat *layer,
const gfloat *comp,
const gfloat *mask,
gfloat opacity,
gfloat *out,
gint samples);
void gimp_operation_layer_mode_composite_clip_to_backdrop_sub (const gfloat *in,
const gfloat *layer,
const gfloat *comp,
const gfloat *mask,
gfloat opacity,
gfloat *out,
gint samples);
void gimp_operation_layer_mode_composite_clip_to_layer_sub (const gfloat *in,
const gfloat *layer,
const gfloat *comp,
const gfloat *mask,
gfloat opacity,
gfloat *out,
gint samples);
void gimp_operation_layer_mode_composite_intersection_sub (const gfloat *in,
const gfloat *layer,
const gfloat *comp,
const gfloat *mask,
gfloat opacity,
gfloat *out,
gint samples);
#if COMPILE_SSE2_INTRINISICS
void gimp_operation_layer_mode_composite_src_atop_sse2 (const gfloat *in,
const gfloat *layer,
const gfloat *comp,
const gfloat *mask,
gfloat opacity,
gfloat *out,
gint samples);
void gimp_operation_layer_mode_composite_clip_to_backdrop_sse2 (const gfloat *in,
const gfloat *layer,
const gfloat *comp,
const gfloat *mask,
gfloat opacity,
gfloat *out,
gint samples);
#endif /* COMPILE_SSE2_INTRINISICS */
......
......@@ -120,15 +120,15 @@ G_DEFINE_TYPE (GimpOperationLayerMode, gimp_operation_layer_mode,
static const Babl *gimp_layer_color_space_fish[3 /* from */][3 /* to */];
static CompositeFunc composite_src_over = gimp_operation_layer_mode_composite_src_over;
static CompositeFunc composite_src_atop = gimp_operation_layer_mode_composite_src_atop;
static CompositeFunc composite_dst_atop = gimp_operation_layer_mode_composite_dst_atop;
static CompositeFunc composite_src_in = gimp_operation_layer_mode_composite_src_in;
static CompositeFunc composite_union = gimp_operation_layer_mode_composite_union;
static CompositeFunc composite_clip_to_backdrop = gimp_operation_layer_mode_composite_clip_to_backdrop;
static CompositeFunc composite_clip_to_layer = gimp_operation_layer_mode_composite_clip_to_layer;
static CompositeFunc composite_intersection = gimp_operation_layer_mode_composite_intersection;
static CompositeFunc composite_src_over_sub = gimp_operation_layer_mode_composite_src_over_sub;
static CompositeFunc composite_src_atop_sub = gimp_operation_layer_mode_composite_src_atop_sub;
static CompositeFunc composite_dst_atop_sub = gimp_operation_layer_mode_composite_dst_atop_sub;
static CompositeFunc composite_src_in_sub = gimp_operation_layer_mode_composite_src_in_sub;
static CompositeFunc composite_union_sub = gimp_operation_layer_mode_composite_union_sub;
static CompositeFunc composite_clip_to_backdrop_sub = gimp_operation_layer_mode_composite_clip_to_backdrop_sub;
static CompositeFunc composite_clip_to_layer_sub = gimp_operation_layer_mode_composite_clip_to_layer_sub;
static CompositeFunc composite_intersection_sub = gimp_operation_layer_mode_composite_intersection_sub;
static void
......@@ -188,7 +188,7 @@ gimp_operation_layer_mode_class_init (GimpOperationLayerModeClass *klass)
g_param_spec_enum ("composite-mode",
NULL, NULL,
GIMP_TYPE_LAYER_COMPOSITE_MODE,
GIMP_LAYER_COMPOSITE_SRC_OVER,
GIMP_LAYER_COMPOSITE_UNION,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
......@@ -221,7 +221,7 @@ gimp_operation_layer_mode_class_init (GimpOperationLayerModeClass *klass)
#if COMPILE_SSE2_INTRINISICS
if (gimp_cpu_accel_get_support () & GIMP_CPU_ACCEL_X86_SSE2)
composite_src_atop = gimp_operation_layer_mode_composite_src_atop_sse2;
composite_clip_to_backdrop = gimp_operation_layer_mode_composite_clip_to_backdrop_sse2;
#endif
}
......@@ -312,6 +312,14 @@ gimp_operation_layer_mode_prepare (GeglOperation *operation)
self->real_composite_mode = self->composite_mode;
if (self->real_composite_mode == GIMP_LAYER_COMPOSITE_AUTO)
{
self->real_composite_mode =
gimp_layer_mode_get_composite_mode (self->layer_mode);
g_warn_if_fail (self->real_composite_mode != GIMP_LAYER_COMPOSITE_AUTO);
}
self->function = gimp_layer_mode_get_function (self->layer_mode);
self->blend_function = gimp_layer_mode_get_blend_function (self->layer_mode);
......@@ -325,7 +333,7 @@ gimp_operation_layer_mode_prepare (GeglOperation *operation)
preferred_format = gegl_operation_get_source_format (operation, "input");
}
/* otherwise, we're the last node (corresponding to the bottom layer).
* in this case, we render the layer (as if) using src-over mode.
* in this case, we render the layer (as if) using UNION mode.
*/
else
{
......@@ -340,11 +348,11 @@ gimp_operation_layer_mode_prepare (GeglOperation *operation)
self->function = process_last_node;
}
/* otherwise, use the original process function, but force the
* composite mode to SRC_OVER.
* composite mode to UNION.
*/
else
{
self->real_composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER;
self->real_composite_mode = GIMP_LAYER_COMPOSITE_UNION;
}
preferred_format = gegl_operation_get_source_format (operation, "aux");
......@@ -562,8 +570,8 @@ gimp_operation_layer_mode_real_process (GeglOperation *operation,
}
composite_needs_in_color =
composite_mode == GIMP_LAYER_COMPOSITE_SRC_OVER ||
composite_mode == GIMP_LAYER_COMPOSITE_SRC_ATOP;
composite_mode == GIMP_LAYER_COMPOSITE_UNION ||
composite_mode == GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP;
blend_in = in;
blend_layer = layer;
......@@ -701,25 +709,25 @@ gimp_operation_layer_mode_real_process (GeglOperation *operation,
{
switch (composite_mode)
{
case GIMP_LAYER_COMPOSITE_SRC_ATOP:
default:
composite_src_atop (in, layer, blend_out, mask, opacity,
out, samples);
case GIMP_LAYER_COMPOSITE_UNION:
case GIMP_LAYER_COMPOSITE_AUTO:
composite_union (in, layer, blend_out, mask, opacity,
out, samples);
break;
case GIMP_LAYER_COMPOSITE_SRC_OVER:
composite_src_over (in, layer, blend_out, mask, opacity,
out, samples);
case GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP:
composite_clip_to_backdrop (in, layer, blend_out, mask, opacity,
out, samples);
break;
case GIMP_LAYER_COMPOSITE_DST_ATOP:
composite_dst_atop (in, layer, blend_out, mask, opacity,
out, samples);
case GIMP_LAYER_COMPOSITE_CLIP_TO_LAYER:
composite_clip_to_layer (in, layer, blend_out, mask, opac