[gimp] libgimpcolor: small optimization in gimp_color_transform_process_pixels()



commit 984e3d8f5a4e6d02e57fae9294c13991b3feca3f
Author: Michael Natterer <mitch gimp org>
Date:   Fri May 27 21:53:54 2016 +0200

    libgimpcolor: small optimization in gimp_color_transform_process_pixels()
    
    no need to copy the alpha channel separately if src and dest are the
    same.

 libgimpcolor/gimpcolortransform.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/libgimpcolor/gimpcolortransform.c b/libgimpcolor/gimpcolortransform.c
index 6d81075..5407dca 100644
--- a/libgimpcolor/gimpcolortransform.c
+++ b/libgimpcolor/gimpcolortransform.c
@@ -323,7 +323,7 @@ gimp_color_transform_process_pixels (GimpColorTransform *transform,
     }
 
   /* copy the alpha channel */
-  if (babl_format_has_alpha (dest_format))
+  if (src != dest && babl_format_has_alpha (dest_format))
     babl_process (babl_fish (src_format,
                              priv->dest_format),
                   src, dest, length);


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