diff --git a/app/core/gimp-edit.c b/app/core/gimp-edit.c index c065cc1de4..c1ed1ba03f 100644 --- a/app/core/gimp-edit.c +++ b/app/core/gimp-edit.c @@ -501,7 +501,6 @@ gimp_edit_fill_full (GimpImage *image, GEGL_RECTANGLE (0, 0, width, height), TRUE, undo_desc, opacity, paint_mode, - NULL, x, y, NULL, x, y); g_object_unref (dest_buffer); @@ -542,7 +541,6 @@ gimp_edit_fade (GimpImage *image, gimp_object_get_name (undo), gimp_context_get_opacity (context), gimp_context_get_paint_mode (context), - NULL, undo->x, undo->y, NULL, undo->x, undo->y); g_object_unref (buffer); diff --git a/app/core/gimpchannel.c b/app/core/gimpchannel.c index 9e0a0e0e48..0518453915 100644 --- a/app/core/gimpchannel.c +++ b/app/core/gimpchannel.c @@ -144,10 +144,7 @@ static void gimp_channel_apply_buffer (GimpDrawable *drawable, GimpLayerModeEffects mode, GeglBuffer *base_buffer, gint base_x, - gint base_y, - GeglBuffer *dest_buffer, - gint dest_x, - gint dest_y); + gint base_y); static void gimp_channel_replace_buffer (GimpDrawable *drawable, GeglBuffer *buffer, const GeglRectangle *buffer_region, @@ -821,10 +818,7 @@ gimp_channel_apply_buffer (GimpDrawable *drawable, GimpLayerModeEffects mode, GeglBuffer *base_buffer, gint base_x, - gint base_y, - GeglBuffer *dest_buffer, - gint dest_x, - gint dest_y) + gint base_y) { gimp_drawable_invalidate_boundary (drawable); @@ -833,9 +827,7 @@ gimp_channel_apply_buffer (GimpDrawable *drawable, push_undo, undo_desc, opacity, mode, base_buffer, - base_x, base_y, - dest_buffer, - dest_x, dest_y); + base_x, base_y); GIMP_CHANNEL (drawable)->bounds_known = FALSE; } diff --git a/app/core/gimpdrawable-blend.c b/app/core/gimpdrawable-blend.c index eaf99c8954..6c16b67c68 100644 --- a/app/core/gimpdrawable-blend.c +++ b/app/core/gimpdrawable-blend.c @@ -207,7 +207,6 @@ gimp_drawable_blend (GimpDrawable *drawable, GEGL_RECTANGLE (0, 0, width, height), TRUE, C_("undo-type", "Blend"), opacity, paint_mode, - NULL, x, y, NULL, x, y); /* update the image */ diff --git a/app/core/gimpdrawable-bucket-fill.c b/app/core/gimpdrawable-bucket-fill.c index 231b36b874..0fcb61e1b9 100644 --- a/app/core/gimpdrawable-bucket-fill.c +++ b/app/core/gimpdrawable-bucket-fill.c @@ -263,7 +263,6 @@ gimp_drawable_bucket_fill_internal (GimpDrawable *drawable, GEGL_RECTANGLE (0, 0, x2 - x1, y2 - y1), TRUE, C_("undo-type", "Bucket Fill"), opacity, paint_mode, - NULL, x1, y1, NULL, x1, y1); g_object_unref (buffer); diff --git a/app/core/gimpdrawable-combine.c b/app/core/gimpdrawable-combine.c index ef6084db65..c8d9d9f4c9 100644 --- a/app/core/gimpdrawable-combine.c +++ b/app/core/gimpdrawable-combine.c @@ -23,10 +23,6 @@ #include "core-types.h" -#include "base/pixel-region.h" - -#include "paint-funcs/paint-funcs.h" - #include "gegl/gimp-babl-compat.h" #include "gegl/gimp-gegl-loops.h" #include "gegl/gimp-gegl-nodes.h" @@ -52,17 +48,16 @@ gimp_drawable_real_apply_buffer (GimpDrawable *drawable, GimpLayerModeEffects mode, GeglBuffer *base_buffer, gint base_x, - gint base_y, - GeglBuffer *dest_buffer, - gint dest_x, - gint dest_y) + gint base_y) { - GimpItem *item = GIMP_ITEM (drawable); - GimpImage *image = gimp_item_get_image (item); - GimpChannel *mask = gimp_image_get_mask (image); - GeglBuffer *mask_buffer = NULL; - gint x, y, width, height; - gint offset_x, offset_y; + GimpItem *item = GIMP_ITEM (drawable); + GimpImage *image = gimp_item_get_image (item); + GimpChannel *mask = gimp_image_get_mask (image); + GeglBuffer *mask_buffer = NULL; + GeglNode *apply; + GimpComponentMask affect; + gint x, y, width, height; + gint offset_x, offset_y; /* don't apply the mask to itself and don't apply an empty mask */ if (GIMP_DRAWABLE (mask) == drawable || gimp_channel_is_empty (mask)) @@ -127,123 +122,28 @@ gimp_drawable_real_apply_buffer (GimpDrawable *drawable, if (mask) mask_buffer = gimp_drawable_get_buffer (GIMP_DRAWABLE (mask)); - if (gimp_use_gegl (image->gimp) && ! dest_buffer) - { - GeglNode *apply; - GimpComponentMask affect; + affect = gimp_drawable_get_active_mask (drawable); - dest_buffer = gimp_drawable_get_buffer (drawable); + apply = gimp_gegl_create_apply_buffer_node (buffer, + base_x - buffer_region->x, + base_y - buffer_region->y, + 0, + 0, + 0, + 0, + mask_buffer, + -offset_x, + -offset_y, + opacity, + mode, + affect); - affect = gimp_drawable_get_active_mask (drawable); + gimp_apply_operation (base_buffer, NULL, NULL, + apply, + gimp_drawable_get_buffer (drawable), + GEGL_RECTANGLE (x, y, width, height)); - apply = gimp_gegl_create_apply_buffer_node (buffer, - base_x - buffer_region->x, - base_y - buffer_region->y, - 0, - 0, - 0, - 0, - mask_buffer, - -offset_x, - -offset_y, - opacity, - mode, - affect); - - gimp_apply_operation (base_buffer, NULL, NULL, - apply, - dest_buffer, - GEGL_RECTANGLE (x, y, width, height)); - - g_object_unref (apply); - } - else - { - PixelRegion src1PR, src2PR, destPR; - CombinationMode operation; - gboolean active_components[MAX_CHANNELS]; - - if (gimp_gegl_buffer_get_temp_buf (buffer)) - { - pixel_region_init_temp_buf (&src2PR, - gimp_gegl_buffer_get_temp_buf (buffer), - buffer_region->x, buffer_region->y, - buffer_region->width, buffer_region->height); - } - else - { - pixel_region_init (&src2PR, gimp_gegl_buffer_get_tiles (buffer), - buffer_region->x, buffer_region->y, - buffer_region->width, buffer_region->height, - FALSE); - } - - /* 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_babl_format_get_image_type (gimp_drawable_get_format (drawable)), - src2PR.bytes); - if (operation == -1) - { - g_warning ("%s: illegal parameters.", G_STRFUNC); - return; - } - - /* configure the pixel regions */ - - pixel_region_init (&src1PR, gimp_gegl_buffer_get_tiles (base_buffer), - x, y, width, height, - FALSE); - - pixel_region_resize (&src2PR, - src2PR.x + (x - base_x), src2PR.y + (y - base_y), - width, height); - - if (dest_buffer) - { - pixel_region_init (&destPR, gimp_gegl_buffer_get_tiles (dest_buffer), - dest_x, dest_y, - buffer_region->width, buffer_region->height, - TRUE); - } - else - { - dest_buffer = gimp_drawable_get_buffer (drawable); - - pixel_region_init (&destPR, gimp_gegl_buffer_get_tiles (dest_buffer), - x, y, width, height, - TRUE); - } - - if (mask_buffer) - { - PixelRegion maskPR; - - pixel_region_init (&maskPR, - gimp_gegl_buffer_get_tiles (mask_buffer), - x + offset_x, - y + offset_y, - width, height, - FALSE); - - combine_regions (&src1PR, &src2PR, &destPR, &maskPR, NULL, - opacity * 255.999, - mode, - active_components, - operation); - } - else - { - combine_regions (&src1PR, &src2PR, &destPR, NULL, NULL, - opacity * 255.999, - mode, - active_components, - operation); - } - } + g_object_unref (apply); } /* Similar to gimp_drawable_apply_region but works in "replace" mode (i.e. diff --git a/app/core/gimpdrawable-combine.h b/app/core/gimpdrawable-combine.h index 16a7d56b47..503c277e15 100644 --- a/app/core/gimpdrawable-combine.h +++ b/app/core/gimpdrawable-combine.h @@ -30,10 +30,7 @@ void gimp_drawable_real_apply_buffer (GimpDrawable *drawable, GimpLayerModeEffects mode, GeglBuffer *base_buffer, gint base_x, - gint base_y, - GeglBuffer *dest_buffer, - gint dest_x, - gint dest_y); + gint base_y); void gimp_drawable_real_replace_buffer (GimpDrawable *drawable, GeglBuffer *buffer, const GeglRectangle *buffer_region, diff --git a/app/core/gimpdrawable-shadow.c b/app/core/gimpdrawable-shadow.c index 2d349e87c7..54c6f674a4 100644 --- a/app/core/gimpdrawable-shadow.c +++ b/app/core/gimpdrawable-shadow.c @@ -103,7 +103,6 @@ gimp_drawable_merge_shadow_buffer (GimpDrawable *drawable, GEGL_RECTANGLE (x, y, width, height), push_undo, undo_desc, GIMP_OPACITY_OPAQUE, GIMP_REPLACE_MODE, - NULL, x, y, NULL, x, y); g_object_unref (buffer); diff --git a/app/core/gimpdrawable-stroke.c b/app/core/gimpdrawable-stroke.c index d341efc139..8151050679 100644 --- a/app/core/gimpdrawable-stroke.c +++ b/app/core/gimpdrawable-stroke.c @@ -395,7 +395,6 @@ gimp_drawable_stroke_scan_convert (GimpDrawable *drawable, push_undo, C_("undo-type", "Render Stroke"), gimp_context_get_opacity (context), gimp_context_get_paint_mode (context), - NULL, x, y, NULL, x, y); g_object_unref (base_buffer); diff --git a/app/core/gimpdrawable.c b/app/core/gimpdrawable.c index 2574bea09d..bfac48df02 100644 --- a/app/core/gimpdrawable.c +++ b/app/core/gimpdrawable.c @@ -1188,26 +1188,20 @@ gimp_drawable_apply_buffer (GimpDrawable *drawable, GimpLayerModeEffects mode, GeglBuffer *base_buffer, gint base_x, - gint base_y, - GeglBuffer *dest_buffer, - gint dest_x, - gint dest_y) + gint base_y) { g_return_if_fail (GIMP_IS_DRAWABLE (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)); - g_return_if_fail (dest_buffer == NULL || GEGL_IS_BUFFER (dest_buffer)); GIMP_DRAWABLE_GET_CLASS (drawable)->apply_buffer (drawable, buffer, buffer_region, push_undo, undo_desc, opacity, mode, base_buffer, - base_x, base_y, - dest_buffer, - dest_x, dest_y); + base_x, base_y); } void diff --git a/app/core/gimpdrawable.h b/app/core/gimpdrawable.h index 0d81a81205..cd4c1481e0 100644 --- a/app/core/gimpdrawable.h +++ b/app/core/gimpdrawable.h @@ -74,10 +74,7 @@ struct _GimpDrawableClass GimpLayerModeEffects mode, GeglBuffer *base_buffer, gint base_x, - gint base_y, - GeglBuffer *dest_buffer, - gint dest_x, - gint dest_y); + gint base_y); void (* replace_buffer) (GimpDrawable *drawable, GeglBuffer *buffer, const GeglRectangle *buffer_region, @@ -151,10 +148,7 @@ void gimp_drawable_apply_buffer (GimpDrawable *drawable, GimpLayerModeEffects mode, GeglBuffer *base_buffer, gint base_x, - gint base_y, - GeglBuffer *dest_buffer, - gint dest_x, - gint dest_y); + gint base_y); void gimp_drawable_replace_buffer (GimpDrawable *drawable, GeglBuffer *buffer, const GeglRectangle *buffer_region, diff --git a/app/core/gimpimagemap.c b/app/core/gimpimagemap.c index ef528e58fd..6d04948dcd 100644 --- a/app/core/gimpimagemap.c +++ b/app/core/gimpimagemap.c @@ -680,7 +680,6 @@ gimp_image_map_data_written (GObject *operation, extent->width, extent->height), FALSE, NULL, GIMP_OPACITY_OPAQUE, GIMP_REPLACE_MODE, - NULL, extent->x, extent->y, NULL, extent->x, extent->y); gimp_drawable_update (image_map->drawable, diff --git a/app/core/gimplayer-floating-sel.c b/app/core/gimplayer-floating-sel.c index 0d8c159d42..e24a894126 100644 --- a/app/core/gimplayer-floating-sel.c +++ b/app/core/gimplayer-floating-sel.c @@ -337,9 +337,6 @@ floating_sel_composite (GimpLayer *layer) gimp_layer_get_mode (layer), NULL, combine_x - dr_off_x, - combine_y - dr_off_y, - NULL, - combine_x - dr_off_x, combine_y - dr_off_y); /* restore lock alpha */ diff --git a/app/paint/gimppaintcore.c b/app/paint/gimppaintcore.c index a1a8b7cf1d..1ac0662578 100644 --- a/app/paint/gimppaintcore.c +++ b/app/paint/gimppaintcore.c @@ -760,9 +760,6 @@ gimp_paint_core_paste (GimpPaintCore *core, image_opacity, paint_mode, base_buffer, /* specify an alternative src1 */ core->paint_buffer_x, - core->paint_buffer_y, - NULL, - core->paint_buffer_x, core->paint_buffer_y); /* Update the undo extents */