Commit 4bcddb04 authored by Michael Natterer's avatar Michael Natterer 😴

app: turn gimp_drawable_apply_buffer()'s src1_tiles argument into base_buffer

parent 579d8947
......@@ -145,7 +145,7 @@ static void gimp_channel_apply_buffer (GimpDrawable *drawable,
const gchar *undo_desc,
gdouble opacity,
GimpLayerModeEffects mode,
TileManager *src1_tiles,
GeglBuffer *base_buffer,
PixelRegion *destPR,
gint x,
gint y);
......@@ -812,7 +812,7 @@ gimp_channel_apply_buffer (GimpDrawable *drawable,
const gchar *undo_desc,
gdouble opacity,
GimpLayerModeEffects mode,
TileManager *src1_tiles,
GeglBuffer *base_buffer,
PixelRegion *destPR,
gint x,
gint y)
......@@ -823,7 +823,8 @@ gimp_channel_apply_buffer (GimpDrawable *drawable,
buffer_region,
push_undo, undo_desc,
opacity, mode,
src1_tiles, destPR,
base_buffer,
destPR,
x, y);
GIMP_CHANNEL (drawable)->bounds_known = FALSE;
......
......@@ -43,7 +43,7 @@ gimp_drawable_real_apply_buffer (GimpDrawable *drawable,
const gchar *undo_desc,
gdouble opacity,
GimpLayerModeEffects mode,
TileManager *src1_tiles,
GeglBuffer *base_buffer,
PixelRegion *destPR,
gint x,
gint y)
......@@ -53,6 +53,7 @@ gimp_drawable_real_apply_buffer (GimpDrawable *drawable,
GimpChannel *mask = gimp_image_get_mask (image);
TempBuf *temp_buf;
PixelRegion src2PR;
TileManager *src1_tiles;
gint x1, y1, x2, y2;
gint offset_x, offset_y;
PixelRegion src1PR, my_destPR;
......@@ -75,6 +76,11 @@ gimp_drawable_real_apply_buffer (GimpDrawable *drawable,
FALSE);
}
if (base_buffer)
src1_tiles = gimp_gegl_buffer_get_tiles (base_buffer);
else
src1_tiles = NULL;
/* don't apply the mask to itself and don't apply an empty mask */
if (GIMP_DRAWABLE (mask) == drawable || gimp_channel_is_empty (mask))
mask = NULL;
......
......@@ -28,7 +28,7 @@ void gimp_drawable_real_apply_buffer (GimpDrawable *drawable,
const gchar *undo_desc,
gdouble opacity,
GimpLayerModeEffects mode,
TileManager *src1_tiles,
GeglBuffer *base_buffer,
PixelRegion *destPR,
gint x,
gint y);
......
......@@ -1242,7 +1242,7 @@ gimp_drawable_apply_buffer (GimpDrawable *drawable,
const gchar *undo_desc,
gdouble opacity,
GimpLayerModeEffects mode,
TileManager *src1_tiles,
GeglBuffer *base_buffer,
PixelRegion *destPR,
gint x,
gint y)
......@@ -1251,12 +1251,14 @@ gimp_drawable_apply_buffer (GimpDrawable *drawable,
g_return_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)));
g_return_if_fail (GEGL_IS_BUFFER (buffer));
g_return_if_fail (buffer_region != NULL);
g_return_if_fail (base_buffer == NULL || GEGL_IS_BUFFER (base_buffer));
GIMP_DRAWABLE_GET_CLASS (drawable)->apply_buffer (drawable, buffer,
buffer_region,
push_undo, undo_desc,
opacity, mode,
src1_tiles, destPR,
base_buffer,
destPR,
x, y);
}
......
......@@ -70,7 +70,7 @@ struct _GimpDrawableClass
const gchar *undo_desc,
gdouble opacity,
GimpLayerModeEffects mode,
TileManager *src1_tiles,
GeglBuffer *base_buffer,
PixelRegion *destPR,
gint x,
gint y);
......@@ -148,7 +148,7 @@ void gimp_drawable_apply_buffer (GimpDrawable *drawable,
const gchar *undo_desc,
gdouble opacity,
GimpLayerModeEffects mode,
TileManager *src1_tiles,
GeglBuffer *base_buffer,
PixelRegion *destPR,
gint x,
gint y);
......
......@@ -857,8 +857,8 @@ gimp_paint_core_paste (GimpPaintCore *core,
GimpLayerModeEffects paint_mode,
GimpPaintApplicationMode mode)
{
TileManager *alt = NULL;
GeglBuffer *canvas_buffer;
GeglBuffer *base_buffer = NULL;
GeglBuffer *canvas_buffer;
if (core->use_saved_proj)
{
......@@ -907,7 +907,8 @@ gimp_paint_core_paste (GimpPaintCore *core,
}
canvas_tiles_to_canvas_buf (core);
alt = gimp_gegl_buffer_get_tiles (core->undo_buffer);
base_buffer = core->undo_buffer;
}
/* Otherwise:
* combine the canvas buf and the paint mask to the canvas buf
......@@ -929,7 +930,7 @@ gimp_paint_core_paste (GimpPaintCore *core,
core->canvas_buf->height),
FALSE, NULL,
image_opacity, paint_mode,
alt, /* specify an alternative src1 */
base_buffer, /* specify an alternative src1 */
NULL,
core->canvas_buf->x,
core->canvas_buf->y);
......
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