[gimp/gimp-2-10] app: in gimp_paint_core_paste(), don't copy paint mask when combining to canvas buffer



commit 940197e2d7ba3caf0c641baeba54149e08840dee
Author: Ell <ell_se yahoo com>
Date:   Tue Feb 12 06:43:01 2019 -0500

    app: in gimp_paint_core_paste(), don't copy paint mask when combining to canvas buffer
    
    In the applicator path of gimp_paint_core_paste(), use the paint
    mask directly when combining it to the canvas buffer, rather than
    using a copy of it, since it's not being modified.
    
    Fix some comments.
    
    (cherry picked from commit ba6713bbe1cffc1a68fe9e3ee2b3da51e1d30e50)

 app/paint/gimppaintcore.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/app/paint/gimppaintcore.c b/app/paint/gimppaintcore.c
index 9905a2ea7c..e9f9728316 100644
--- a/app/paint/gimppaintcore.c
+++ b/app/paint/gimppaintcore.c
@@ -792,7 +792,7 @@ gimp_paint_core_paste (GimpPaintCore            *core,
   if (core->applicator)
     {
       /*  If the mode is CONSTANT:
-       *   combine the canvas buf, the paint mask to the canvas buffer
+       *   combine the canvas buffer and the paint mask to the paint buffer
        */
       if (mode == GIMP_PAINT_CONSTANT)
         {
@@ -801,9 +801,8 @@ gimp_paint_core_paste (GimpPaintCore            *core,
            */
           if (paint_mask != NULL)
             {
-              GimpTempBuf *modified_mask     = gimp_temp_buf_copy (paint_mask);
-              GeglBuffer  *paint_mask_buffer =
-                gimp_temp_buf_create_buffer ((GimpTempBuf *) modified_mask);
+              GeglBuffer *paint_mask_buffer =
+                gimp_temp_buf_create_buffer ((GimpTempBuf *) paint_mask);
 
               gimp_gegl_combine_mask_weird (paint_mask_buffer,
                                             GEGL_RECTANGLE (paint_mask_offset_x,
@@ -817,7 +816,6 @@ gimp_paint_core_paste (GimpPaintCore            *core,
                                             GIMP_IS_AIRBRUSH (core));
 
               g_object_unref (paint_mask_buffer);
-              gimp_temp_buf_unref (modified_mask);
             }
 
           gimp_gegl_apply_mask (core->canvas_buffer,
@@ -832,7 +830,7 @@ gimp_paint_core_paste (GimpPaintCore            *core,
                                           core->undo_buffer);
         }
       /*  Otherwise:
-       *   combine the canvas buf and the paint mask to the canvas buf
+       *   combine the paint mask to the paint buffer directly
        */
       else
         {


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