[gegl] gegl/buffer: factor out fish vs memcpy conditional for col fetching



commit d9f994c9c62135933bda85931c47135633b53826
Author: Øyvind Kolås <pippin gimp org>
Date:   Wed Dec 27 11:41:08 2017 +0100

    gegl/buffer: factor out fish vs memcpy conditional for col fetching

 gegl/buffer/gegl-buffer-access.c |   31 ++++++++++++++++++++++---------
 1 files changed, 22 insertions(+), 9 deletions(-)
---
diff --git a/gegl/buffer/gegl-buffer-access.c b/gegl/buffer/gegl-buffer-access.c
index 5475a9f..8748f79 100644
--- a/gegl/buffer/gegl-buffer-access.c
+++ b/gegl/buffer/gegl-buffer-access.c
@@ -639,17 +639,30 @@ gegl_buffer_iterate_read_simple (GeglBuffer          *buffer,
           tp        = ((guchar *) tile_base) + (offsety * tile_width + offsetx) * px_size;
 
           y = bufy;
-          for (row = offsety;
-               row < tile_height && y < height;
-               row++, y++)
+
+          if (fish)
+            {
+              for (row = offsety;
+                   row < tile_height && y < height;
+                   row++, y++)
+                {
+                  babl_process (fish, tp, bp, pixels);
+
+                  tp += tile_stride;
+                  bp += buf_stride;
+                }
+            }
+          else
             {
-              if (fish)
-                babl_process (fish, tp, bp, pixels);
-              else
-                memcpy (bp, tp, pixels * px_size);
+              for (row = offsety;
+                   row < tile_height && y < height;
+                   row++, y++)
+                {
+                  memcpy (bp, tp, pixels * px_size);
 
-              tp += tile_stride;
-              bp += buf_stride;
+                  tp += tile_stride;
+                  bp += buf_stride;
+                }
             }
 
           gegl_tile_unref (tile);


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