forked from enlightenment/efl
Evas masking: Fix mask blend functions (SW engine)
The selected op func was not performing the correct operation, thus producing rendering artifacts. These functions should not be used anywhere except in case of masking... which was not an available option earlier. It was doing (wrong): dst = interp(mask, src, dst) Instead of (correct): dst = dst + (1 - mask) * src NOTE: This commit also disables MMX, SSE3 & NEON implementations of pixel_mask blend operations, since they are also broken.
This commit is contained in:
parent
44387b60a3
commit
4bff14676e
|
@ -31,7 +31,7 @@ evas_common_op_blend_init_sse3(void)
|
|||
|
||||
init_blend_pixel_span_funcs_sse3();
|
||||
init_blend_pixel_color_span_funcs_sse3();
|
||||
init_blend_pixel_mask_span_funcs_sse3();
|
||||
init_blend_pixel_mask_span_funcs_sse3(); // FIXME
|
||||
init_blend_color_span_funcs_sse3();
|
||||
init_blend_mask_color_span_funcs_sse3();
|
||||
|
||||
|
@ -49,7 +49,7 @@ evas_common_op_blend_rel_init_sse3(void)
|
|||
#ifdef BUILD_SSE3
|
||||
init_blend_rel_pixel_span_funcs_sse3();
|
||||
init_blend_rel_pixel_color_span_funcs_sse3();
|
||||
init_blend_rel_pixel_mask_span_funcs_sse3();
|
||||
init_blend_rel_pixel_mask_span_funcs_sse3(); // FIXME
|
||||
init_blend_rel_color_span_funcs_sse3();
|
||||
init_blend_rel_mask_color_span_funcs_sse3();
|
||||
|
||||
|
|
|
@ -25,29 +25,7 @@ _op_blend_p_mas_dp(DATA32 *s, DATA8 *m, DATA32 c, DATA32 *d, int l) {
|
|||
});
|
||||
}
|
||||
|
||||
static void
|
||||
_op_blend_pas_mas_dp(DATA32 *s, DATA8 *m, DATA32 c EINA_UNUSED, DATA32 *d, int l) {
|
||||
DATA32 *e;
|
||||
int alpha;
|
||||
UNROLL8_PLD_WHILE(d, l, e,
|
||||
{
|
||||
alpha = *m;
|
||||
switch(alpha)
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case 255:
|
||||
*d = *s;
|
||||
break;
|
||||
default:
|
||||
alpha++;
|
||||
*d = INTERP_256(alpha, *s, *d);
|
||||
break;
|
||||
}
|
||||
m++; s++; d++;
|
||||
});
|
||||
}
|
||||
|
||||
#define _op_blend_pas_mas_dp _op_blend_p_mas_dp
|
||||
#define _op_blend_pan_mas_dp _op_blend_pas_mas_dp
|
||||
|
||||
#define _op_blend_p_mas_dpan _op_blend_p_mas_dp
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
/* blend pixel x mask --> dst */
|
||||
|
||||
#ifdef BUILD_MMX
|
||||
|
||||
// FIXME: These functions most likely don't perform the correct operation.
|
||||
// Test them with masks and images.
|
||||
#if 0
|
||||
static void
|
||||
_op_blend_pas_mas_dp_mmx(DATA32 *s, DATA8 *m, DATA32 c EINA_UNUSED, DATA32 *d, int l) {
|
||||
DATA32 *e = d + l;
|
||||
|
@ -62,8 +66,13 @@ _op_blend_pan_mas_dp_mmx(DATA32 *s, DATA8 *m, DATA32 c EINA_UNUSED, DATA32 *d, i
|
|||
m++; s++; d++;
|
||||
}
|
||||
}
|
||||
#else
|
||||
// FIXME
|
||||
#define _op_blend_p_mas_dp_mmx NULL
|
||||
#define _op_blend_pas_mas_dp_mmx _op_blend_p_mas_dp_mmx
|
||||
#endif
|
||||
|
||||
#define _op_blend_p_mas_dp_mmx _op_blend_pas_mas_dp_mmx
|
||||
#define _op_blend_pan_mas_dp_mmx _op_blend_pas_mas_dp_mmx
|
||||
|
||||
#define _op_blend_p_mas_dpan_mmx _op_blend_p_mas_dp_mmx
|
||||
#define _op_blend_pan_mas_dpan_mmx _op_blend_pan_mas_dp_mmx
|
||||
|
@ -128,9 +137,9 @@ init_blend_pixel_mask_pt_funcs_mmx(void)
|
|||
|
||||
#ifdef BUILD_MMX
|
||||
|
||||
#define _op_blend_rel_p_mas_dpan_mmx _op_blend_p_mas_dpan_mmx
|
||||
#define _op_blend_rel_pas_mas_dpan_mmx _op_blend_pas_mas_dpan_mmx
|
||||
#define _op_blend_rel_pan_mas_dpan_mmx _op_blend_pan_mas_dpan_mmx
|
||||
#define _op_blend_rel_p_mas_dpan_mmx NULL
|
||||
#define _op_blend_rel_pas_mas_dpan_mmx _op_blend_rel_p_mas_dpan_mmx
|
||||
#define _op_blend_rel_pan_mas_dpan_mmx _op_blend_rel_pas_mas_dpan_mmx
|
||||
|
||||
static void
|
||||
init_blend_rel_pixel_mask_span_funcs_mmx(void)
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
/* blend pixel x mask --> dst */
|
||||
|
||||
// FIXME: These functions most likely don't perform the correct operation.
|
||||
// Test them with masks and images.
|
||||
|
||||
#ifdef BUILD_NEON
|
||||
#if 0
|
||||
static void
|
||||
_op_blend_pas_mas_dp_neon(DATA32 *s, DATA8 *m, DATA32 c EINA_UNUSED, DATA32 *d, int l) {
|
||||
DATA32 *e;
|
||||
|
@ -46,6 +50,11 @@ _op_blend_pan_mas_dp_neon(DATA32 *s, DATA8 *m, DATA32 c EINA_UNUSED, DATA32 *d,
|
|||
m++; s++; d++;
|
||||
});
|
||||
}
|
||||
#else
|
||||
// FIXME
|
||||
#define _op_blend_pas_mas_dp_neon NULL
|
||||
#define _op_blend_pan_mas_dp_neon NULL
|
||||
#endif
|
||||
|
||||
#define _op_blend_p_mas_dp_neon _op_blend_pas_mas_dp_neon
|
||||
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
|
||||
#ifdef BUILD_SSE3
|
||||
|
||||
// FIXME: These functions most likely don't perform the correct operation.
|
||||
// Test them with masks and images.
|
||||
#if 0
|
||||
static void
|
||||
_op_blend_p_mas_dp_sse3(DATA32 *s, DATA8 *m, DATA32 c, DATA32 *d, int l) {
|
||||
|
||||
|
@ -150,6 +153,12 @@ _op_blend_pas_mas_dp_sse3(DATA32 *s, DATA8 *m, DATA32 c EINA_UNUSED, DATA32 *d,
|
|||
m += 8; s += 8; d += 8; l -= 8;
|
||||
})
|
||||
}
|
||||
#endif
|
||||
|
||||
// FIXME
|
||||
#define _op_blend_p_mas_dp_sse3 NULL
|
||||
#define _op_blend_pas_mas_dp_sse3 _op_blend_p_mas_dp_sse3
|
||||
// -----
|
||||
|
||||
#define _op_blend_pan_mas_dp_sse3 _op_blend_pas_mas_dp_sse3
|
||||
|
||||
|
@ -169,8 +178,10 @@ init_blend_pixel_mask_span_funcs_sse3(void)
|
|||
op_blend_span_funcs[SP_AN][SM_AS][SC_N][DP_AN][CPU_SSE3] = _op_blend_pan_mas_dpan_sse3;
|
||||
}
|
||||
|
||||
// FIXME
|
||||
#define _op_blend_pt_p_mas_dp_sse3 NULL
|
||||
#define _op_blend_pt_pan_mas_dp_sse3 NULL
|
||||
// -----
|
||||
|
||||
#define _op_blend_pt_pas_mas_dp_sse3 _op_blend_pt_p_mas_dp_sse3
|
||||
|
||||
|
@ -194,6 +205,7 @@ init_blend_pixel_mask_pt_funcs_sse3(void)
|
|||
|
||||
/* blend_rel pixel x mask -> dst */
|
||||
|
||||
#if 0
|
||||
static void
|
||||
_op_blend_rel_p_mas_dp_sse3(DATA32 *s, DATA8 *m, DATA32 c, DATA32 *d, int l) {
|
||||
|
||||
|
@ -256,6 +268,10 @@ _op_blend_rel_p_mas_dp_sse3(DATA32 *s, DATA8 *m, DATA32 c, DATA32 *d, int l) {
|
|||
d += 8; m += 8; s += 8; l -= 8;
|
||||
})
|
||||
}
|
||||
#else
|
||||
// FIXME
|
||||
#define _op_blend_rel_p_mas_dp_sse3 NULL
|
||||
#endif
|
||||
|
||||
#define _op_blend_rel_pas_mas_dp_sse3 _op_blend_rel_p_mas_dp_sse3
|
||||
#define _op_blend_rel_pan_mas_dp_sse3 _op_blend_rel_p_mas_dp_sse3
|
||||
|
|
|
@ -109,7 +109,7 @@ op_blend_init(void)
|
|||
{
|
||||
init_blend_pixel_span_funcs_mmx();
|
||||
init_blend_pixel_color_span_funcs_mmx();
|
||||
init_blend_pixel_mask_span_funcs_mmx();
|
||||
init_blend_pixel_mask_span_funcs_mmx(); // FIXME
|
||||
init_blend_color_span_funcs_mmx();
|
||||
init_blend_mask_color_span_funcs_mmx();
|
||||
|
||||
|
@ -125,7 +125,7 @@ op_blend_init(void)
|
|||
{
|
||||
init_blend_pixel_span_funcs_neon();
|
||||
init_blend_pixel_color_span_funcs_neon();
|
||||
init_blend_pixel_mask_span_funcs_neon();
|
||||
init_blend_pixel_mask_span_funcs_neon(); // FIXME
|
||||
init_blend_color_span_funcs_neon();
|
||||
init_blend_mask_color_span_funcs_neon();
|
||||
|
||||
|
|
Loading…
Reference in New Issue