[gegl] gegl/buffer: factor out constant computation from innterloop when setting columns



commit 438f55111b1b21b9d607d6f0790999e4312a2229
Author: Øyvind Kolås <pippin gimp org>
Date:   Wed Dec 27 12:03:28 2017 +0100

    gegl/buffer: factor out constant computation from innterloop when setting columns

 gegl/buffer/gegl-buffer-access.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/gegl/buffer/gegl-buffer-access.c b/gegl/buffer/gegl-buffer-access.c
index 19bb10e..2a49027 100644
--- a/gegl/buffer/gegl-buffer-access.c
+++ b/gegl/buffer/gegl-buffer-access.c
@@ -453,6 +453,9 @@ gegl_buffer_iterate_write (GeglBuffer          *buffer,
           tile_base = gegl_tile_get_data (tile);
           tp        = ((guchar *) tile_base) + (offsety * tile_width + offsetx) * px_size;
 
+          pixels -= lskip;
+          pixels -= rskip;
+
           if (fish)
             {
               for (row = offsety;
@@ -466,7 +469,7 @@ gegl_buffer_iterate_write (GeglBuffer          *buffer,
                       buffer_y + y < abyss_y_total)
                     {
                       babl_process (fish, bp + lskip * bpx_size, tp + lskip * px_size,
-                                    pixels - lskip - rskip);
+                                    pixels);
                     }
 
                   tp += tile_stride;
@@ -479,15 +482,12 @@ gegl_buffer_iterate_write (GeglBuffer          *buffer,
                    row < tile_height && y < height;
                    row++, y++)
                 {
-
                   if (buffer_y + y >= buffer_abyss_y &&
                       buffer_y + y < abyss_y_total)
                     {
-
                       memcpy (tp + lskip * px_size, bp + lskip * px_size,
-                              (pixels - lskip - rskip) * px_size);
+                              pixels * px_size);
                     }
-
                   tp += tile_stride;
                   bp += buf_stride;
                 }


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