Commit 6bff1b21 authored by Michael Natterer's avatar Michael Natterer 😴

app: uncruftify combine_regions_replace() a bit to ease porting

parent cdd3df6c
......@@ -266,7 +266,6 @@ gimp_drawable_real_replace_buffer (GimpDrawable *drawable,
gint x, y, width, height;
gint offset_x, offset_y;
PixelRegion src1PR, destPR;
CombinationMode operation;
gboolean active_components[MAX_CHANNELS];
temp_buf = gimp_gegl_buffer_get_temp_buf (buffer);
......@@ -312,17 +311,6 @@ gimp_drawable_real_replace_buffer (GimpDrawable *drawable,
/* configure the active channel array */
gimp_drawable_get_active_components (drawable, active_components);
/* determine what sort of operation is being attempted and
* if it's actually legal...
*/
operation = gimp_image_get_combination_mode (gimp_drawable_type (drawable),
src2PR.bytes);
if (operation == -1)
{
g_warning ("%s: illegal parameters.", G_STRFUNC);
return;
}
/* get the layer offsets */
gimp_item_get_offset (item, &offset_x, &offset_y);
......@@ -392,18 +380,16 @@ gimp_drawable_real_replace_buffer (GimpDrawable *drawable,
pixel_region_init_temp_buf (&tempPR, temp_buf, 0, 0, width, height);
combine_regions_replace (&src1PR, &src2PR, &destPR, &tempPR, NULL,
combine_regions_replace (&src1PR, &src2PR, &destPR, &tempPR,
opacity * 255.999,
active_components,
operation);
active_components);
gimp_temp_buf_unref (temp_buf);
}
else
{
combine_regions_replace (&src1PR, &src2PR, &destPR, &maskPR, NULL,
combine_regions_replace (&src1PR, &src2PR, &destPR, &maskPR,
opacity * 255.999,
active_components,
operation);
active_components);
}
}
......@@ -96,18 +96,6 @@ static const guchar no_mask = OPAQUE_OPACITY;
/* Local function prototypes */
static void apply_layer_mode_replace (const guchar *src1,
const guchar *src2,
guchar *dest,
const guchar *mask,
gint x,
gint y,
guint opacity,
guint length,
guint bytes1,
guint bytes2,
const gboolean *affect);
static inline void rotate_pointers (guchar **p,
guint32 n);
......@@ -2608,10 +2596,8 @@ combine_regions_replace (PixelRegion *src1,
PixelRegion *src2,
PixelRegion *dest,
PixelRegion *mask,
const guchar *data,
guint opacity,
const gboolean *affect,
CombinationMode type)
const gboolean *affect)
{
gpointer pr;
......@@ -2627,10 +2613,8 @@ combine_regions_replace (PixelRegion *src1,
for (h = 0; h < src1->h; h++)
{
/* Now, apply the paint mode */
apply_layer_mode_replace (s1, s2, d, m, src1->x, src1->y + h,
opacity, src1->w,
src1->bytes, src2->bytes, affect);
replace_pixels (s1, s2, d, m, src1->w,
opacity, affect, src1->bytes, src2->bytes);
s1 += src1->rowstride;
s2 += src2->rowstride;
......@@ -2639,20 +2623,3 @@ combine_regions_replace (PixelRegion *src1,
}
}
}
static void
apply_layer_mode_replace (const guchar *src1,
const guchar *src2,
guchar *dest,
const guchar *mask,
gint x,
gint y,
guint opacity,
guint length,
guint bytes1,
guint bytes2,
const gboolean *affect)
{
replace_pixels (src1, src2, dest, mask, length,
opacity, affect, bytes1, bytes2);
}
......@@ -254,10 +254,8 @@ void combine_regions_replace (PixelRegion *src1,
PixelRegion *src2,
PixelRegion *dest,
PixelRegion *mask,
const guchar *data,
guint opacity,
const gboolean *affect,
CombinationMode type);
const gboolean *affect);
#endif /* __PAINT_FUNCS_H__ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment