[gegl/wip/pippin/pipeline: 93/95] disable and move debug output to non-threaded spot



commit d8829e0e2f74cbfc359b8cbd1b97a8f8a7fb7ad3
Author: Øyvind Kolås <pippin gimp org>
Date:   Wed Jul 25 23:58:01 2018 +0200

    disable and move debug output to non-threaded spot

 gegl/operation/gegl-operation-pipeline.c | 48 ++++++++++++++++++++++++--------
 1 file changed, 36 insertions(+), 12 deletions(-)
---
diff --git a/gegl/operation/gegl-operation-pipeline.c b/gegl/operation/gegl-operation-pipeline.c
index 006f198af..a965a87d5 100644
--- a/gegl/operation/gegl-operation-pipeline.c
+++ b/gegl/operation/gegl-operation-pipeline.c
@@ -188,7 +188,6 @@ _gegl_operation_pipeline_process (GeglOperationPipeLine  *pipeline,
   void *cur_input = NULL;
   void *cur_output = NULL;
   int   buf_mod = 0;
-  fprintf (stderr, "{%i}", pipeline->entries);
 
   if (pipeline->input)
     input_handle = gegl_buffer_iterator_add (i, pipeline->input, result, level,
@@ -200,20 +199,19 @@ _gegl_operation_pipeline_process (GeglOperationPipeLine  *pipeline,
     for (e = 0; e < pipeline->entries; e++)
     {
       PipeEntry *entry = &pipeline->entry[e];
-      fprintf (stderr, "%s ", gegl_operation_get_name (entry->operation));
       switch (pipeline->entry[e].in_pads)
       {
         case 3:
-          if (pipeline->entry[e].aux2)
-            pipeline->entry[e].aux2_handle =
-               gegl_buffer_iterator_add (i, pipeline->entry[e].aux2, result, level,
-                                         pipeline->entry[e].aux2_format,
+          if (entry->aux2)
+            entry->aux2_handle =
+               gegl_buffer_iterator_add (i, entry->aux2, result, level,
+                                         entry->aux2_format,
                                          GEGL_ACCESS_READ, GEGL_ABYSS_NONE);
         case 2:
-          if (pipeline->entry[e].aux)
-            pipeline->entry[e].aux_handle =
-               gegl_buffer_iterator_add (i, pipeline->entry[e].aux, result, level,
-                                         pipeline->entry[e].aux_format,
+          if (entry->aux)
+            entry->aux_handle =
+               gegl_buffer_iterator_add (i, entry->aux, result, level,
+                                         entry->aux_format,
                                          GEGL_ACCESS_READ, GEGL_ABYSS_NONE);
         case 1:
         default:
@@ -221,7 +219,6 @@ _gegl_operation_pipeline_process (GeglOperationPipeLine  *pipeline,
       }
     }
   }
-  fprintf (stderr, "\n");
 
   while (gegl_buffer_iterator_next (i))
     {
@@ -244,7 +241,8 @@ _gegl_operation_pipeline_process (GeglOperationPipeLine  *pipeline,
         PipeEntry *entry = &pipeline->entry[e];
         if (e == 0)
           {
-            cur_input = i->items[input_handle].data;
+            if (pipeline->input)
+              cur_input = i->items[input_handle].data;
           }
         else
           {
@@ -274,6 +272,20 @@ _gegl_operation_pipeline_process (GeglOperationPipeLine  *pipeline,
 
         switch (entry->in_pads)
         {
+          case 0:
+          {
+            gboolean (*process)(GeglOperation *,
+                                void *,
+                                glong,
+                                const GeglRectangle *,
+                                gint) = (void*)entry->process;
+
+            process (entry->operation,
+                     cur_output,
+                     i->length,
+                     &(i->items[0].roi),
+                     level);
+          }break;
           case 1:
           {
             gboolean (*process)(GeglOperation *,
@@ -408,6 +420,18 @@ gegl_operation_pipeline_process (GeglOperationPipeLine *pipeline,
                                  gint                   level)
 {
   gint threads = gegl_config_threads();
+
+  if (0) {
+    gint e;
+    fprintf (stderr, "{%i}", pipeline->entries);
+    for (e = 0; e < pipeline->entries; e++)
+    {
+      PipeEntry *entry = &pipeline->entry[e];
+      fprintf (stderr, "%s ", gegl_operation_get_name (entry->operation));
+  }
+  fprintf (stderr, "\n");
+  }
+
   if (threads == 1 || result->width * result->height < 64*64 || result->height < threads)
   {
     return _gegl_operation_pipeline_process (pipeline, output, result, level);


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