From 95761db5574cad38ff3afecd0713da25a5598cec Mon Sep 17 00:00:00 2001 From: Ell Date: Sat, 16 Feb 2019 08:26:47 -0500 Subject: [PATCH] app: in gimppaintcore-loops, remove individual-algorithm functions In gimppaintcore-loops, remove the individual-algorithm convenience functions, which are merely wrappers around gimp_paint_core_loops_process(), and aren't used anywhere anymore. This allows us to avoid instanciating certain algorithm-hierarchies which aren't used in practice, as will be done by the following commits. --- app/paint/gimppaintcore-loops.cc | 133 ------------------------------- app/paint/gimppaintcore-loops.h | 49 +++--------- 2 files changed, 9 insertions(+), 173 deletions(-) diff --git a/app/paint/gimppaintcore-loops.cc b/app/paint/gimppaintcore-loops.cc index 5bb1b89511..d4fa6d9fa8 100644 --- a/app/paint/gimppaintcore-loops.cc +++ b/app/paint/gimppaintcore-loops.cc @@ -1902,139 +1902,6 @@ gimp_paint_core_loops_process (const GimpPaintCoreLoopsParams *params, } -/* combine_paint_mask_to_canvas_buffer(): - * - * A convenience wrapper around 'gimp_paint_core_loops_process()', performing - * just the COMBINE_PAINT_MASK_TO_CANVAS_BUFFER algorithm. - */ - -void -combine_paint_mask_to_canvas_buffer (const GimpTempBuf *paint_mask, - gint mask_x_offset, - gint mask_y_offset, - GeglBuffer *canvas_buffer, - gint x_offset, - gint y_offset, - gfloat opacity, - gboolean stipple) -{ - GimpPaintCoreLoopsParams params = {}; - - params.canvas_buffer = canvas_buffer; - - params.paint_buf_offset_x = x_offset; - params.paint_buf_offset_y = y_offset; - - params.paint_mask = paint_mask; - params.paint_mask_offset_x = mask_x_offset; - params.paint_mask_offset_y = mask_y_offset; - - params.stipple = stipple; - - params.paint_opacity = opacity; - - gimp_paint_core_loops_process ( - ¶ms, - GIMP_PAINT_CORE_LOOPS_ALGORITHM_COMBINE_PAINT_MASK_TO_CANVAS_BUFFER); -} - - -/* canvas_buffer_to_paint_buf_alpha(): - * - * A convenience wrapper around 'gimp_paint_core_loops_process()', performing - * just the CANVAS_BUFFER_TO_PAINT_BUF_ALPHA algorithm. - */ - -void -canvas_buffer_to_paint_buf_alpha (GimpTempBuf *paint_buf, - GeglBuffer *canvas_buffer, - gint x_offset, - gint y_offset) -{ - GimpPaintCoreLoopsParams params = {}; - - params.canvas_buffer = canvas_buffer; - - params.paint_buf = paint_buf; - params.paint_buf_offset_x = x_offset; - params.paint_buf_offset_y = y_offset; - - gimp_paint_core_loops_process ( - ¶ms, - GIMP_PAINT_CORE_LOOPS_ALGORITHM_CANVAS_BUFFER_TO_PAINT_BUF_ALPHA); -} - - -/* paint_mask_to_paint_buf_alpha(): - * - * A convenience wrapper around 'gimp_paint_core_loops_process()', performing - * just the PAINT_MASK_TO_PAINT_BUF_ALPHA algorithm. - */ - -void -paint_mask_to_paint_buf_alpha (const GimpTempBuf *paint_mask, - gint mask_x_offset, - gint mask_y_offset, - GimpTempBuf *paint_buf, - gfloat paint_opacity) -{ - GimpPaintCoreLoopsParams params = {}; - - params.paint_buf = paint_buf; - - params.paint_mask = paint_mask; - params.paint_mask_offset_x = mask_x_offset; - params.paint_mask_offset_y = mask_y_offset; - - params.paint_opacity = paint_opacity; - - gimp_paint_core_loops_process ( - ¶ms, - GIMP_PAINT_CORE_LOOPS_ALGORITHM_PAINT_MASK_TO_PAINT_BUF_ALPHA); -} - - -/* do_layer_blend(): - * - * A convenience wrapper around 'gimp_paint_core_loops_process()', performing - * just the DO_LAYER_BLEND algorithm. - */ - -void -do_layer_blend (GeglBuffer *src_buffer, - GeglBuffer *dst_buffer, - GimpTempBuf *paint_buf, - GeglBuffer *mask_buffer, - gfloat opacity, - gint x_offset, - gint y_offset, - gint mask_x_offset, - gint mask_y_offset, - GimpLayerMode paint_mode) -{ - GimpPaintCoreLoopsParams params = {}; - - params.paint_buf = paint_buf; - params.paint_buf_offset_x = x_offset; - params.paint_buf_offset_y = y_offset; - - params.src_buffer = src_buffer; - params.dest_buffer = dst_buffer; - - params.mask_buffer = mask_buffer; - params.mask_offset_x = mask_x_offset; - params.mask_offset_y = mask_y_offset; - - params.image_opacity = opacity; - - params.paint_mode = paint_mode; - - gimp_paint_core_loops_process ( - ¶ms, - GIMP_PAINT_CORE_LOOPS_ALGORITHM_DO_LAYER_BLEND); -} - - /* mask_components_onto(): * * Copies the contents of 'src_buffer' and 'aux_buffer' into 'dst_buffer', over diff --git a/app/paint/gimppaintcore-loops.h b/app/paint/gimppaintcore-loops.h index 18354747cf..36974d5e27 100644 --- a/app/paint/gimppaintcore-loops.h +++ b/app/paint/gimppaintcore-loops.h @@ -60,47 +60,16 @@ typedef struct } GimpPaintCoreLoopsParams; -void gimp_paint_core_loops_process (const GimpPaintCoreLoopsParams *params, - GimpPaintCoreLoopsAlgorithm algorithms); +void gimp_paint_core_loops_process (const GimpPaintCoreLoopsParams *params, + GimpPaintCoreLoopsAlgorithm algorithms); -void combine_paint_mask_to_canvas_buffer (const GimpTempBuf *paint_mask, - gint mask_x_offset, - gint mask_y_offset, - GeglBuffer *canvas_buffer, - gint x_offset, - gint y_offset, - gfloat opacity, - gboolean stipple); - -void canvas_buffer_to_paint_buf_alpha (GimpTempBuf *paint_buf, - GeglBuffer *canvas_buffer, - gint x_offset, - gint y_offset); - -void paint_mask_to_paint_buf_alpha (const GimpTempBuf *paint_mask, - gint mask_x_offset, - gint mask_y_offset, - GimpTempBuf *paint_buf, - gfloat paint_opacity); - -void do_layer_blend (GeglBuffer *src_buffer, - GeglBuffer *dst_buffer, - GimpTempBuf *paint_buf, - GeglBuffer *mask_buffer, - gfloat opacity, - gint x_offset, - gint y_offset, - gint mask_x_offset, - gint mask_y_offset, - GimpLayerMode paint_mode); - -void mask_components_onto (GeglBuffer *src_buffer, - GeglBuffer *aux_buffer, - GeglBuffer *dst_buffer, - const GeglRectangle *roi, - GimpComponentMask mask, - GimpTRCType trc, - const Babl *space); +void mask_components_onto (GeglBuffer *src_buffer, + GeglBuffer *aux_buffer, + GeglBuffer *dst_buffer, + const GeglRectangle *roi, + GimpComponentMask mask, + GimpTRCType trc, + const Babl *space); #endif /* __GIMP_PAINT_CORE_LOOPS_H__ */