[gimp] app: remove gimp_drawable_apply_operation_to_buffer()



commit ca4dadefa4b0d39c991d726b46df78e3dc922b38
Author: Michael Natterer <mitch gimp org>
Date:   Mon Oct 22 16:14:56 2012 +0200

    app: remove gimp_drawable_apply_operation_to_buffer()
    
    it was a completely silly wrapper. Use gimp_gegl_apply_operation()
    directly instead.

 app/core/gimpchannel.c            |   34 ++++++++++++++++++++--------------
 app/core/gimpdrawable-operation.c |   19 -------------------
 app/core/gimpdrawable-operation.h |   24 +++++++++---------------
 app/core/gimpdrawable.c           |    9 +++++----
 app/core/gimplayer.c              |   19 ++++++++++++-------
 5 files changed, 46 insertions(+), 59 deletions(-)
---
diff --git a/app/core/gimpchannel.c b/app/core/gimpchannel.c
index f45bb86..30c98f5 100644
--- a/app/core/gimpchannel.c
+++ b/app/core/gimpchannel.c
@@ -47,7 +47,6 @@
 #include "gimpchannel.h"
 #include "gimpchannel-select.h"
 #include "gimpcontext.h"
-#include "gimpdrawable-operation.h"
 #include "gimpdrawable-stroke.h"
 #include "gimpmarshal.h"
 #include "gimppaintinfo.h"
@@ -479,8 +478,10 @@ gimp_channel_convert (GimpItem  *item,
       gimp_rgba_set (&background, 0.0, 0.0, 0.0, 0.0);
       flatten = gimp_gegl_create_flatten_node (&background);
 
-      gimp_drawable_apply_operation_to_buffer (drawable, NULL, NULL,
-                                               flatten, new_buffer);
+      gimp_gegl_apply_operation (gimp_drawable_get_buffer (drawable),
+                                 NULL, NULL,
+                                 flatten,
+                                 new_buffer, NULL);
 
       g_object_unref (flatten);
 
@@ -836,8 +837,10 @@ gimp_channel_convert_type (GimpDrawable      *drawable,
                                     "dither-strategy", mask_dither_type,
                                     NULL);
 
-      gimp_drawable_apply_operation_to_buffer (drawable, NULL, NULL,
-                                               dither, dest_buffer);
+      gimp_gegl_apply_operation (gimp_drawable_get_buffer (drawable),
+                                 NULL, NULL,
+                                 dither,
+                                 dest_buffer, NULL);
       g_object_unref (dither);
     }
 
@@ -1296,9 +1299,10 @@ gimp_channel_real_feather (GimpChannel *channel,
                               "std-dev-y", radius_y / 3.5,
                               NULL);
 
-  gimp_drawable_apply_operation_to_buffer (drawable, NULL, NULL,
-                                           node,
-                                           gimp_drawable_get_buffer (drawable));
+  gimp_gegl_apply_operation (gimp_drawable_get_buffer (drawable),
+                             NULL, NULL,
+                             node,
+                             gimp_drawable_get_buffer (drawable), NULL);
 
   g_object_unref (node);
 
@@ -1327,9 +1331,10 @@ gimp_channel_real_sharpen (GimpChannel *channel,
                               "value",     0.5,
                               NULL);
 
-  gimp_drawable_apply_operation_to_buffer (drawable, NULL, NULL,
-                                           node,
-                                           gimp_drawable_get_buffer (drawable));
+  gimp_gegl_apply_operation (gimp_drawable_get_buffer (drawable),
+                             NULL, NULL,
+                             node,
+                             gimp_drawable_get_buffer (drawable), NULL);
 
   g_object_unref (node);
 
@@ -1436,9 +1441,10 @@ gimp_channel_real_invert (GimpChannel *channel,
                                      "operation", "gegl:invert",
                                      NULL);
 
-      gimp_drawable_apply_operation_to_buffer (drawable, NULL, NULL,
-                                               node,
-                                               gimp_drawable_get_buffer (drawable));
+      gimp_gegl_apply_operation (gimp_drawable_get_buffer (drawable),
+                                 NULL, NULL,
+                                 node,
+                                 gimp_drawable_get_buffer (drawable), NULL);
 
       g_object_unref (node);
 
diff --git a/app/core/gimpdrawable-operation.c b/app/core/gimpdrawable-operation.c
index 4a2f0c5..bef4d29 100644
--- a/app/core/gimpdrawable-operation.c
+++ b/app/core/gimpdrawable-operation.c
@@ -102,22 +102,3 @@ gimp_drawable_apply_operation_by_name (GimpDrawable *drawable,
 
   g_object_unref (node);
 }
-
-void
-gimp_drawable_apply_operation_to_buffer (GimpDrawable *drawable,
-                                         GimpProgress *progress,
-                                         const gchar  *undo_desc,
-                                         GeglNode     *operation,
-                                         GeglBuffer   *dest_buffer)
-{
-  g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
-  g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress));
-  g_return_if_fail (progress == NULL || undo_desc != NULL);
-  g_return_if_fail (GEGL_IS_NODE (operation));
-  g_return_if_fail (GEGL_IS_BUFFER (dest_buffer));
-
-  gimp_gegl_apply_operation (gimp_drawable_get_buffer (drawable),
-                             progress, undo_desc,
-                             operation,
-                             dest_buffer, NULL);
-}
diff --git a/app/core/gimpdrawable-operation.h b/app/core/gimpdrawable-operation.h
index f830403..67f618c 100644
--- a/app/core/gimpdrawable-operation.h
+++ b/app/core/gimpdrawable-operation.h
@@ -24,21 +24,15 @@
 #define __GIMP_DRAWABLE_OPERATION_H__
 
 
