[gimp] app: use gegl_node_blit() in GimpApplicator too



commit d0ef6a5af6c8ed67e49d960f34426024f6133067
Author: Michael Natterer <mitch gimp org>
Date:   Sat Mar 2 18:50:34 2013 +0100

    app: use gegl_node_blit() in GimpApplicator too
    
    Speeds up applying by at least a factor of two. Patch from Massimo.

 app/gegl/gimpapplicator.c |   19 ++++---------------
 app/gegl/gimpapplicator.h |    1 -
 2 files changed, 4 insertions(+), 16 deletions(-)
---
diff --git a/app/gegl/gimpapplicator.c b/app/gegl/gimpapplicator.c
index ce3b3e2..9a94073 100644
--- a/app/gegl/gimpapplicator.c
+++ b/app/gegl/gimpapplicator.c
@@ -69,12 +69,6 @@ gimp_applicator_finalize (GObject *object)
       applicator->node = NULL;
     }
 
-  if (applicator->processor)
-    {
-      g_object_unref (applicator->processor);
-      applicator->processor = NULL;
-    }
-
   G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
@@ -210,8 +204,6 @@ gimp_applicator_new (GeglBuffer        *dest_buffer,
                             applicator->dest_node, "input");
     }
 
-  applicator->processor = gegl_node_new_processor (applicator->dest_node, NULL);
-
   return applicator;
 }
 
@@ -245,7 +237,6 @@ gimp_applicator_apply (GimpApplicator       *applicator,
                      NULL);
     }
 
-
   gegl_node_set (applicator->apply_offset_node,
                  "x", (gdouble) apply_buffer_x,
                  "y", (gdouble) apply_buffer_y,
@@ -261,10 +252,8 @@ gimp_applicator_apply (GimpApplicator       *applicator,
                                paint_mode, opacity, FALSE);
     }
 
-  gegl_processor_set_rectangle (applicator->processor,
-                                GEGL_RECTANGLE (apply_buffer_x,
-                                                apply_buffer_y,
-                                                width, height));
-
-  while (gegl_processor_work (applicator->processor, NULL));
+  gegl_node_blit (applicator->dest_node, 1.0,
+                  GEGL_RECTANGLE (apply_buffer_x, apply_buffer_y,
+                                  width, height),
+                  NULL, NULL, 0, GEGL_BLIT_DEFAULT);
 }
diff --git a/app/gegl/gimpapplicator.h b/app/gegl/gimpapplicator.h
index 976cda3..7b88609 100644
--- a/app/gegl/gimpapplicator.h
+++ b/app/gegl/gimpapplicator.h
@@ -42,7 +42,6 @@ struct _GimpApplicator
   GeglNode             *apply_src_node;
   GeglNode             *apply_offset_node;
   GeglNode             *dest_node;
-  GeglProcessor        *processor;
 
   GeglBuffer           *src_buffer;
   GeglBuffer           *apply_buffer;


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