summaryrefslogtreecommitdiff
path: root/src/lib/evas
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2014-12-22 20:29:27 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-01-07 15:06:03 +0900
commit4bff14676ebe2ab981e9c10c2d6746cb3ec2737c (patch)
tree399ebb5c83328dfdc4563992373d153fc5a4baf0 /src/lib/evas
parent44387b60a35836cf21e8d215be0d298a6b843431 (diff)
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.
Diffstat (limited to '')
-rw-r--r--src/lib/evas/common/evas_op_blend/op_blend_master_sse3.c4
-rw-r--r--src/lib/evas/common/evas_op_blend/op_blend_pixel_mask_.c24
-rw-r--r--src/lib/evas/common/evas_op_blend/op_blend_pixel_mask_i386.c17
-rw-r--r--src/lib/evas/common/evas_op_blend/op_blend_pixel_mask_neon.c9
-rw-r--r--src/lib/evas/common/evas_op_blend/op_blend_pixel_mask_sse3.c16
-rw-r--r--src/lib/evas/common/evas_op_blend_main_.c4
6 files changed, 43 insertions, 31 deletions
diff --git a/src/lib/evas/common/evas_op_blend/op_blend_master_sse3.c b/src/lib/evas/common/evas_op_blend/op_blend_master_sse3.c
index 667838eb8a..2947b8b6b2 100644
--- a/src/lib/evas/common/evas_op_blend/op_blend_master_sse3.c
+++ b/src/lib/evas/common/evas_op_blend/op_blend_master_sse3.c
@@ -31,7 +31,7 @@ evas_common_op_blend_init_sse3(void)
31 31
32 init_blend_pixel_span_funcs_sse3(); 32 init_blend_pixel_span_funcs_sse3();
33 init_blend_pixel_color_span_funcs_sse3(); 33 init_blend_pixel_color_span_funcs_sse3();
34 init_blend_pixel_mask_span_funcs_sse3(); 34 init_blend_pixel_mask_span_funcs_sse3(); // FIXME
35 init_blend_color_span_funcs_sse3(); 35 init_blend_color_span_funcs_sse3();
36 init_blend_mask_color_span_funcs_sse3(); 36 init_blend_mask_color_span_funcs_sse3();
37 37
@@ -49,7 +49,7 @@ evas_common_op_blend_rel_init_sse3(void)
49#ifdef BUILD_SSE3 49#ifdef BUILD_SSE3
50 init_blend_rel_pixel_span_funcs_sse3(); 50 init_blend_rel_pixel_span_funcs_sse3();
51 init_blend_rel_pixel_color_span_funcs_sse3(); 51 init_blend_rel_pixel_color_span_funcs_sse3();
52 init_blend_rel_pixel_mask_span_funcs_sse3(); 52 init_blend_rel_pixel_mask_span_funcs_sse3(); // FIXME
53 init_blend_rel_color_span_funcs_sse3(); 53 init_blend_rel_color_span_funcs_sse3();
54 init_blend_rel_mask_color_span_funcs_sse3(); 54 init_blend_rel_mask_color_span_funcs_sse3();
55 55
diff --git a/src/lib/evas/common/evas_op_blend/op_blend_pixel_mask_.c b/src/lib/evas/common/evas_op_blend/op_blend_pixel_mask_.c
index 78ff716c21..2ac4f897b2 100644
--- a/src/lib/evas/common/evas_op_blend/op_blend_pixel_mask_.c
+++ b/src/lib/evas/common/evas_op_blend/op_blend_pixel_mask_.c
@@ -25,29 +25,7 @@ _op_blend_p_mas_dp(DATA32 *s, DATA8 *m, DATA32 c, DATA32 *d, int l) {
25 }); 25 });
26} 26}
27 27
28static void 28#define _op_blend_pas_mas_dp _op_blend_p_mas_dp
29_op_blend_pas_mas_dp(DATA32 *s, DATA8 *m, DATA32 c EINA_UNUSED, DATA32 *d, int l) {
30 DATA32 *e;
31 int alpha;
32 UNROLL8_PLD_WHILE(d, l, e,
33 {
34 alpha = *m;
35 switch(alpha)
36 {
37 case 0:
38 break;
39 case 255:
40 *d = *s;
41 break;
42 default:
43 alpha++;
44 *d = INTERP_256(alpha, *s, *d);
45 break;
46 }
47 m++; s++; d++;
48 });
49}
50
51#define _op_blend_pan_mas_dp _op_blend_pas_mas_dp 29#define _op_blend_pan_mas_dp _op_blend_pas_mas_dp
52 30
53#define _op_blend_p_mas_dpan _op_blend_p_mas_dp 31#define _op_blend_p_mas_dpan _op_blend_p_mas_dp
diff --git a/src/lib/evas/common/evas_op_blend/op_blend_pixel_mask_i386.c b/src/lib/evas/common/evas_op_blend/op_blend_pixel_mask_i386.c
index 8c960d2117..9494ce6dda 100644
--- a/src/lib/evas/common/evas_op_blend/op_blend_pixel_mask_i386.c
+++ b/src/lib/evas/common/evas_op_blend/op_blend_pixel_mask_i386.c
@@ -1,6 +1,10 @@
1/* blend pixel x mask --> dst */ 1/* blend pixel x mask --> dst */
2 2
3#ifdef BUILD_MMX 3#ifdef BUILD_MMX
4
5// FIXME: These functions most likely don't perform the correct operation.
6// Test them with masks and images.
7#if 0
4static void 8static void
5_op_blend_pas_mas_dp_mmx(DATA32 *s, DATA8 *m, DATA32 c EINA_UNUSED, DATA32 *d, int l) { 9_op_blend_pas_mas_dp_mmx(DATA32 *s, DATA8 *m, DATA32 c EINA_UNUSED, DATA32 *d, int l) {
6 DATA32 *e = d + l; 10 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
62 m++; s++; d++; 66 m++; s++; d++;
63 } 67 }
64} 68}
69#else
70// FIXME
71#define _op_blend_p_mas_dp_mmx NULL
72#define _op_blend_pas_mas_dp_mmx _op_blend_p_mas_dp_mmx
73#endif
65 74
66#define _op_blend_p_mas_dp_mmx _op_blend_pas_mas_dp_mmx 75#define _op_blend_pan_mas_dp_mmx _op_blend_pas_mas_dp_mmx
67 76
68#define _op_blend_p_mas_dpan_mmx _op_blend_p_mas_dp_mmx 77#define _op_blend_p_mas_dpan_mmx _op_blend_p_mas_dp_mmx
69#define _op_blend_pan_mas_dpan_mmx _op_blend_pan_mas_dp_mmx 78#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)
128 137
129#ifdef BUILD_MMX 138#ifdef BUILD_MMX
130 139
131#define _op_blend_rel_p_mas_dpan_mmx _op_blend_p_mas_dpan_mmx 140#define _op_blend_rel_p_mas_dpan_mmx NULL
132#define _op_blend_rel_pas_mas_dpan_mmx _op_blend_pas_mas_dpan_mmx 141#define _op_blend_rel_pas_mas_dpan_mmx _op_blend_rel_p_mas_dpan_mmx
133#define _op_blend_rel_pan_mas_dpan_mmx _op_blend_pan_mas_dpan_mmx 142#define _op_blend_rel_pan_mas_dpan_mmx _op_blend_rel_pas_mas_dpan_mmx
134 143
135static void 144static void
136init_blend_rel_pixel_mask_span_funcs_mmx(void) 145init_blend_rel_pixel_mask_span_funcs_mmx(void)
diff --git a/src/lib/evas/common/evas_op_blend/op_blend_pixel_mask_neon.c b/src/lib/evas/common/evas_op_blend/op_blend_pixel_mask_neon.c
index d36e714721..0c1029b7b1 100644
--- a/src/lib/evas/common/evas_op_blend/op_blend_pixel_mask_neon.c
+++ b/src/lib/evas/common/evas_op_blend/op_blend_pixel_mask_neon.c
@@ -1,6 +1,10 @@
1/* blend pixel x mask --> dst */ 1/* blend pixel x mask --> dst */
2 2
3// FIXME: These functions most likely don't perform the correct operation.
4// Test them with masks and images.
5
3#ifdef BUILD_NEON 6#ifdef BUILD_NEON
7#if 0
4static void 8static void
5_op_blend_pas_mas_dp_neon(DATA32 *s, DATA8 *m, DATA32 c EINA_UNUSED, DATA32 *d, int l) { 9_op_blend_pas_mas_dp_neon(DATA32 *s, DATA8 *m, DATA32 c EINA_UNUSED, DATA32 *d, int l) {
6 DATA32 *e; 10 DATA32 *e;
@@ -46,6 +50,11 @@ _op_blend_pan_mas_dp_neon(DATA32 *s, DATA8 *m, DATA32 c EINA_UNUSED, DATA32 *d,
46 m++; s++; d++; 50 m++; s++; d++;
47 }); 51 });
48} 52}
53#else
54// FIXME
55#define _op_blend_pas_mas_dp_neon NULL
56#define _op_blend_pan_mas_dp_neon NULL
57#endif
49 58
50#define _op_blend_p_mas_dp_neon _op_blend_pas_mas_dp_neon 59#define _op_blend_p_mas_dp_neon _op_blend_pas_mas_dp_neon
51 60
diff --git a/src/lib/evas/common/evas_op_blend/op_blend_pixel_mask_sse3.c b/src/lib/evas/common/evas_op_blend/op_blend_pixel_mask_sse3.c
index 07f336b802..6ffa3ce776 100644
--- a/src/lib/evas/common/evas_op_blend/op_blend_pixel_mask_sse3.c
+++ b/src/lib/evas/common/evas_op_blend/op_blend_pixel_mask_sse3.c
@@ -2,6 +2,9 @@
2 2
3#ifdef BUILD_SSE3 3#ifdef BUILD_SSE3
4 4
5// FIXME: These functions most likely don't perform the correct operation.
6// Test them with masks and images.
7#if 0
5static void 8static void
6_op_blend_p_mas_dp_sse3(DATA32 *s, DATA8 *m, DATA32 c, DATA32 *d, int l) { 9_op_blend_p_mas_dp_sse3(DATA32 *s, DATA8 *m, DATA32 c, DATA32 *d, int l) {
7 10
@@ -150,6 +153,12 @@ _op_blend_pas_mas_dp_sse3(DATA32 *s, DATA8 *m, DATA32 c EINA_UNUSED, DATA32 *d,
150 m += 8; s += 8; d += 8; l -= 8; 153 m += 8; s += 8; d += 8; l -= 8;
151 }) 154 })
152} 155}
156#endif
157
158// FIXME
159#define _op_blend_p_mas_dp_sse3 NULL
160#define _op_blend_pas_mas_dp_sse3 _op_blend_p_mas_dp_sse3
161// -----
153 162
154#define _op_blend_pan_mas_dp_sse3 _op_blend_pas_mas_dp_sse3 163#define _op_blend_pan_mas_dp_sse3 _op_blend_pas_mas_dp_sse3
155 164
@@ -169,8 +178,10 @@ init_blend_pixel_mask_span_funcs_sse3(void)
169 op_blend_span_funcs[SP_AN][SM_AS][SC_N][DP_AN][CPU_SSE3] = _op_blend_pan_mas_dpan_sse3; 178 op_blend_span_funcs[SP_AN][SM_AS][SC_N][DP_AN][CPU_SSE3] = _op_blend_pan_mas_dpan_sse3;
170} 179}
171 180
181// FIXME
172#define _op_blend_pt_p_mas_dp_sse3 NULL 182#define _op_blend_pt_p_mas_dp_sse3 NULL
173#define _op_blend_pt_pan_mas_dp_sse3 NULL 183#define _op_blend_pt_pan_mas_dp_sse3 NULL
184// -----
174 185
175#define _op_blend_pt_pas_mas_dp_sse3 _op_blend_pt_p_mas_dp_sse3 186#define _op_blend_pt_pas_mas_dp_sse3 _op_blend_pt_p_mas_dp_sse3
176 187
@@ -194,6 +205,7 @@ init_blend_pixel_mask_pt_funcs_sse3(void)
194 205
195/* blend_rel pixel x mask -> dst */ 206/* blend_rel pixel x mask -> dst */
196 207
208#if 0
197static void 209static void
198_op_blend_rel_p_mas_dp_sse3(DATA32 *s, DATA8 *m, DATA32 c, DATA32 *d, int l) { 210_op_blend_rel_p_mas_dp_sse3(DATA32 *s, DATA8 *m, DATA32 c, DATA32 *d, int l) {
199 211
@@ -256,6 +268,10 @@ _op_blend_rel_p_mas_dp_sse3(DATA32 *s, DATA8 *m, DATA32 c, DATA32 *d, int l) {
256 d += 8; m += 8; s += 8; l -= 8; 268 d += 8; m += 8; s += 8; l -= 8;
257 }) 269 })
258} 270}
271#else
272// FIXME
273#define _op_blend_rel_p_mas_dp_sse3 NULL
274#endif
259 275
260#define _op_blend_rel_pas_mas_dp_sse3 _op_blend_rel_p_mas_dp_sse3 276#define _op_blend_rel_pas_mas_dp_sse3 _op_blend_rel_p_mas_dp_sse3
261#define _op_blend_rel_pan_mas_dp_sse3 _op_blend_rel_p_mas_dp_sse3 277#define _op_blend_rel_pan_mas_dp_sse3 _op_blend_rel_p_mas_dp_sse3
diff --git a/src/lib/evas/common/evas_op_blend_main_.c b/src/lib/evas/common/evas_op_blend_main_.c
index aff6cdb8b7..33f7a7a7ce 100644
--- a/src/lib/evas/common/evas_op_blend_main_.c
+++ b/src/lib/evas/common/evas_op_blend_main_.c
@@ -109,7 +109,7 @@ op_blend_init(void)
109 { 109 {
110 init_blend_pixel_span_funcs_mmx(); 110 init_blend_pixel_span_funcs_mmx();
111 init_blend_pixel_color_span_funcs_mmx(); 111 init_blend_pixel_color_span_funcs_mmx();
112 init_blend_pixel_mask_span_funcs_mmx(); 112 init_blend_pixel_mask_span_funcs_mmx(); // FIXME
113 init_blend_color_span_funcs_mmx(); 113 init_blend_color_span_funcs_mmx();
114 init_blend_mask_color_span_funcs_mmx(); 114 init_blend_mask_color_span_funcs_mmx();
115 115
@@ -125,7 +125,7 @@ op_blend_init(void)
125 { 125 {
126 init_blend_pixel_span_funcs_neon(); 126 init_blend_pixel_span_funcs_neon();
127 init_blend_pixel_color_span_funcs_neon(); 127 init_blend_pixel_color_span_funcs_neon();
128 init_blend_pixel_mask_span_funcs_neon(); 128 init_blend_pixel_mask_span_funcs_neon(); // FIXME
129 init_blend_color_span_funcs_neon(); 129 init_blend_color_span_funcs_neon();
130 init_blend_mask_color_span_funcs_neon(); 130 init_blend_mask_color_span_funcs_neon();
131 131