summaryrefslogtreecommitdiff
path: root/src/lib/evas/common/evas_op_blend_main_.c
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2012-11-04 11:51:42 +0000
committerVincent Torri <vincent.torri@gmail.com>2012-11-04 11:51:42 +0000
commitc15e9c6575c3b5f39ded167dda5259de3de96151 (patch)
tree5115d7ae3620af24c2bc094cd062575af7adeda9 /src/lib/evas/common/evas_op_blend_main_.c
parenta5ac6a987caec5a7f7596a25d0a065b9cc94c50c (diff)
merge: and now Evas
I've tested make -j 3 install and it works nicely I've tested expedite with software and opengl xlib, and it works. Not tested other engines, so please report any problems (engines or other) on the ML. TODO: examples and tests, I'll add them later ISSUE: Eina_Unicode size check. It indirectly depends on eina_config.h, which is created at the end of the configure script. So its size is always 0. I don't know how that size is used, so I can't do a lot, for now. SVN revision: 78895
Diffstat (limited to 'src/lib/evas/common/evas_op_blend_main_.c')
-rw-r--r--src/lib/evas/common/evas_op_blend_main_.c659
1 files changed, 659 insertions, 0 deletions
diff --git a/src/lib/evas/common/evas_op_blend_main_.c b/src/lib/evas/common/evas_op_blend_main_.c
new file mode 100644
index 0000000000..b3aaf90a20
--- /dev/null
+++ b/src/lib/evas/common/evas_op_blend_main_.c
@@ -0,0 +1,659 @@
1#include "evas_common.h"
2
3RGBA_Gfx_Func op_blend_span_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
4RGBA_Gfx_Pt_Func op_blend_pt_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
5
6static void op_blend_init(void);
7static void op_blend_shutdown(void);
8
9static RGBA_Gfx_Func op_blend_pixel_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels);
10static RGBA_Gfx_Func op_blend_color_span_get(DATA32 col, RGBA_Image *dst, int pixels);
11static RGBA_Gfx_Func op_blend_pixel_color_span_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels);
12static RGBA_Gfx_Func op_blend_mask_color_span_get(DATA32 col, RGBA_Image *dst, int pixels);
13static RGBA_Gfx_Func op_blend_pixel_mask_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels);
14
15static RGBA_Gfx_Pt_Func op_blend_pixel_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst);
16static RGBA_Gfx_Pt_Func op_blend_color_pt_get(DATA32 col, RGBA_Image *dst);
17static RGBA_Gfx_Pt_Func op_blend_pixel_color_pt_get(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst);
18static RGBA_Gfx_Pt_Func op_blend_mask_color_pt_get(DATA32 col, RGBA_Image *dst);
19static RGBA_Gfx_Pt_Func op_blend_pixel_mask_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst);
20
21static RGBA_Gfx_Compositor _composite_blend = { "blend",
22 op_blend_init, op_blend_shutdown,
23 op_blend_pixel_span_get, op_blend_color_span_get,
24 op_blend_pixel_color_span_get, op_blend_mask_color_span_get,
25 op_blend_pixel_mask_span_get,
26 op_blend_pixel_pt_get, op_blend_color_pt_get,
27 op_blend_pixel_color_pt_get, op_blend_mask_color_pt_get,
28 op_blend_pixel_mask_pt_get
29 };
30
31RGBA_Gfx_Compositor *
32evas_common_gfx_compositor_blend_get(void)
33{
34 return &(_composite_blend);
35}
36
37
38RGBA_Gfx_Func op_blend_rel_span_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
39RGBA_Gfx_Pt_Func op_blend_rel_pt_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
40
41static void op_blend_rel_init(void);
42static void op_blend_rel_shutdown(void);
43
44static RGBA_Gfx_Func op_blend_rel_pixel_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels);
45static RGBA_Gfx_Func op_blend_rel_color_span_get(DATA32 col, RGBA_Image *dst, int pixels);
46static RGBA_Gfx_Func op_blend_rel_pixel_color_span_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels);
47static RGBA_Gfx_Func op_blend_rel_mask_color_span_get(DATA32 col, RGBA_Image *dst, int pixels);
48static RGBA_Gfx_Func op_blend_rel_pixel_mask_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels);
49
50static RGBA_Gfx_Pt_Func op_blend_rel_pixel_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst);
51static RGBA_Gfx_Pt_Func op_blend_rel_color_pt_get(DATA32 col, RGBA_Image *dst);
52static RGBA_Gfx_Pt_Func op_blend_rel_pixel_color_pt_get(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst);
53static RGBA_Gfx_Pt_Func op_blend_rel_mask_color_pt_get(DATA32 col, RGBA_Image *dst);
54static RGBA_Gfx_Pt_Func op_blend_rel_pixel_mask_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst);
55
56static RGBA_Gfx_Compositor _composite_blend_rel = { "blend_rel",
57 op_blend_rel_init, op_blend_rel_shutdown,
58 op_blend_rel_pixel_span_get, op_blend_rel_color_span_get,
59 op_blend_rel_pixel_color_span_get, op_blend_rel_mask_color_span_get,
60 op_blend_rel_pixel_mask_span_get,
61 op_blend_rel_pixel_pt_get, op_blend_rel_color_pt_get,
62 op_blend_rel_pixel_color_pt_get, op_blend_rel_mask_color_pt_get,
63 op_blend_rel_pixel_mask_pt_get
64 };
65
66RGBA_Gfx_Compositor *
67evas_common_gfx_compositor_blend_rel_get(void)
68{
69 return &(_composite_blend_rel);
70}
71
72
73# include "./evas_op_blend/op_blend_pixel_.c"
74# include "./evas_op_blend/op_blend_color_.c"
75# include "./evas_op_blend/op_blend_pixel_color_.c"
76# include "./evas_op_blend/op_blend_pixel_mask_.c"
77# include "./evas_op_blend/op_blend_mask_color_.c"
78//# include "./evas_op_blend/op_blend_pixel_mask_color_.c"
79
80# include "./evas_op_blend/op_blend_pixel_i386.c"
81# include "./evas_op_blend/op_blend_color_i386.c"
82# include "./evas_op_blend/op_blend_pixel_color_i386.c"
83# include "./evas_op_blend/op_blend_pixel_mask_i386.c"
84# include "./evas_op_blend/op_blend_mask_color_i386.c"
85//# include "./evas_op_blend/op_blend_pixel_mask_color_i386.c"
86
87# include "./evas_op_blend/op_blend_pixel_neon.c"
88# include "./evas_op_blend/op_blend_color_neon.c"
89# include "./evas_op_blend/op_blend_pixel_color_neon.c"
90# include "./evas_op_blend/op_blend_pixel_mask_neon.c"
91# include "./evas_op_blend/op_blend_mask_color_neon.c"
92//# include "./evas_op_blend/op_blend_pixel_mask_color_neon.c"
93
94#ifdef BUILD_SSE3
95void evas_common_op_blend_init_sse3(void);
96#endif
97
98static void
99op_blend_init(void)
100{
101 memset(op_blend_span_funcs, 0, sizeof(op_blend_span_funcs));
102 memset(op_blend_pt_funcs, 0, sizeof(op_blend_pt_funcs));
103#ifdef BUILD_SSE3
104 evas_common_op_blend_init_sse3();
105#endif
106#ifdef BUILD_MMX
107 init_blend_pixel_span_funcs_mmx();
108 init_blend_pixel_color_span_funcs_mmx();
109 init_blend_pixel_mask_span_funcs_mmx();
110 init_blend_color_span_funcs_mmx();
111 init_blend_mask_color_span_funcs_mmx();
112
113 init_blend_pixel_pt_funcs_mmx();
114 init_blend_pixel_color_pt_funcs_mmx();
115 init_blend_pixel_mask_pt_funcs_mmx();
116 init_blend_color_pt_funcs_mmx();
117 init_blend_mask_color_pt_funcs_mmx();
118#endif
119#ifdef BUILD_NEON
120 init_blend_pixel_span_funcs_neon();
121 init_blend_pixel_color_span_funcs_neon();
122 init_blend_pixel_mask_span_funcs_neon();
123 init_blend_color_span_funcs_neon();
124 init_blend_mask_color_span_funcs_neon();
125
126 init_blend_pixel_pt_funcs_neon();
127 init_blend_pixel_color_pt_funcs_neon();
128 init_blend_pixel_mask_pt_funcs_neon();
129 init_blend_color_pt_funcs_neon();
130 init_blend_mask_color_pt_funcs_neon();
131#endif
132 init_blend_pixel_span_funcs_c();
133 init_blend_pixel_color_span_funcs_c();
134 init_blend_pixel_mask_span_funcs_c();
135 init_blend_color_span_funcs_c();
136 init_blend_mask_color_span_funcs_c();
137
138 init_blend_pixel_pt_funcs_c();
139 init_blend_pixel_color_pt_funcs_c();
140 init_blend_pixel_mask_pt_funcs_c();
141 init_blend_color_pt_funcs_c();
142 init_blend_mask_color_pt_funcs_c();
143}
144
145static void
146op_blend_shutdown(void)
147{
148}
149
150static RGBA_Gfx_Func
151blend_gfx_span_func_cpu(int s, int m, int c, int d)
152{
153 RGBA_Gfx_Func func = NULL;
154 int cpu = CPU_N;
155#ifdef BUILD_SSE3
156 if (evas_common_cpu_has_feature(CPU_FEATURE_SSE3))
157 {
158 cpu = CPU_SSE3;
159 func = op_blend_span_funcs[s][m][c][d][cpu];
160 if(func) return func;
161 }
162#endif
163#ifdef BUILD_MMX
164 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
165 {
166 cpu = CPU_MMX;
167 func = op_blend_span_funcs[s][m][c][d][cpu];
168 if (func) return func;
169 }
170#endif
171#ifdef BUILD_NEON
172 if (evas_common_cpu_has_feature(CPU_FEATURE_NEON))
173 {
174 cpu = CPU_NEON;
175 func = op_blend_span_funcs[s][m][c][d][cpu];
176 if (func) return func;
177 }
178#endif
179 cpu = CPU_C;
180 func = op_blend_span_funcs[s][m][c][d][cpu];
181 if (func) return func;
182 return func;
183}
184
185static RGBA_Gfx_Func
186op_blend_pixel_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels EINA_UNUSED)
187{
188 int s = SP_AN, m = SM_N, c = SC_N, d = DP_AN;
189
190 if (src && src->cache_entry.flags.alpha)
191 {
192 s = SP;
193 if (src->cache_entry.flags.alpha_sparse)
194 s = SP_AS;
195 }
196 if (dst && dst->cache_entry.flags.alpha)
197 d = DP;
198 return blend_gfx_span_func_cpu(s, m, c, d);
199}
200
201static RGBA_Gfx_Func
202op_blend_color_span_get(DATA32 col, RGBA_Image *dst, int pixels EINA_UNUSED)
203{
204 int s = SP_N, m = SM_N, c = SC_AN, d = DP_AN;
205
206 if ((col >> 24) < 255)
207 c = SC;
208 if (col == ((col >> 24) * 0x01010101))
209 c = SC_AA;
210 if (col == 0xffffffff)
211 c = SC_N;
212 if (dst && dst->cache_entry.flags.alpha)
213 d = DP;
214 return blend_gfx_span_func_cpu(s, m, c, d);
215}
216
217static RGBA_Gfx_Func
218op_blend_pixel_color_span_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels EINA_UNUSED)
219{
220 int s = SP_AN, m = SM_N, c = SC_AN, d = DP_AN;
221
222 if (src && src->cache_entry.flags.alpha)
223 {
224 s = SP;
225 if (src->cache_entry.flags.alpha_sparse)
226 s = SP_AS;
227 }
228 if ((col >> 24) < 255)
229 c = SC;
230 if (col == ((col >> 24) * 0x01010101))
231 c = SC_AA;
232 if (col == 0xffffffff)
233 c = SC_N;
234 if (dst && dst->cache_entry.flags.alpha)
235 d = DP;
236 return blend_gfx_span_func_cpu(s, m, c, d);
237}
238
239static RGBA_Gfx_Func
240op_blend_mask_color_span_get(DATA32 col, RGBA_Image *dst, int pixels EINA_UNUSED)
241{
242 int s = SP_N, m = SM_AS, c = SC_AN, d = DP_AN;
243
244 if ((col >> 24) < 255)
245 c = SC;
246 if (col == ((col >> 24) * 0x01010101))
247 c = SC_AA;
248 if (col == 0xffffffff)
249 c = SC_N;
250 if (dst && dst->cache_entry.flags.alpha)
251 d = DP;
252 return blend_gfx_span_func_cpu(s, m, c, d);
253}
254
255static RGBA_Gfx_Func
256op_blend_pixel_mask_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels EINA_UNUSED)
257{
258 int s = SP_AN, m = SM_AS, c = SC_N, d = DP_AN;
259
260 if (src && src->cache_entry.flags.alpha)
261 {
262 s = SP;
263 if (src->cache_entry.flags.alpha_sparse)
264 s = SP_AS;
265 }
266 if (dst && dst->cache_entry.flags.alpha)
267 d = DP;
268 return blend_gfx_span_func_cpu(s, m, c, d);
269}
270
271
272static RGBA_Gfx_Pt_Func
273blend_gfx_pt_func_cpu(int s, int m, int c, int d)
274{
275 RGBA_Gfx_Pt_Func func = NULL;
276 int cpu = CPU_N;
277#ifdef BUILD_SSE3
278 if(evas_common_cpu_has_feature(CPU_FEATURE_SSE3))
279 {
280 cpu = CPU_SSE3;
281 func = op_blend_pt_funcs[s][m][c][d][cpu];
282 if(func) return func;
283 }
284#endif
285#ifdef BUILD_MMX
286 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
287 {
288 cpu = CPU_MMX;
289 func = op_blend_pt_funcs[s][m][c][d][cpu];
290 if (func) return func;
291 }
292#endif
293#ifdef BUILD_NEON
294 if (evas_common_cpu_has_feature(CPU_FEATURE_NEON))
295 {
296 cpu = CPU_NEON;
297 func = op_blend_pt_funcs[s][m][c][d][cpu];
298 if (func) return func;
299 }
300#endif
301 cpu = CPU_C;
302 func = op_blend_pt_funcs[s][m][c][d][cpu];
303 if (func) return func;
304 return func;
305}
306
307static RGBA_Gfx_Pt_Func
308op_blend_pixel_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst)
309{
310 int s = SP_AN, m = SM_N, c = SC_N, d = DP_AN;
311
312 if (src_flags.alpha)
313 s = SP;
314 if (dst && dst->cache_entry.flags.alpha)
315 d = DP;
316 return blend_gfx_pt_func_cpu(s, m, c, d);
317}
318
319static RGBA_Gfx_Pt_Func
320op_blend_color_pt_get(DATA32 col, RGBA_Image *dst)
321{
322 int s = SP_N, m = SM_N, c = SC_AN, d = DP_AN;
323
324 if ((col >> 24) < 255)
325 c = SC;
326 if (col == ((col >> 24) * 0x01010101))
327 c = SC_AA;
328 if (col == 0xffffffff)
329 c = SC_N;
330 if (dst && dst->cache_entry.flags.alpha)
331 d = DP;
332 return blend_gfx_pt_func_cpu(s, m, c, d);
333}
334
335static RGBA_Gfx_Pt_Func
336op_blend_pixel_color_pt_get(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst)
337{
338 int s = SP_AN, m = SM_N, c = SC_AN, d = DP_AN;
339
340 if (src_flags.alpha)
341 s = SP;
342 if ((col >> 24) < 255)
343 c = SC;
344 if (col == ((col >> 24) * 0x01010101))
345 c = SC_AA;
346 if (col == 0xffffffff)
347 c = SC_N;
348 if (dst && dst->cache_entry.flags.alpha)
349 d = DP;
350 return blend_gfx_pt_func_cpu(s, m, c, d);
351}
352
353static RGBA_Gfx_Pt_Func
354op_blend_mask_color_pt_get(DATA32 col, RGBA_Image *dst)
355{
356 int s = SP_N, m = SM_AS, c = SC_AN, d = DP_AN;
357
358 if ((col >> 24) < 255)
359 c = SC;
360 if (col == ((col >> 24) * 0x01010101))
361 c = SC_AA;
362 if (col == 0xffffffff)
363 c = SC_N;
364 if (dst && dst->cache_entry.flags.alpha)
365 d = DP;
366 return blend_gfx_pt_func_cpu(s, m, c, d);
367}
368
369static RGBA_Gfx_Pt_Func
370op_blend_pixel_mask_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst)
371{
372 int s = SP_AN, m = SM_AS, c = SC_N, d = DP_AN;
373
374 if (src_flags.alpha)
375 s = SP;
376 if (dst && dst->cache_entry.flags.alpha)
377 d = DP;
378 return blend_gfx_pt_func_cpu(s, m, c, d);
379}
380
381void evas_common_op_blend_rel_init_sse3(void);
382
383static void
384op_blend_rel_init(void)
385{
386 memset(op_blend_rel_span_funcs, 0, sizeof(op_blend_rel_span_funcs));
387 memset(op_blend_rel_pt_funcs, 0, sizeof(op_blend_rel_pt_funcs));
388#ifdef BUILD_SSE3
389 evas_common_op_blend_rel_init_sse3();
390#endif
391#ifdef BUILD_MMX
392 init_blend_rel_pixel_span_funcs_mmx();
393 init_blend_rel_pixel_color_span_funcs_mmx();
394 init_blend_rel_pixel_mask_span_funcs_mmx();
395 init_blend_rel_color_span_funcs_mmx();
396 init_blend_rel_mask_color_span_funcs_mmx();
397
398 init_blend_rel_pixel_pt_funcs_mmx();
399 init_blend_rel_pixel_color_pt_funcs_mmx();
400 init_blend_rel_pixel_mask_pt_funcs_mmx();
401 init_blend_rel_color_pt_funcs_mmx();
402 init_blend_rel_mask_color_pt_funcs_mmx();
403#endif
404#ifdef BUILD_NEON
405 init_blend_rel_pixel_span_funcs_neon();
406 init_blend_rel_pixel_color_span_funcs_neon();
407 init_blend_rel_pixel_mask_span_funcs_neon();
408 init_blend_rel_color_span_funcs_neon();
409 init_blend_rel_mask_color_span_funcs_neon();
410
411 init_blend_rel_pixel_pt_funcs_neon();
412 init_blend_rel_pixel_color_pt_funcs_neon();
413 init_blend_rel_pixel_mask_pt_funcs_neon();
414 init_blend_rel_color_pt_funcs_neon();
415 init_blend_rel_mask_color_pt_funcs_neon();
416#endif
417 init_blend_rel_pixel_span_funcs_c();
418 init_blend_rel_pixel_color_span_funcs_c();
419 init_blend_rel_pixel_mask_span_funcs_c();
420 init_blend_rel_color_span_funcs_c();
421 init_blend_rel_mask_color_span_funcs_c();
422
423 init_blend_rel_pixel_pt_funcs_c();
424 init_blend_rel_pixel_color_pt_funcs_c();
425 init_blend_rel_pixel_mask_pt_funcs_c();
426 init_blend_rel_color_pt_funcs_c();
427 init_blend_rel_mask_color_pt_funcs_c();
428}
429
430static void
431op_blend_rel_shutdown(void)
432{
433}
434
435static RGBA_Gfx_Func
436blend_rel_gfx_span_func_cpu(int s, int m, int c, int d)
437{
438 RGBA_Gfx_Func func = NULL;
439 int cpu = CPU_N;
440#ifdef BUILD_SSE3
441 if (evas_common_cpu_has_feature(CPU_FEATURE_SSE3))
442 {
443 cpu = CPU_SSE3;
444 func = op_blend_rel_span_funcs[s][m][c][d][cpu];
445 if(func) return func;
446 }
447#endif
448#ifdef BUILD_MMX
449 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
450 {
451 cpu = CPU_MMX;
452 func = op_blend_rel_span_funcs[s][m][c][d][cpu];
453 if (func) return func;
454 }
455#endif
456#ifdef BUILD_NEON
457 if (evas_common_cpu_has_feature(CPU_FEATURE_NEON))
458 {
459 cpu = CPU_NEON;
460 func = op_blend_rel_span_funcs[s][m][c][d][cpu];
461 if (func) return func;
462 }
463#endif
464 cpu = CPU_C;
465 func = op_blend_rel_span_funcs[s][m][c][d][cpu];
466 if (func) return func;
467 return func;
468}
469
470static RGBA_Gfx_Func
471op_blend_rel_pixel_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels EINA_UNUSED)
472{
473 int s = SP_AN, m = SM_N, c = SC_N, d = DP_AN;
474
475 if (src && src->cache_entry.flags.alpha)
476 {
477 s = SP;
478 if (src->cache_entry.flags.alpha_sparse)
479 s = SP_AS;
480 }
481 if (dst && dst->cache_entry.flags.alpha)
482 d = DP;
483 return blend_rel_gfx_span_func_cpu(s, m, c, d);
484}
485
486static RGBA_Gfx_Func
487op_blend_rel_color_span_get(DATA32 col, RGBA_Image *dst, int pixels EINA_UNUSED)
488{
489 int s = SP_N, m = SM_N, c = SC_AN, d = DP_AN;
490
491 if ((col >> 24) < 255)
492 c = SC;
493 if (col == ((col >> 24) * 0x01010101))
494 c = SC_AA;
495 if (col == 0xffffffff)
496 c = SC_N;
497 if (dst && dst->cache_entry.flags.alpha)
498 d = DP;
499 return blend_rel_gfx_span_func_cpu(s, m, c, d);
500}
501
502static RGBA_Gfx_Func
503op_blend_rel_pixel_color_span_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels EINA_UNUSED)
504{
505 int s = SP_AN, m = SM_N, c = SC_AN, d = DP_AN;
506
507 if (src && src->cache_entry.flags.alpha)
508 s = SP;
509 if ((col >> 24) < 255)
510 c = SC;
511 if (col == ((col >> 24) * 0x01010101))
512 c = SC_AA;
513 if (col == 0xffffffff)
514 c = SC_N;
515 if (dst && dst->cache_entry.flags.alpha)
516 d = DP;
517 return blend_rel_gfx_span_func_cpu(s, m, c, d);
518}
519
520static RGBA_Gfx_Func
521op_blend_rel_mask_color_span_get(DATA32 col, RGBA_Image *dst, int pixels EINA_UNUSED)
522{
523 int s = SP_N, m = SM_AS, c = SC_AN, d = DP_AN;
524
525 if ((col >> 24) < 255)
526 c = SC;
527 if (col == ((col >> 24) * 0x01010101))
528 c = SC_AA;
529 if (col == 0xffffffff)
530 c = SC_N;
531 if (dst && dst->cache_entry.flags.alpha)
532 d = DP;
533 return blend_rel_gfx_span_func_cpu(s, m, c, d);
534}
535
536static RGBA_Gfx_Func
537op_blend_rel_pixel_mask_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels EINA_UNUSED)
538{
539 int s = SP_AN, m = SM_AS, c = SC_N, d = DP_AN;
540
541 if (src && src->cache_entry.flags.alpha)
542 {
543 s = SP;
544 if (src->cache_entry.flags.alpha_sparse)
545 s = SP_AS;
546 }
547 if (dst && dst->cache_entry.flags.alpha)
548 d = DP;
549 return blend_rel_gfx_span_func_cpu(s, m, c, d);
550}
551
552static RGBA_Gfx_Pt_Func
553blend_rel_gfx_pt_func_cpu(int s, int m, int c, int d)
554{
555 RGBA_Gfx_Pt_Func func = NULL;
556 int cpu = CPU_N;
557#ifdef BUILD_SSE3
558 if (evas_common_cpu_has_feature(CPU_FEATURE_SSE3))
559 {
560 cpu = CPU_SSE3;
561 func = op_blend_rel_pt_funcs[s][m][c][d][cpu];
562 if(func) return func;
563 }
564#endif
565#ifdef BUILD_MMX
566 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
567 {
568 cpu = CPU_MMX;
569 func = op_blend_rel_pt_funcs[s][m][c][d][cpu];
570 if (func) return func;
571 }
572#endif
573#ifdef BUILD_NEON
574 if (evas_common_cpu_has_feature(CPU_FEATURE_NEON))
575 {
576 cpu = CPU_NEON;
577 func = op_blend_rel_pt_funcs[s][m][c][d][cpu];
578 if (func) return func;
579 }
580#endif
581 cpu = CPU_C;
582 func = op_blend_rel_pt_funcs[s][m][c][d][cpu];
583 if (func) return func;
584 return func;
585}
586
587static RGBA_Gfx_Pt_Func
588op_blend_rel_pixel_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst)
589{
590 int s = SP_AN, m = SM_N, c = SC_N, d = DP_AN;
591
592 if (src_flags.alpha)
593 s = SP;
594 if (dst && dst->cache_entry.flags.alpha)
595 d = DP;
596 return blend_rel_gfx_pt_func_cpu(s, m, c, d);
597}
598
599static RGBA_Gfx_Pt_Func
600op_blend_rel_color_pt_get(DATA32 col, RGBA_Image *dst)
601{
602 int s = SP_N, m = SM_N, c = SC_AN, d = DP_AN;
603
604 if ((col >> 24) < 255)
605 c = SC;
606 if (col == ((col >> 24) * 0x01010101))
607 c = SC_AA;
608 if (col == 0xffffffff)
609 c = SC_N;
610 if (dst && dst->cache_entry.flags.alpha)
611 d = DP;
612 return blend_rel_gfx_pt_func_cpu(s, m, c, d);
613}
614
615static RGBA_Gfx_Pt_Func
616op_blend_rel_pixel_color_pt_get(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst)
617{
618 int s = SP_AN, m = SM_N, c = SC_AN, d = DP_AN;
619
620 if (src_flags.alpha)
621 s = SP;
622 if ((col >> 24) < 255)
623 c = SC;
624 if (col == ((col >> 24) * 0x01010101))
625 c = SC_AA;
626 if (col == 0xffffffff)
627 c = SC_N;
628 if (dst && dst->cache_entry.flags.alpha)
629 d = DP;
630 return blend_rel_gfx_pt_func_cpu(s, m, c, d);
631}
632
633static RGBA_Gfx_Pt_Func
634op_blend_rel_mask_color_pt_get(DATA32 col, RGBA_Image *dst)
635{
636 int s = SP_N, m = SM_AS, c = SC_AN, d = DP_AN;
637
638 if ((col >> 24) < 255)
639 c = SC;
640 if (col == ((col >> 24) * 0x01010101))
641 c = SC_AA;
642 if (col == 0xffffffff)
643 c = SC_N;
644 if (dst && dst->cache_entry.flags.alpha)
645 d = DP;
646 return blend_rel_gfx_pt_func_cpu(s, m, c, d);
647}
648
649static RGBA_Gfx_Pt_Func
650op_blend_rel_pixel_mask_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst)
651{
652 int s = SP_AN, m = SM_AS, c = SC_N, d = DP_AN;
653
654 if (src_flags.alpha)
655 s = SP;
656 if (dst && dst->cache_entry.flags.alpha)
657 d = DP;
658 return blend_rel_gfx_pt_func_cpu(s, m, c, d);
659}