[gegl] Fix buffer iterator handling of shifted tiles (bug 725604)
- From: Daniel Sabo <daniels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] Fix buffer iterator handling of shifted tiles (bug 725604)
- Date: Sun, 9 Mar 2014 13:43:28 +0000 (UTC)
commit 421d1e82a181b0b5b17a845944aeff42492d977e
Author: Daniel Sabo <DanielSabo gmail com>
Date: Fri Mar 7 05:08:09 2014 -0800
Fix buffer iterator handling of shifted tiles (bug 725604)
Previous code didn't correctly account for buffer shift when
the iterations had different rects.
gegl/buffer/gegl-buffer-iterator.c | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/gegl/buffer/gegl-buffer-iterator.c b/gegl/buffer/gegl-buffer-iterator.c
index 7bfad17..817e16d 100644
--- a/gegl/buffer/gegl-buffer-iterator.c
+++ b/gegl/buffer/gegl-buffer-iterator.c
@@ -390,6 +390,8 @@ prepare_iteration (GeglBufferIterator *iter)
{
int index;
GeglBufferIteratorPriv *priv = iter->priv;
+ gint origin_offset_x;
+ gint origin_offset_y;
/* Set up the origin tile */
/* FIXME: Pick the most compatable buffer, not just the first */
@@ -400,6 +402,9 @@ prepare_iteration (GeglBufferIterator *iter)
priv->origin_tile.y = buf->shift_y;
priv->origin_tile.width = buf->tile_width;
priv->origin_tile.height = buf->tile_height;
+
+ origin_offset_x = buf->shift_x + priv->sub_iter[0].full_rect.x;
+ origin_offset_y = buf->shift_y + priv->sub_iter[0].full_rect.y;
}
for (index = 0; index < priv->num_buffers; index++)
@@ -407,14 +412,17 @@ prepare_iteration (GeglBufferIterator *iter)
SubIterState *sub = &priv->sub_iter[index];
GeglBuffer *buf = sub->buffer;
+ gint current_offset_x = buf->shift_x + priv->sub_iter[index].full_rect.x;
+ gint current_offset_y = buf->shift_y + priv->sub_iter[index].full_rect.y;
+
/* Format converison needed */
if (gegl_buffer_get_format (sub->buffer) != sub->format)
sub->flags |= GEGL_ITERATOR_INCOMPATIBLE;
/* Incompatable tiles */
- else if ((priv->origin_tile.x != buf->shift_x) ||
- (priv->origin_tile.y != buf->shift_y) ||
- (priv->origin_tile.width != buf->tile_width) ||
- (priv->origin_tile.height != buf->tile_height))
+ else if ((priv->origin_tile.width != buf->tile_width) ||
+ (priv->origin_tile.height != buf->tile_height) ||
+ (abs(origin_offset_x - current_offset_x) % priv->origin_tile.width != 0) ||
+ (abs(origin_offset_y - current_offset_y) % priv->origin_tile.height != 0))
{
/* Check if the buffer is a linear buffer */
if ((buf->extent.x == -buf->shift_x) &&
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]