app: use underlying operation in gimp_gegl_apply_cached_operation()

In gimp_gegl_apply_cached_operation(), use the underlying
operation, as returned from
gimp_gegl_node_get_underlying_operation(), for testing whether the
operation is a point operation, for the purpose of avoiding
duplicating the input buffer.  Likewise, avoid duplicating the
buffer when the underlying operation is a source operation.
This commit is contained in:
Ell 2019-03-27 15:04:27 -04:00
parent eb5e473665
commit 213b126c6e
1 changed files with 6 additions and 1 deletions

View File

@ -118,13 +118,18 @@ gimp_gegl_apply_cached_operation (GeglBuffer *src_buffer,
if (src_buffer)
{
GeglNode *src_node;
GeglNode *underlying_operation;
underlying_operation =
gimp_gegl_node_get_underlying_operation (operation);
/* dup() because reading and writing the same buffer doesn't
* generally work with non-point ops when working in chunks.
* See bug #701875.
*/
if (src_buffer == dest_buffer &&
! gimp_gegl_node_is_point_operation (operation))
! (gimp_gegl_node_is_point_operation (underlying_operation) ||
gimp_gegl_node_is_source_operation (underlying_operation)))
{
src_buffer = gegl_buffer_dup (src_buffer);
}