[gegl] graph: Always return a buffer for non-sink nodes



commit 38645ad557ee207e7886de280f0f1a640718f3dd
Author: Daniel Sabo <DanielSabo gmail com>
Date:   Sat Jun 8 09:07:22 2013 -0700

    graph: Always return a buffer for non-sink nodes
    
    Ensure that anything with an output pad returns
    a result, even when the request is empty.
    
    Calling eval on a 0x0 rect is still meaningless,
    but this should be avoided at a higher level.

 gegl/process/gegl-eval-manager.c    |    3 ---
 gegl/process/gegl-graph-traversal.c |    2 ++
 2 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/gegl/process/gegl-eval-manager.c b/gegl/process/gegl-eval-manager.c
index 04a1a70..3fd78f2 100644
--- a/gegl/process/gegl-eval-manager.c
+++ b/gegl/process/gegl-eval-manager.c
@@ -121,9 +121,6 @@ gegl_eval_manager_apply (GeglEvalManager     *self,
   g_return_val_if_fail (GEGL_IS_EVAL_MANAGER (self), NULL);
   g_return_val_if_fail (GEGL_IS_NODE (self->node), NULL);
 
-  if (roi->width <= 0 || roi->height <= 0)
-    return NULL;
-
   GEGL_INSTRUMENT_START();
   gegl_eval_manager_prepare (self);
   GEGL_INSTRUMENT_END ("gegl", "prepare-graph");
diff --git a/gegl/process/gegl-graph-traversal.c b/gegl/process/gegl-graph-traversal.c
index 4a3e16f..2b0b983 100644
--- a/gegl/process/gegl-graph-traversal.c
+++ b/gegl/process/gegl-graph-traversal.c
@@ -451,6 +451,8 @@ gegl_graph_process (GeglGraphTraversal *path)
       GValue *value = gegl_operation_context_get_value (context, "output");
       if (value)
         result = g_value_dup_object (value);
+      else if (gegl_node_has_pad (last_context->operation->node, "output"))
+        result = g_object_ref (gegl_graph_get_shared_empty (path));
       gegl_operation_context_purge (last_context);
     }
 


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