Commit ca4dadef authored by Michael Natterer's avatar Michael Natterer 😴

app: remove gimp_drawable_apply_operation_to_buffer()

it was a completely silly wrapper. Use gimp_gegl_apply_operation()
directly instead.
parent eb89a545
......@@ -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);
......
......@@ -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);
}
......@@ -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__ */
......@@ -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,
......
......@@ -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);
......
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