[gimp] app: in gimp_composite_blend(), avoid another alloca when doing in-place output



commit fb3b99553c33923136cf48112765b8a0f59bc482
Author: Ell <ell_se yahoo com>
Date:   Sat Jan 21 06:52:12 2017 -0500

    app: in gimp_composite_blend(), avoid another alloca when doing in-place output

 app/operations/layer-modes/gimpblendcomposite.h |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/app/operations/layer-modes/gimpblendcomposite.h b/app/operations/layer-modes/gimpblendcomposite.h
index 0feb5dc..7a5eed1 100644
--- a/app/operations/layer-modes/gimpblendcomposite.h
+++ b/app/operations/layer-modes/gimpblendcomposite.h
@@ -295,10 +295,15 @@ gimp_composite_blend (gfloat                 *in,
 
   if (fish_to_blend)
     {
-      blend_in    = g_alloca (sizeof (gfloat) * 4 * samples);
-      blend_layer = g_alloca (sizeof (gfloat) * 4 * samples);
-      babl_process (fish_to_blend, in,    blend_in,  samples);
-      babl_process (fish_to_blend, layer, blend_layer,  samples);
+      if (! (blend_in == out &&
+             composite_trc != GIMP_LAYER_COLOR_SPACE_RGB_LINEAR))
+        {
+          blend_in = g_alloca (sizeof (gfloat) * 4 * samples);
+        }
+      blend_layer  = g_alloca (sizeof (gfloat) * 4 * samples);
+
+      babl_process (fish_to_blend, in,    blend_in,    samples);
+      babl_process (fish_to_blend, layer, blend_layer, samples);
     }
 
   blend_func (blend_in, blend_layer, blend_out, samples);


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