1 #include "evas_common.h"
3 static RGBA_Gfx_Func op_blend_span_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
4 static RGBA_Gfx_Pt_Func op_blend_pt_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
6 static void op_blend_init(void);
7 static void op_blend_shutdown(void);
9 static RGBA_Gfx_Func op_blend_pixel_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels);
10 static RGBA_Gfx_Func op_blend_color_span_get(DATA32 col, RGBA_Image *dst, int pixels);
11 static RGBA_Gfx_Func op_blend_pixel_color_span_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels);
12 static RGBA_Gfx_Func op_blend_mask_color_span_get(DATA32 col, RGBA_Image *dst, int pixels);
13 static RGBA_Gfx_Func op_blend_pixel_mask_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels);
15 static RGBA_Gfx_Pt_Func op_blend_pixel_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst);
16 static RGBA_Gfx_Pt_Func op_blend_color_pt_get(DATA32 col, RGBA_Image *dst);
17 static RGBA_Gfx_Pt_Func op_blend_pixel_color_pt_get(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst);
18 static RGBA_Gfx_Pt_Func op_blend_mask_color_pt_get(DATA32 col, RGBA_Image *dst);
19 static RGBA_Gfx_Pt_Func op_blend_pixel_mask_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst);
21 static 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
32 evas_common_gfx_compositor_blend_get(void)
34 return &(_composite_blend);
38 static RGBA_Gfx_Func op_blend_rel_span_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
39 static RGBA_Gfx_Pt_Func op_blend_rel_pt_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
41 static void op_blend_rel_init(void);
42 static void op_blend_rel_shutdown(void);
44 static RGBA_Gfx_Func op_blend_rel_pixel_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels);
45 static RGBA_Gfx_Func op_blend_rel_color_span_get(DATA32 col, RGBA_Image *dst, int pixels);
46 static RGBA_Gfx_Func op_blend_rel_pixel_color_span_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels);
47 static RGBA_Gfx_Func op_blend_rel_mask_color_span_get(DATA32 col, RGBA_Image *dst, int pixels);
48 static RGBA_Gfx_Func op_blend_rel_pixel_mask_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels);
50 static RGBA_Gfx_Pt_Func op_blend_rel_pixel_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst);
51 static RGBA_Gfx_Pt_Func op_blend_rel_color_pt_get(DATA32 col, RGBA_Image *dst);
52 static RGBA_Gfx_Pt_Func op_blend_rel_pixel_color_pt_get(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst);
53 static RGBA_Gfx_Pt_Func op_blend_rel_mask_color_pt_get(DATA32 col, RGBA_Image *dst);
54 static RGBA_Gfx_Pt_Func op_blend_rel_pixel_mask_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst);
56 static 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
67 evas_common_gfx_compositor_blend_rel_get(void)
69 return &(_composite_blend_rel);
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"
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"
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"
97 memset(op_blend_span_funcs, 0, sizeof(op_blend_span_funcs));
98 memset(op_blend_pt_funcs, 0, sizeof(op_blend_pt_funcs));
100 init_blend_pixel_span_funcs_mmx();
101 init_blend_pixel_color_span_funcs_mmx();
102 init_blend_pixel_mask_span_funcs_mmx();
103 init_blend_color_span_funcs_mmx();
104 init_blend_mask_color_span_funcs_mmx();
106 init_blend_pixel_pt_funcs_mmx();
107 init_blend_pixel_color_pt_funcs_mmx();
108 init_blend_pixel_mask_pt_funcs_mmx();
109 init_blend_color_pt_funcs_mmx();
110 init_blend_mask_color_pt_funcs_mmx();
113 init_blend_pixel_span_funcs_neon();
114 init_blend_pixel_color_span_funcs_neon();
115 init_blend_pixel_mask_span_funcs_neon();
116 init_blend_color_span_funcs_neon();
117 init_blend_mask_color_span_funcs_neon();
119 init_blend_pixel_pt_funcs_neon();
120 init_blend_pixel_color_pt_funcs_neon();
121 init_blend_pixel_mask_pt_funcs_neon();
122 init_blend_color_pt_funcs_neon();
123 init_blend_mask_color_pt_funcs_neon();
126 init_blend_pixel_span_funcs_c();
127 init_blend_pixel_color_span_funcs_c();
128 init_blend_pixel_mask_span_funcs_c();
129 init_blend_color_span_funcs_c();
130 init_blend_mask_color_span_funcs_c();
132 init_blend_pixel_pt_funcs_c();
133 init_blend_pixel_color_pt_funcs_c();
134 init_blend_pixel_mask_pt_funcs_c();
135 init_blend_color_pt_funcs_c();
136 init_blend_mask_color_pt_funcs_c();
141 op_blend_shutdown(void)
146 blend_gfx_span_func_cpu(int s, int m, int c, int d)
148 RGBA_Gfx_Func func = NULL;
151 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
154 func = op_blend_span_funcs[s][m][c][d][cpu];
155 if (func) return func;
159 if (evas_common_cpu_has_feature(CPU_FEATURE_NEON))
162 func = op_blend_span_funcs[s][m][c][d][cpu];
163 if (func) return func;
168 func = op_blend_span_funcs[s][m][c][d][cpu];
169 if (func) return func;
175 op_blend_pixel_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels __UNUSED__)
177 int s = SP_AN, m = SM_N, c = SC_N, d = DP_AN;
179 if (src && src->cache_entry.flags.alpha)
182 if (src->cache_entry.flags.alpha_sparse)
185 if (dst && dst->cache_entry.flags.alpha)
187 return blend_gfx_span_func_cpu(s, m, c, d);
191 op_blend_color_span_get(DATA32 col, RGBA_Image *dst, int pixels __UNUSED__)
193 int s = SP_N, m = SM_N, c = SC_AN, d = DP_AN;
195 if ((col >> 24) < 255)
197 if (col == ((col >> 24) * 0x01010101))
199 if (col == 0xffffffff)
201 if (dst && dst->cache_entry.flags.alpha)
203 return blend_gfx_span_func_cpu(s, m, c, d);
207 op_blend_pixel_color_span_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels __UNUSED__)
209 int s = SP_AN, m = SM_N, c = SC_AN, d = DP_AN;
211 if (src && src->cache_entry.flags.alpha)
214 if (src->cache_entry.flags.alpha_sparse)
217 if ((col >> 24) < 255)
219 if (col == ((col >> 24) * 0x01010101))
221 if (col == 0xffffffff)
223 if (dst && dst->cache_entry.flags.alpha)
225 return blend_gfx_span_func_cpu(s, m, c, d);
229 op_blend_mask_color_span_get(DATA32 col, RGBA_Image *dst, int pixels __UNUSED__)
231 int s = SP_N, m = SM_AS, c = SC_AN, d = DP_AN;
233 if ((col >> 24) < 255)
235 if (col == ((col >> 24) * 0x01010101))
237 if (col == 0xffffffff)
239 if (dst && dst->cache_entry.flags.alpha)
241 return blend_gfx_span_func_cpu(s, m, c, d);
245 op_blend_pixel_mask_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels __UNUSED__)
247 int s = SP_AN, m = SM_AS, c = SC_N, d = DP_AN;
249 if (src && src->cache_entry.flags.alpha)
252 if (src->cache_entry.flags.alpha_sparse)
255 if (dst && dst->cache_entry.flags.alpha)
257 return blend_gfx_span_func_cpu(s, m, c, d);
261 static RGBA_Gfx_Pt_Func
262 blend_gfx_pt_func_cpu(int s, int m, int c, int d)
264 RGBA_Gfx_Pt_Func func = NULL;
267 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
270 func = op_blend_pt_funcs[s][m][c][d][cpu];
271 if (func) return func;
275 if (evas_common_cpu_has_feature(CPU_FEATURE_NEON))
278 func = op_blend_pt_funcs[s][m][c][d][cpu];
279 if (func) return func;
284 func = op_blend_pt_funcs[s][m][c][d][cpu];
285 if (func) return func;
290 static RGBA_Gfx_Pt_Func
291 op_blend_pixel_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst)
293 int s = SP_AN, m = SM_N, c = SC_N, d = DP_AN;
297 if (dst && dst->cache_entry.flags.alpha)
299 return blend_gfx_pt_func_cpu(s, m, c, d);
302 static RGBA_Gfx_Pt_Func
303 op_blend_color_pt_get(DATA32 col, RGBA_Image *dst)
305 int s = SP_N, m = SM_N, c = SC_AN, d = DP_AN;
307 if ((col >> 24) < 255)
309 if (col == ((col >> 24) * 0x01010101))
311 if (col == 0xffffffff)
313 if (dst && dst->cache_entry.flags.alpha)
315 return blend_gfx_pt_func_cpu(s, m, c, d);
318 static RGBA_Gfx_Pt_Func
319 op_blend_pixel_color_pt_get(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst)
321 int s = SP_AN, m = SM_N, c = SC_AN, d = DP_AN;
325 if ((col >> 24) < 255)
327 if (col == ((col >> 24) * 0x01010101))
329 if (col == 0xffffffff)
331 if (dst && dst->cache_entry.flags.alpha)
333 return blend_gfx_pt_func_cpu(s, m, c, d);
336 static RGBA_Gfx_Pt_Func
337 op_blend_mask_color_pt_get(DATA32 col, RGBA_Image *dst)
339 int s = SP_N, m = SM_AS, c = SC_AN, d = DP_AN;
341 if ((col >> 24) < 255)
343 if (col == ((col >> 24) * 0x01010101))
345 if (col == 0xffffffff)
347 if (dst && dst->cache_entry.flags.alpha)
349 return blend_gfx_pt_func_cpu(s, m, c, d);
352 static RGBA_Gfx_Pt_Func
353 op_blend_pixel_mask_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst)
355 int s = SP_AN, m = SM_AS, c = SC_N, d = DP_AN;
359 if (dst && dst->cache_entry.flags.alpha)
361 return blend_gfx_pt_func_cpu(s, m, c, d);
366 op_blend_rel_init(void)
368 memset(op_blend_rel_span_funcs, 0, sizeof(op_blend_rel_span_funcs));
369 memset(op_blend_rel_pt_funcs, 0, sizeof(op_blend_rel_pt_funcs));
371 init_blend_rel_pixel_span_funcs_mmx();
372 init_blend_rel_pixel_color_span_funcs_mmx();
373 init_blend_rel_pixel_mask_span_funcs_mmx();
374 init_blend_rel_color_span_funcs_mmx();
375 init_blend_rel_mask_color_span_funcs_mmx();
377 init_blend_rel_pixel_pt_funcs_mmx();
378 init_blend_rel_pixel_color_pt_funcs_mmx();
379 init_blend_rel_pixel_mask_pt_funcs_mmx();
380 init_blend_rel_color_pt_funcs_mmx();
381 init_blend_rel_mask_color_pt_funcs_mmx();
384 init_blend_rel_pixel_span_funcs_neon();
385 init_blend_rel_pixel_color_span_funcs_neon();
386 init_blend_rel_pixel_mask_span_funcs_neon();
387 init_blend_rel_color_span_funcs_neon();
388 init_blend_rel_mask_color_span_funcs_neon();
390 init_blend_rel_pixel_pt_funcs_neon();
391 init_blend_rel_pixel_color_pt_funcs_neon();
392 init_blend_rel_pixel_mask_pt_funcs_neon();
393 init_blend_rel_color_pt_funcs_neon();
394 init_blend_rel_mask_color_pt_funcs_neon();
397 init_blend_rel_pixel_span_funcs_c();
398 init_blend_rel_pixel_color_span_funcs_c();
399 init_blend_rel_pixel_mask_span_funcs_c();
400 init_blend_rel_color_span_funcs_c();
401 init_blend_rel_mask_color_span_funcs_c();
403 init_blend_rel_pixel_pt_funcs_c();
404 init_blend_rel_pixel_color_pt_funcs_c();
405 init_blend_rel_pixel_mask_pt_funcs_c();
406 init_blend_rel_color_pt_funcs_c();
407 init_blend_rel_mask_color_pt_funcs_c();
412 op_blend_rel_shutdown(void)
417 blend_rel_gfx_span_func_cpu(int s, int m, int c, int d)
419 RGBA_Gfx_Func func = NULL;
422 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
425 func = op_blend_rel_span_funcs[s][m][c][d][cpu];
426 if (func) return func;
430 if (evas_common_cpu_has_feature(CPU_FEATURE_NEON))
433 func = op_blend_rel_span_funcs[s][m][c][d][cpu];
434 if (func) return func;
439 func = op_blend_rel_span_funcs[s][m][c][d][cpu];
440 if (func) return func;
446 op_blend_rel_pixel_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels __UNUSED__)
448 int s = SP_AN, m = SM_N, c = SC_N, d = DP_AN;
450 if (src && src->cache_entry.flags.alpha)
453 if (src->cache_entry.flags.alpha_sparse)
456 if (dst && dst->cache_entry.flags.alpha)
458 return blend_rel_gfx_span_func_cpu(s, m, c, d);
462 op_blend_rel_color_span_get(DATA32 col, RGBA_Image *dst, int pixels __UNUSED__)
464 int s = SP_N, m = SM_N, c = SC_AN, d = DP_AN;
466 if ((col >> 24) < 255)
468 if (col == ((col >> 24) * 0x01010101))
470 if (col == 0xffffffff)
472 if (dst && dst->cache_entry.flags.alpha)
474 return blend_rel_gfx_span_func_cpu(s, m, c, d);
478 op_blend_rel_pixel_color_span_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels __UNUSED__)
480 int s = SP_AN, m = SM_N, c = SC_AN, d = DP_AN;
482 if (src && src->cache_entry.flags.alpha)
484 if ((col >> 24) < 255)
486 if (col == ((col >> 24) * 0x01010101))
488 if (col == 0xffffffff)
490 if (dst && dst->cache_entry.flags.alpha)
492 return blend_rel_gfx_span_func_cpu(s, m, c, d);
496 op_blend_rel_mask_color_span_get(DATA32 col, RGBA_Image *dst, int pixels __UNUSED__)
498 int s = SP_N, m = SM_AS, c = SC_AN, d = DP_AN;
500 if ((col >> 24) < 255)
502 if (col == ((col >> 24) * 0x01010101))
504 if (col == 0xffffffff)
506 if (dst && dst->cache_entry.flags.alpha)
508 return blend_rel_gfx_span_func_cpu(s, m, c, d);
512 op_blend_rel_pixel_mask_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels __UNUSED__)
514 int s = SP_AN, m = SM_AS, c = SC_N, d = DP_AN;
516 if (src && src->cache_entry.flags.alpha)
519 if (src->cache_entry.flags.alpha_sparse)
522 if (dst && dst->cache_entry.flags.alpha)
524 return blend_rel_gfx_span_func_cpu(s, m, c, d);
527 static RGBA_Gfx_Pt_Func
528 blend_rel_gfx_pt_func_cpu(int s, int m, int c, int d)
530 RGBA_Gfx_Pt_Func func = NULL;
533 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
536 func = op_blend_rel_pt_funcs[s][m][c][d][cpu];
537 if (func) return func;
541 if (evas_common_cpu_has_feature(CPU_FEATURE_NEON))
544 func = op_blend_rel_pt_funcs[s][m][c][d][cpu];
545 if (func) return func;
550 func = op_blend_rel_pt_funcs[s][m][c][d][cpu];
551 if (func) return func;
556 static RGBA_Gfx_Pt_Func
557 op_blend_rel_pixel_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst)
559 int s = SP_AN, m = SM_N, c = SC_N, d = DP_AN;
563 if (dst && dst->cache_entry.flags.alpha)
565 return blend_rel_gfx_pt_func_cpu(s, m, c, d);
568 static RGBA_Gfx_Pt_Func
569 op_blend_rel_color_pt_get(DATA32 col, RGBA_Image *dst)
571 int s = SP_N, m = SM_N, c = SC_AN, d = DP_AN;
573 if ((col >> 24) < 255)
575 if (col == ((col >> 24) * 0x01010101))
577 if (col == 0xffffffff)
579 if (dst && dst->cache_entry.flags.alpha)
581 return blend_rel_gfx_pt_func_cpu(s, m, c, d);
584 static RGBA_Gfx_Pt_Func
585 op_blend_rel_pixel_color_pt_get(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst)
587 int s = SP_AN, m = SM_N, c = SC_AN, d = DP_AN;
591 if ((col >> 24) < 255)
593 if (col == ((col >> 24) * 0x01010101))
595 if (col == 0xffffffff)
597 if (dst && dst->cache_entry.flags.alpha)
599 return blend_rel_gfx_pt_func_cpu(s, m, c, d);
602 static RGBA_Gfx_Pt_Func
603 op_blend_rel_mask_color_pt_get(DATA32 col, RGBA_Image *dst)
605 int s = SP_N, m = SM_AS, c = SC_AN, d = DP_AN;
607 if ((col >> 24) < 255)
609 if (col == ((col >> 24) * 0x01010101))
611 if (col == 0xffffffff)
613 if (dst && dst->cache_entry.flags.alpha)
615 return blend_rel_gfx_pt_func_cpu(s, m, c, d);
618 static RGBA_Gfx_Pt_Func
619 op_blend_rel_pixel_mask_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst)
621 int s = SP_AN, m = SM_AS, c = SC_N, d = DP_AN;
625 if (dst && dst->cache_entry.flags.alpha)
627 return blend_rel_gfx_pt_func_cpu(s, m, c, d);