[gimp/gimp-2-10] app: in gimppaintcore-loops, remove individual-algorithm functions



commit 3dd2cf27b5ce3a96e0230cc2cd42036e0d6ea8ab
Author: Ell <ell_se yahoo com>
Date:   Sat Feb 16 08:26:47 2019 -0500

    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.
    
    (cherry picked from commit 95761db5574cad38ff3afecd0713da25a5598cec)

 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 c6753c33c0..92e5928920 100644
--- a/app/paint/gimppaintcore-loops.cc
+++ b/app/paint/gimppaintcore-loops.cc
@@ -1900,139 +1900,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 (
-    &params,
-    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 (
-    &params,
-    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 (
-    &params,
-    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 (
-    &params,
-    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 959fa12517..a2d5c2efcd 100644
--- a/app/paint/gimppaintcore-loops.h
+++ b/app/paint/gimppaintcore-loops.h
@@ -60,46 +60,15 @@ typedef struct
 } GimpPaintCoreLoopsParams;
 
 
-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,
-                                          gboolean                        linear_mode);
+void   gimp_paint_core_loops_process (const GimpPaintCoreLoopsParams *params,
+                                      GimpPaintCoreLoopsAlgorithm     algorithms);
+
+void   mask_components_onto          (GeglBuffer                     *src_buffer,
+                                      GeglBuffer                     *aux_buffer,
+                                      GeglBuffer                     *dst_buffer,
+                                      const GeglRectangle            *roi,
+                                      GimpComponentMask               mask,
+                                      gboolean                        linear_mode);
 
 
 #endif /* __GIMP_PAINT_CORE_LOOPS_H__ */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]