[gimp] app: fix SRC_ATOP and DST_ATOP too



commit b3dea58cfde0829ba8bbbc2a36fd55f3da304259
Author: Ell <ell_se yahoo com>
Date:   Sun Feb 5 22:32:08 2017 -0500

    app: fix SRC_ATOP and DST_ATOP too
    
    They can be affected by the same problem described in
    commit 4c3a772cd80d70a171b15141ece2a055e5e61131, although in the
    case of SRC_ATOP, the affected pixels are always fully transparent.

 .../layer-modes/gimpoperationlayermode.c           |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/app/operations/layer-modes/gimpoperationlayermode.c 
b/app/operations/layer-modes/gimpoperationlayermode.c
index 39a56f9..0f33540 100644
--- a/app/operations/layer-modes/gimpoperationlayermode.c
+++ b/app/operations/layer-modes/gimpoperationlayermode.c
@@ -509,7 +509,7 @@ compfun_src_atop (gfloat *in,
       if (mask)
         layer_alpha *= *mask;
 
-      if (layer_alpha == 0.0f)
+      if (in[ALPHA] == 0.0f || layer_alpha == 0.0f)
         {
           out[RED]   = in[RED];
           out[GREEN] = in[GREEN];
@@ -610,6 +610,12 @@ compfun_dst_atop (gfloat *in,
           out[GREEN] = in[GREEN];
           out[BLUE]  = in[BLUE];
         }
+      else if (in[ALPHA] == 0.0f)
+        {
+          out[RED]   = layer[RED];
+          out[GREEN] = layer[GREEN];
+          out[BLUE]  = layer[BLUE];
+        }
       else
         {
           gint b;
@@ -713,7 +719,7 @@ compfun_src_atop_sse2 (gfloat *in,
             alpha = alpha * _mm_set1_ps (*mask++);
           }
 
-        if (_mm_ucomigt_ss (alpha, _mm_setzero_ps ()))
+        if (rgba_in[ALPHA] != 0.0f && _mm_ucomineq_ss (alpha, _mm_setzero_ps ()))
           {
             __v4sf out_pixel, out_pixel_rbaa, out_alpha;
 


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