-void   gimp_drawable_apply_operation           (GimpDrawable *drawable,
-                                                GimpProgress *progress,
-                                                const gchar  *undo_desc,
-                                                GeglNode     *operation);
-void   gimp_drawable_apply_operation_by_name   (GimpDrawable *drawable,
-                                                GimpProgress *progress,
-                                                const gchar  *undo_desc,
-                                                const gchar  *operation_type,
-                                                GObject      *config);
-
-void   gimp_drawable_apply_operation_to_buffer (GimpDrawable *drawable,
-                                                GimpProgress *progress,
-                                                const gchar  *undo_desc,
-                                                GeglNode     *operation,
-                                                GeglBuffer   *dest_buffer);
+void   gimp_drawable_apply_operation         (GimpDrawable *drawable,
+                                              GimpProgress *progress,
+                                              const gchar  *undo_desc,
+                                              GeglNode     *operation);
+void   gimp_drawable_apply_operation_by_name (GimpDrawable *drawable,
+                                              GimpProgress *progress,
+                                              const gchar  *undo_desc,
+                                              const gchar  *operation_type,
+                                              GObject      *config);
 
 
 #endif /* __GIMP_DRAWABLE_OPERATION_H__ */
diff --git a/app/core/gimpdrawable.c b/app/core/gimpdrawable.c
index 6810858..f224c03 100644
--- a/app/core/gimpdrawable.c
+++ b/app/core/gimpdrawable.c
@@ -28,6 +28,7 @@
 #include "core-types.h"
 
 #include "gegl/gimp-babl.h"
+#include "gegl/gimp-gegl-apply-operation.h"
 #include "gegl/gimp-gegl-nodes.h"
 #include "gegl/gimp-gegl-utils.h"
 
@@ -35,7 +36,6 @@
 #include "gimpchannel.h"
 #include "gimpcontext.h"
 #include "gimpdrawable-combine.h"
-#include "gimpdrawable-operation.h"
 #include "gimpdrawable-preview.h"
 #include "gimpdrawable-private.h"
 #include "gimpdrawable-shadow.h"
@@ -431,9 +431,10 @@ gimp_drawable_scale (GimpItem              *item,
                                 gimp_item_get_height (item)),
                  NULL);
 
-  gimp_drawable_apply_operation_to_buffer (drawable, progress,
-                                           C_("undo-type", "Scale"),
-                                           scale, new_buffer);
+  gimp_gegl_apply_operation (gimp_drawable_get_buffer (drawable),
+                             progress, C_("undo-type", "Scale"),
+                             scale,
+                             new_buffer, NULL);
   g_object_unref (scale);
 
   gimp_drawable_set_buffer_full (drawable, gimp_item_is_attached (item), NULL,
diff --git a/app/core/gimplayer.c b/app/core/gimplayer.c
index bf2612f..b536a8d 100644
--- a/app/core/gimplayer.c
+++ b/app/core/gimplayer.c
@@ -38,7 +38,6 @@
 #include "gimpchannel-select.h"
 #include "gimpcontext.h"
 #include "gimpcontainer.h"
-#include "gimpdrawable-operation.h"
 #include "gimperror.h"
 #include "gimpimage-undo-push.h"
 #include "gimpimage-undo.h"
@@ -990,8 +989,10 @@ gimp_layer_convert_type (GimpDrawable      *drawable,
                                     "dither-strategy", layer_dither_type,
                                     NULL);
 
-      gimp_drawable_apply_operation_to_buffer (drawable, NULL, NULL,
-                                               dither, dest_buffer);
+      gimp_gegl_apply_operation (gimp_drawable_get_buffer (drawable),
+                                 NULL, NULL,
+                                 dither,
+                                 dest_buffer, NULL);
       g_object_unref (dither);
     }
 
@@ -1620,8 +1621,10 @@ gimp_layer_apply_mask (GimpLayer         *layer,
       apply_opacity = gimp_gegl_create_apply_opacity_node (mask_buffer, 0, 0,
                                                            1.0);
 
-      gimp_drawable_apply_operation_to_buffer (GIMP_DRAWABLE (layer), NULL, NULL,
-                                               apply_opacity, dest_buffer);
+      gimp_gegl_apply_operation (gimp_drawable_get_buffer (GIMP_DRAWABLE (layer)),
+                                 NULL, NULL,
+                                 apply_opacity,
+                                 dest_buffer, NULL);
 
       g_object_unref (apply_opacity);
     }
@@ -1869,8 +1872,10 @@ gimp_layer_flatten (GimpLayer   *layer,
   gimp_context_get_background (context, &background);
   flatten = gimp_gegl_create_flatten_node (&background);
 
-  gimp_drawable_apply_operation_to_buffer (GIMP_DRAWABLE (layer), NULL, NULL,
-                                           flatten, new_buffer);
+  gimp_gegl_apply_operation (gimp_drawable_get_buffer (GIMP_DRAWABLE (layer)),
+                             NULL, NULL,
+                             flatten,
+                             new_buffer, NULL);
 
   g_object_unref (flatten);
 



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