gegl r2747 - in trunk: . gegl/buffer
- From: ok svn gnome org
- To: svn-commits-list gnome org
- Subject: gegl r2747 - in trunk: . gegl/buffer
- Date: Fri, 14 Nov 2008 16:15:23 +0000 (UTC)
Author: ok
Date: Fri Nov 14 16:15:23 2008
New Revision: 2747
URL: http://svn.gnome.org/viewvc/gegl?rev=2747&view=rev
Log:
* gegl/buffer/gegl-buffer-iterator.c: (gegl_buffer_iterator_add),
(gegl_buffer_iterator_next): avoid gegl_buffer_get for the non-direct case when reading has not been requested. (missed this file and only commited the message about the change as part of the changes of another file.)
Modified:
trunk/ChangeLog
trunk/gegl/buffer/gegl-buffer-iterator.c
Modified: trunk/gegl/buffer/gegl-buffer-iterator.c
==============================================================================
--- trunk/gegl/buffer/gegl-buffer-iterator.c (original)
+++ trunk/gegl/buffer/gegl-buffer-iterator.c Fri Nov 14 16:15:23 2008
@@ -289,7 +289,9 @@
}
}
- /* always allocating */
+ /* maybe keeping a pool of such buffers around would be good, to avoid
+ * memory fragmentation
+ */
i->buf[self] = gegl_malloc (i->format[self]->format.bytes_per_pixel *
i->i[0].max_size);
if (i->format[self] == i->buffer[self]->format)
@@ -369,7 +371,10 @@
}
else
{
- gegl_buffer_get (i->buffer[no], 1.0, &(i->roi[no]), i->format[no], i->buf[no], GEGL_AUTO_ROWSTRIDE);
+ if (i->flags[no] & GEGL_BUFFER_READ)
+ {
+ gegl_buffer_get (i->buffer[no], 1.0, &(i->roi[no]), i->format[no], i->buf[no], GEGL_AUTO_ROWSTRIDE);
+ }
i->data[no]=i->buf[no];
#if DEBUG_DIRECT
in_direct_read += i->roi[no].width * i->roi[no].height;
@@ -385,7 +390,10 @@
g_assert (i->buf[no]);
- gegl_buffer_get (i->buffer[no], 1.0, &(i->roi[no]), i->format[no], i->buf[no], GEGL_AUTO_ROWSTRIDE);
+ if (i->flags[no] & GEGL_BUFFER_READ)
+ {
+ gegl_buffer_get (i->buffer[no], 1.0, &(i->roi[no]), i->format[no], i->buf[no], GEGL_AUTO_ROWSTRIDE);
+ }
i->data[no]=i->buf[no];
#if DEBUG_DIRECT
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]