app: fix SRC_ATOP and DST_ATOP too

They can be affected by the same problem described in
commit 4c3a772cd8, although in the
case of SRC_ATOP, the affected pixels are always fully transparent.
This commit is contained in:
Ell
2017-02-05 22:32:08 -05:00
parent 6853c91264
commit b3dea58cfd

View File

@ -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;