[gegl/samplers] gegl-buffer-access.c: cosmetic
- From: Nicolas Robidoux <nrobidoux src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl/samplers] gegl-buffer-access.c: cosmetic
- Date: Tue, 28 Jun 2011 19:18:06 +0000 (UTC)
commit 74214de93bd405a8835a09ecfd690dabe6d8d0db
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 81c9483..fcdf746 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;
@@ -395,8 +392,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 &&
@@ -597,9 +592,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))
{
@@ -622,8 +615,6 @@ gegl_buffer_set (GeglBuffer *buffer,
}
-
-
#if 0
/*
@@ -1017,7 +1008,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]