[gegl/gsoc2009-gpu] GeglBufferIterator: Bring back subrect.width condition for direct tile access
- From: Jerson Michael Perpetua <jperpetua src gnome org>
- To: svn-commits-list gnome org
- Subject: [gegl/gsoc2009-gpu] GeglBufferIterator: Bring back subrect.width condition for direct tile access
- Date: Tue, 7 Jul 2009 17:46:43 +0000 (UTC)
commit fcbf9946792af1ce2cc9ec5821b209ceb52a6d44
Author: Jerson Michael Perpetua <jersonperpetua gmail com>
Date: Sun Jul 5 04:14:05 2009 +0800
GeglBufferIterator: Bring back subrect.width condition for direct tile access
Lock, access and unlock tiles only when the sub-rectangle width is
equal to the tile's width.
gegl/buffer/gegl-buffer-iterator.c | 38 ++++++++++++++---------------------
1 files changed, 15 insertions(+), 23 deletions(-)
---
diff --git a/gegl/buffer/gegl-buffer-iterator.c b/gegl/buffer/gegl-buffer-iterator.c
index f221595..77134ba 100644
--- a/gegl/buffer/gegl-buffer-iterator.c
+++ b/gegl/buffer/gegl-buffer-iterator.c
@@ -151,14 +151,9 @@ gulp:
/* unref previously held tile */
if (i->tile)
{
- /* XXX: do we still need to handle the first condition below?
- *
- * if (i->subrect.width == tile_width && i->write)
- * {
- * gegl_tile_unlock (i->tile);
- * }
- */
- gegl_tile_unlock (i->tile);
+ if (tile_width == i->subrect.width)
+ gegl_tile_unlock (i->tile);
+
g_object_unref (i->tile);
i->tile = NULL;
}
@@ -188,27 +183,24 @@ gulp:
gegl_tile_index (tiledy, tile_height),
0);
- /* XXX: do we still need to handle the second condition below?
- *
- * if (i->write && tile_width==i->subrect.width)
- */
- if (i->write)
- gegl_tile_lock (i->tile, GEGL_TILE_LOCK_WRITE);
- else
- gegl_tile_lock (i->tile, GEGL_TILE_LOCK_READ);
-
- i->data = gegl_tile_get_data (i->tile);
+ if (tile_width == i->subrect.width)
+ {
+ if (i->write)
+ gegl_tile_lock (i->tile, GEGL_TILE_LOCK_WRITE);
+ else
+ gegl_tile_lock (i->tile, GEGL_TILE_LOCK_READ);
- {
- gint bpp = babl_format_get_bytes_per_pixel (i->buffer->format);
- i->sub_data = (guchar*)(i->data) + bpp * (i->subrect.y * tile_width + i->subrect.x);
- }
+ i->data = gegl_tile_get_data (i->tile);
+ {
+ gint bpp = babl_format_get_bytes_per_pixel (i->buffer->format);
+ i->sub_data = (guchar*)(i->data) + bpp * (i->subrect.y * tile_width + i->subrect.x);
+ }
+ }
i->col = i->next_col;
i->row = i->next_row;
i->next_col += tile_width - offsetx;
-
i->roi2.x = i->roi.x + i->col;
i->roi2.y = i->roi.y + i->row;
i->roi2.width = i->subrect.width;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]