[gegl] When doing in-place processing use it only once in the iterator
- From: Øyvind Kolås <ok src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gegl] When doing in-place processing use it only once in the iterator
- Date: Fri, 20 Nov 2009 01:42:56 +0000 (UTC)
commit 7a7eaad2356a9bc23ec0e03f91a74129f9b477e5
Author: �yvind Kolås <pippin gimp org>
Date: Thu Nov 19 17:26:16 2009 +0000
When doing in-place processing use it only once in the iterator
gegl/operation/gegl-operation-filter.c | 1 +
gegl/operation/gegl-operation-point-composer.c | 6 +++++-
gegl/operation/gegl-operation-point-filter.c | 6 +++++-
3 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/gegl/operation/gegl-operation-filter.c b/gegl/operation/gegl-operation-filter.c
index 8c85024..cf24d50 100644
--- a/gegl/operation/gegl-operation-filter.c
+++ b/gegl/operation/gegl-operation-filter.c
@@ -187,6 +187,7 @@ gboolean gegl_can_passthrough (GeglOperation *operation,
GeglBuffer *input,
const GeglRectangle *result)
{
+ return FALSE;
if (!input ||
GEGL_IS_CACHE (input))
return FALSE;
diff --git a/gegl/operation/gegl-operation-point-composer.c b/gegl/operation/gegl-operation-point-composer.c
index 0590cd3..3a973c9 100644
--- a/gegl/operation/gegl-operation-point-composer.c
+++ b/gegl/operation/gegl-operation-point-composer.c
@@ -146,7 +146,11 @@ gegl_operation_point_composer_process (GeglOperation *operation,
if ((result->width > 0) && (result->height > 0))
{
GeglBufferIterator *i = gegl_buffer_iterator_new (output, result, out_format, GEGL_BUFFER_WRITE);
- gint read = gegl_buffer_iterator_add (i, input, result, in_format, GEGL_BUFFER_READ);
+ gint read;
+ if (input != output)
+ read = gegl_buffer_iterator_add (i, input, result, in_format, GEGL_BUFFER_READ);
+ else
+ read = 0;
if (aux)
{
diff --git a/gegl/operation/gegl-operation-point-filter.c b/gegl/operation/gegl-operation-point-filter.c
index 7d8c336..ba2b760 100644
--- a/gegl/operation/gegl-operation-point-filter.c
+++ b/gegl/operation/gegl-operation-point-filter.c
@@ -78,7 +78,11 @@ gegl_operation_point_filter_process (GeglOperation *operation,
if ((result->width > 0) && (result->height > 0))
{
GeglBufferIterator *i = gegl_buffer_iterator_new (output, result, out_format, GEGL_BUFFER_WRITE);
- gint read = gegl_buffer_iterator_add (i, input, result, in_format, GEGL_BUFFER_READ);
+ gint read;
+ if (input != output)
+ read = gegl_buffer_iterator_add (i, input, result, in_format, GEGL_BUFFER_READ);
+ else
+ read = 0;
while (gegl_buffer_iterator_next (i))
point_filter_class->process (operation, i->data[read], i->data[0], i->length, &i->roi[0]);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]