[gegl] processor: do not run process for 0px contexts



commit 5d029719aa03c9769dae5b76dda1cfb24e38f535
Author: Ãyvind KolÃs <pippin gimp org>
Date:   Wed Mar 14 02:22:03 2012 +0000

    processor: do not run process for 0px contexts

 gegl/operation/gegl-operation.c  |    2 ++
 gegl/process/gegl-eval-visitor.c |    3 ++-
 2 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gegl/operation/gegl-operation.c b/gegl/operation/gegl-operation.c
index 2d4e55b..65eb2b8 100644
--- a/gegl/operation/gegl-operation.c
+++ b/gegl/operation/gegl-operation.c
@@ -119,6 +119,8 @@ gegl_operation_process (GeglOperation       *operation,
       (result->width == 0 || result->height == 0))
     {
       GeglBuffer *output = gegl_buffer_new (NULL, NULL);
+      g_warning ("processing 0px rectangle");
+      /* when this case is hit.. we've done something bad.. */
       gegl_operation_context_take_object (context, "output", G_OBJECT (output));
       return TRUE;
     }
diff --git a/gegl/process/gegl-eval-visitor.c b/gegl/process/gegl-eval-visitor.c
index 24a8965..e328c6e 100644
--- a/gegl/process/gegl-eval-visitor.c
+++ b/gegl/process/gegl-eval-visitor.c
@@ -158,7 +158,8 @@ gegl_eval_visitor_visit_pad (GeglVisitor *self,
              this very operation.
            */
           if (GEGL_IS_OPERATION_SINK (operation) &&
-              !gegl_operation_sink_needs_full (operation))
+              !gegl_operation_sink_needs_full (operation) &&
+              context->result_rect.width > 0 && context->result_rect.height > 0)
             {
               GEGL_NOTE (GEGL_DEBUG_PROCESS, "Processing pad '%s' on \"%s\"", gegl_pad_get_name (pad), gegl_node_get_debug_name (node));
               gegl_operation_process (operation, context, "output",



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