[gimp/gimp-2-10] app: use underlying operation in gimp_gegl_apply_cached_operation()



commit b5b5d717086ec1e68d0230380ec1c09c926804fe
Author: Ell <ell_se yahoo com>
Date:   Wed Mar 27 15:04:27 2019 -0400

    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.
    
    (cherry picked from commit 213b126c6e515361c90d5ce8e85d2f1ed323c74e)

 app/gegl/gimp-gegl-apply-operation.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/app/gegl/gimp-gegl-apply-operation.c b/app/gegl/gimp-gegl-apply-operation.c
index 46345e1491..2c8d35521f 100644
--- a/app/gegl/gimp-gegl-apply-operation.c
+++ b/app/gegl/gimp-gegl-apply-operation.c
@@ -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);
         }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]