[gimp/gimp-2-10] app: in gimp_gegl_apply_cached_operation(), don't dup src buffer for point ops



commit 83552620eb40b7bb6cfc801cd74388152a0490a7
Author: Ell <ell_se yahoo com>
Date:   Fri Feb 15 12:28:30 2019 -0500

    app: in gimp_gegl_apply_cached_operation(), don't dup src buffer for point ops
    
    In gimp_gegl_apply_cached_operation(), when the source and
    destination buffers are the same, avoid duplicating the source
    buffer when the applied operation is a point operation, since
    applying it in chunks from/to the same buffer is not a problem in
    this case.
    
    (cherry picked from commit 0d21f2469b412b660073b9ed1eff37b5f7320a60)

 app/gegl/gimp-gegl-apply-operation.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/app/gegl/gimp-gegl-apply-operation.c b/app/gegl/gimp-gegl-apply-operation.c
index 652405195e..46345e1491 100644
--- a/app/gegl/gimp-gegl-apply-operation.c
+++ b/app/gegl/gimp-gegl-apply-operation.c
@@ -120,12 +120,18 @@ gimp_gegl_apply_cached_operation (GeglBuffer          *src_buffer,
       GeglNode *src_node;
 
       /* dup() because reading and writing the same buffer doesn't
-       * work with area ops when working in chunks. See bug #701875.
+       * generally work with non-point ops when working in chunks.
+       * See bug #701875.
        */
-      if (src_buffer == dest_buffer)
-        src_buffer = gegl_buffer_dup (src_buffer);
+      if (src_buffer == dest_buffer &&
+          ! gimp_gegl_node_is_point_operation (operation))
+        {
+          src_buffer = gegl_buffer_dup (src_buffer);
+        }
       else
-        g_object_ref (src_buffer);
+        {
+          g_object_ref (src_buffer);
+        }
 
       src_node = gegl_node_new_child (gegl,
                                       "operation", "gegl:buffer-source",


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