app: crop input to output rect in channel ops

In gimp_gegl_apply_{border,grow,shrink,flood}(), which are used
by the corresponding channel functions, pass crop_input = TRUE to
gimp_gegl_apply_operation(), to clip the input to the output rect.

These operations process the entire input in one go, regardless of
the requested output region; however, the channel functions
calculate the output region according to the known channel bounds,
hence clipping the input to these bounds doesn't affect discard any
information, while avoiding unnecessary work.  In particular, this
makes the corresponding operations on small selections in big images
much faster.
This commit is contained in:
Ell
2018-03-22 13:38:11 -04:00
parent e1b1611ec4
commit ab4b7ab33a

View File

@ -463,7 +463,7 @@ gimp_gegl_apply_border (GeglBuffer *src_buffer,
}
gimp_gegl_apply_operation (src_buffer, progress, undo_desc,
node, dest_buffer, dest_rect, FALSE);
node, dest_buffer, dest_rect, TRUE);
g_object_unref (node);
}
@ -489,7 +489,7 @@ gimp_gegl_apply_grow (GeglBuffer *src_buffer,
NULL);
gimp_gegl_apply_operation (src_buffer, progress, undo_desc,
node, dest_buffer, dest_rect, FALSE);
node, dest_buffer, dest_rect, TRUE);
g_object_unref (node);
}
@ -517,7 +517,7 @@ gimp_gegl_apply_shrink (GeglBuffer *src_buffer,
NULL);
gimp_gegl_apply_operation (src_buffer, progress, undo_desc,
node, dest_buffer, dest_rect, FALSE);
node, dest_buffer, dest_rect, TRUE);
g_object_unref (node);
}
@ -539,7 +539,7 @@ gimp_gegl_apply_flood (GeglBuffer *src_buffer,
NULL);
gimp_gegl_apply_operation (src_buffer, progress, undo_desc,
node, dest_buffer, dest_rect, FALSE);
node, dest_buffer, dest_rect, TRUE);
g_object_unref (node);
}