[gegl] gegl-buffer-access.c: cosmetic



commit d17dec6524be4cd449c35c43e991e188558f5762
Author: Nicolas Robidoux <nicolas robidoux gmail com>
Date:   Tue Jun 28 15:18:01 2011 -0400

    gegl-buffer-access.c: cosmetic

 gegl/buffer/gegl-buffer-access.c |   79 +++++++++++++++++---------------------
 1 files changed, 35 insertions(+), 44 deletions(-)
---
diff --git a/gegl/buffer/gegl-buffer-access.c b/gegl/buffer/gegl-buffer-access.c
index 347b49f..50b301e 100644
--- a/gegl/buffer/gegl-buffer-access.c
+++ b/gegl/buffer/gegl-buffer-access.c
@@ -49,7 +49,7 @@ gegl_buffer_pixel_set (GeglBuffer *buffer,
                        guchar     *buf)
 {
   gint  tile_width  = buffer->tile_storage->tile_width;
-  gint  tile_height  = buffer->tile_storage->tile_width;
+  gint  tile_height = buffer->tile_storage->tile_width;
   gint  px_size     = gegl_buffer_px_size (buffer);
   gint  bpx_size    = babl_format_get_bytes_per_pixel (format);
   Babl *fish        = NULL;
@@ -66,43 +66,41 @@ gegl_buffer_pixel_set (GeglBuffer *buffer,
       fish = babl_fish (buffer->format, format);
     }
 
-  {
-    if (!(buffer_y + y >= buffer_abyss_y &&
-          buffer_y + y < abyss_y_total &&
-          buffer_x + x >= buffer_abyss_x &&
-          buffer_x + x < abyss_x_total))
-      { /* in abyss */
-        return;
-      }
-    else
-      {
-        gint      tiledy = buffer_y + buffer->shift_y + y;
-        gint      tiledx = buffer_x + buffer->shift_x + x;
-
-        GeglTile *tile = gegl_tile_source_get_tile ((GeglTileSource *) (buffer),
-                                                gegl_tile_indice (tiledx, tile_width),
-                                                gegl_tile_indice (tiledy, tile_height),
-                                                0);
+  if (!(buffer_y + y >= buffer_abyss_y &&
+        buffer_y + y < abyss_y_total &&
+        buffer_x + x >= buffer_abyss_x &&
+        buffer_x + x < abyss_x_total))
+    { /* in abyss */
+      return;
+    }
+  else
+    {
+      gint      tiledy = buffer_y + buffer->shift_y + y;
+      gint      tiledx = buffer_x + buffer->shift_x + x;
 
-        if (tile)
-          {
-            gint    offsetx = gegl_tile_offset (tiledx, tile_width);
-            gint    offsety = gegl_tile_offset (tiledy, tile_height);
-            guchar *tp;
+      GeglTile *tile = gegl_tile_source_get_tile ((GeglTileSource *) (buffer),
+                                                  gegl_tile_indice (tiledx, tile_width),
+                                                  gegl_tile_indice (tiledy, tile_height),
+                                                  0);
 
-            gegl_tile_lock (tile);
-            tp = gegl_tile_get_data (tile) +
-                 (offsety * tile_width + offsetx) * px_size;
-            if (fish)
-              babl_process (fish, buf, tp, 1);
-            else
-              memcpy (tp, buf, bpx_size);
+      if (tile)
+        {
+          gint    offsetx = gegl_tile_offset (tiledx, tile_width);
+          gint    offsety = gegl_tile_offset (tiledy, tile_height);
+          guchar *tp;
+
+          gegl_tile_lock (tile);
+          tp = gegl_tile_get_data (tile) +
+            (offsety * tile_width + offsetx) * px_size;
+          if (fish)
+            babl_process (fish, buf, tp, 1);
+          else
+            memcpy (tp, buf, bpx_size);
 
-            gegl_tile_unlock (tile);
-            gegl_tile_unref (tile);
-          }
-      }
-  }
+          gegl_tile_unlock (tile);
+          gegl_tile_unref (tile);
+        }
+    }
   return;
 }
 #endif
@@ -119,7 +117,6 @@ gegl_buffer_in_abyss( GeglBuffer *buffer,
   gint  abyss_x_total  = buffer_abyss_x + buffer->abyss.width;
   gint  abyss_y_total  = buffer_abyss_y + buffer->abyss.height;
 
-
   gint tiledy = y + buffer_shift_y;
   gint tiledx = x + buffer_shift_x;
 
@@ -390,8 +387,6 @@ gegl_buffer_iterate (GeglBuffer          *buffer,
       gint tiledy  = buffer_y + bufy;
       gint offsety = gegl_tile_offset (tiledy, tile_height);
 
-
-
       gint bufx    = 0;
 
       if (!(buffer_y + bufy + (tile_height) >= buffer_abyss_y &&
@@ -592,9 +587,7 @@ gegl_buffer_set_unlocked (GeglBuffer          *buffer,
     }
   else
 #endif
-    {
-      gegl_buffer_iterate (buffer, rect, src, rowstride, TRUE, format, 0);
-    }
+  gegl_buffer_iterate (buffer, rect, src, rowstride, TRUE, format, 0);
 
   if (gegl_buffer_is_shared(buffer))
     {
@@ -617,8 +610,6 @@ gegl_buffer_set (GeglBuffer          *buffer,
 }
 
 
-
-
 #if 0
 
 /*
@@ -1012,7 +1003,7 @@ gegl_buffer_get_unlocked (GeglBuffer          *buffer,
       sample_buf = g_malloc (buf_width * buf_height * bpp);
       gegl_buffer_iterate (buffer, &sample_rect, sample_buf, GEGL_AUTO_ROWSTRIDE, FALSE, format, level);
 #if 1
-  /* slows testing of rendering code speed to much for now and
+  /* slows testing of rendering code speed too much for now and
    * no time to make a fast implementation
    */
 



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