[gimp/gimp-2-10] Issue #886 - Artifacts symmetry painting with big brushes



commit 4208ff8147d1c24565b39f4417219f60b8dc4a2b
Author: Ell <ell_se yahoo com>
Date:   Mon May 27 11:07:20 2019 -0400

    Issue #886 - Artifacts symmetry painting with big brushes
    
    In GimpClone and GimpHeal, use gimp_gegl_apply_operation(), instead
    of gegl_node_process(), to apply the symmetry transform, which both
    performs chunking and avoids aliasing problems.
    
    (cherry picked from commit 024bc4cd3fc5362e84f9270cc93fd23d51366c4c)

 app/paint/gimpclone.c | 21 ++++-----------------
 app/paint/gimpheal.c  | 20 +++-----------------
 2 files changed, 7 insertions(+), 34 deletions(-)
---
diff --git a/app/paint/gimpclone.c b/app/paint/gimpclone.c
index 24b32e187a..464a3a4ba4 100644
--- a/app/paint/gimpclone.c
+++ b/app/paint/gimpclone.c
@@ -27,6 +27,7 @@
 
 #include "paint-types.h"
 
+#include "gegl/gimp-gegl-apply-operation.h"
 #include "gegl/gimp-gegl-loops.h"
 
 #include "core/gimp.h"
@@ -178,25 +179,11 @@ gimp_clone_motion (GimpSourceCore   *source_core,
                              GEGL_RECTANGLE (paint_area_offset_x,
                                              paint_area_offset_y,
                                              0, 0));
+
       if (op)
         {
-          GeglNode    *graph, *source, *target;
-
-          graph    = gegl_node_new ();
-          source   = gegl_node_new_child (graph,
-                                          "operation", "gegl:buffer-source",
-                                          "buffer", paint_buffer,
-                                          NULL);
-          gegl_node_add_child (graph, op);
-          target  = gegl_node_new_child (graph,
-                                         "operation", "gegl:write-buffer",
-                                         "buffer", paint_buffer,
-                                         NULL);
-
-          gegl_node_link_many (source, op, target, NULL);
-          gegl_node_process (target);
-
-          g_object_unref (graph);
+          gimp_gegl_apply_operation (paint_buffer, NULL, NULL, op,
+                                     paint_buffer, NULL, FALSE);
         }
     }
   else if (options->clone_type == GIMP_CLONE_PATTERN)
diff --git a/app/paint/gimpheal.c b/app/paint/gimpheal.c
index c4e9ada09d..2901df3315 100644
--- a/app/paint/gimpheal.c
+++ b/app/paint/gimpheal.c
@@ -32,6 +32,7 @@
 
 #include "paint-types.h"
 
+#include "gegl/gimp-gegl-apply-operation.h"
 #include "gegl/gimp-gegl-loops.h"
 
 #include "core/gimpbrush.h"
@@ -611,23 +612,8 @@ gimp_heal_motion (GimpSourceCore   *source_core,
 
   if (op)
     {
-      GeglNode    *graph, *source, *target;
-
-      graph    = gegl_node_new ();
-      source   = gegl_node_new_child (graph,
-                                      "operation", "gegl:buffer-source",
-                                      "buffer", src_copy,
-                                      NULL);
-      gegl_node_add_child (graph, op);
-      target  = gegl_node_new_child (graph,
-                                     "operation", "gegl:write-buffer",
-                                     "buffer", src_copy,
-                                     NULL);
-
-      gegl_node_link_many (source, op, target, NULL);
-      gegl_node_process (target);
-
-      g_object_unref (graph);
+      gimp_gegl_apply_operation (src_copy, NULL, NULL, op,
+                                 src_copy, NULL, FALSE);
     }
 
   gimp_heal (src_copy,


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