[gegl] Reduce number of needed iterators.



commit 44feda7ebd03c172691bf12328f73cdf85e2d17b
Author: �yvind Kolås <pippin gimp org>
Date:   Tue Dec 1 03:09:23 2009 +0000

    Reduce number of needed iterators.

 gegl/operation/gegl-operation-point-composer.c |    2 +-
 gegl/operation/gegl-operation-point-filter.c   |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gegl/operation/gegl-operation-point-composer.c b/gegl/operation/gegl-operation-point-composer.c
index 0590cd3..29c22e9 100644
--- a/gegl/operation/gegl-operation-point-composer.c
+++ b/gegl/operation/gegl-operation-point-composer.c
@@ -146,7 +146,7 @@ gegl_operation_point_composer_process (GeglOperation       *operation,
   if ((result->width > 0) && (result->height > 0))
     {
       GeglBufferIterator *i = gegl_buffer_iterator_new (output, result, out_format, GEGL_BUFFER_WRITE);
-      gint read  = gegl_buffer_iterator_add (i, input,  result, in_format, GEGL_BUFFER_READ);
+      gint read  = input == result ? 0 : gegl_buffer_iterator_add (i, input,  result, in_format, GEGL_BUFFER_READ);
 
       if (aux)
         {
diff --git a/gegl/operation/gegl-operation-point-filter.c b/gegl/operation/gegl-operation-point-filter.c
index ba4a126..30562ba 100644
--- a/gegl/operation/gegl-operation-point-filter.c
+++ b/gegl/operation/gegl-operation-point-filter.c
@@ -86,7 +86,7 @@ gegl_operation_point_filter_process (GeglOperation       *operation,
 
       {
         GeglBufferIterator *i = gegl_buffer_iterator_new (output, result, out_format, GEGL_BUFFER_WRITE);
-        gint read  = gegl_buffer_iterator_add (i, input,  result, in_format, GEGL_BUFFER_READ);
+        gint read  = output == input ? 0 : gegl_buffer_iterator_add (i, input,  result, in_format, GEGL_BUFFER_READ);
           while (gegl_buffer_iterator_next (i))
             point_filter_class->process (operation, i->data[read], i->data[0], i->length, &i->roi[0]);
       }



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