1 #include "evas_common.h"
3 static RGBA_Gfx_Func op_sub_span_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
4 static RGBA_Gfx_Pt_Func op_sub_pt_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
6 static void op_sub_init(void);
7 static void op_sub_shutdown(void);
9 static RGBA_Gfx_Func op_sub_pixel_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels);
10 static RGBA_Gfx_Func op_sub_color_span_get(DATA32 col, RGBA_Image *dst, int pixels);
11 static RGBA_Gfx_Func op_sub_pixel_color_span_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels);
12 static RGBA_Gfx_Func op_sub_mask_color_span_get(DATA32 col, RGBA_Image *dst, int pixels);
13 static RGBA_Gfx_Func op_sub_pixel_mask_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels);
15 static RGBA_Gfx_Pt_Func op_sub_pixel_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst);
16 static RGBA_Gfx_Pt_Func op_sub_color_pt_get(DATA32 col, RGBA_Image *dst);
17 static RGBA_Gfx_Pt_Func op_sub_pixel_color_pt_get(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst);
18 static RGBA_Gfx_Pt_Func op_sub_mask_color_pt_get(DATA32 col, RGBA_Image *dst);
19 static RGBA_Gfx_Pt_Func op_sub_pixel_mask_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst);
21 static RGBA_Gfx_Compositor _composite_sub = { "sub",
22 op_sub_init, op_sub_shutdown,
23 op_sub_pixel_span_get, op_sub_color_span_get,
24 op_sub_pixel_color_span_get, op_sub_mask_color_span_get,
25 op_sub_pixel_mask_span_get,
26 op_sub_pixel_pt_get, op_sub_color_pt_get,
27 op_sub_pixel_color_pt_get, op_sub_mask_color_pt_get,
28 op_sub_pixel_mask_pt_get
32 evas_common_gfx_compositor_sub_get(void)
34 return &(_composite_sub);
37 static RGBA_Gfx_Func op_sub_rel_span_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
38 static RGBA_Gfx_Pt_Func op_sub_rel_pt_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
40 static void op_sub_rel_init(void);
41 static void op_sub_rel_shutdown(void);
43 static RGBA_Gfx_Func op_sub_rel_pixel_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels);
44 static RGBA_Gfx_Func op_sub_rel_color_span_get(DATA32 col, RGBA_Image *dst, int pixels);
45 static RGBA_Gfx_Func op_sub_rel_pixel_color_span_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels);
46 static RGBA_Gfx_Func op_sub_rel_mask_color_span_get(DATA32 col, RGBA_Image *dst, int pixels);
47 static RGBA_Gfx_Func op_sub_rel_pixel_mask_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels);
49 static RGBA_Gfx_Pt_Func op_sub_rel_pixel_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst);
50 static RGBA_Gfx_Pt_Func op_sub_rel_color_pt_get(DATA32 col, RGBA_Image *dst);
51 static RGBA_Gfx_Pt_Func op_sub_rel_pixel_color_pt_get(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst);
52 static RGBA_Gfx_Pt_Func op_sub_rel_mask_color_pt_get(DATA32 col, RGBA_Image *dst);
53 static RGBA_Gfx_Pt_Func op_sub_rel_pixel_mask_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst);
55 static RGBA_Gfx_Compositor _composite_sub_rel = { "sub_rel",
56 op_sub_rel_init, op_sub_rel_shutdown,
57 op_sub_rel_pixel_span_get, op_sub_rel_color_span_get,
58 op_sub_rel_pixel_color_span_get, op_sub_rel_mask_color_span_get,
59 op_sub_rel_pixel_mask_span_get,
60 op_sub_rel_pixel_pt_get, op_sub_rel_color_pt_get,
61 op_sub_rel_pixel_color_pt_get, op_sub_rel_mask_color_pt_get,
62 op_sub_rel_pixel_mask_pt_get
66 evas_common_gfx_compositor_sub_rel_get(void)
68 return &(_composite_sub_rel);
72 # include "./evas_op_sub/op_sub_pixel_.c"
73 # include "./evas_op_sub/op_sub_color_.c"
74 # include "./evas_op_sub/op_sub_pixel_color_.c"
75 # include "./evas_op_sub/op_sub_pixel_mask_.c"
76 # include "./evas_op_sub/op_sub_mask_color_.c"
77 //# include "./evas_op_sub/op_sub_pixel_mask_color_.c"
79 # include "./evas_op_sub/op_sub_pixel_i386.c"
80 # include "./evas_op_sub/op_sub_color_i386.c"
81 # include "./evas_op_sub/op_sub_pixel_color_i386.c"
82 # include "./evas_op_sub/op_sub_pixel_mask_i386.c"
83 # include "./evas_op_sub/op_sub_mask_color_i386.c"
84 //# include "./evas_op_sub/op_sub_pixel_mask_color_i386.c"
89 memset(op_sub_span_funcs, 0, sizeof(op_sub_span_funcs));
90 memset(op_sub_pt_funcs, 0, sizeof(op_sub_pt_funcs));
92 init_sub_pixel_span_funcs_mmx();
93 init_sub_pixel_color_span_funcs_mmx();
94 init_sub_pixel_mask_span_funcs_mmx();
95 init_sub_color_span_funcs_mmx();
96 init_sub_mask_color_span_funcs_mmx();
98 init_sub_pixel_pt_funcs_mmx();
99 init_sub_pixel_color_pt_funcs_mmx();
100 init_sub_pixel_mask_pt_funcs_mmx();
101 init_sub_color_pt_funcs_mmx();
102 init_sub_mask_color_pt_funcs_mmx();
105 init_sub_pixel_span_funcs_c();
106 init_sub_pixel_color_span_funcs_c();
107 init_sub_rel_pixel_mask_span_funcs_c();
108 init_sub_color_span_funcs_c();
109 init_sub_mask_color_span_funcs_c();
111 init_sub_pixel_pt_funcs_c();
112 init_sub_pixel_color_pt_funcs_c();
113 init_sub_rel_pixel_mask_pt_funcs_c();
114 init_sub_color_pt_funcs_c();
115 init_sub_mask_color_pt_funcs_c();
120 op_sub_shutdown(void)
125 sub_gfx_span_func_cpu(int s, int m, int c, int d)
127 RGBA_Gfx_Func func = NULL;
130 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
133 func = op_sub_span_funcs[s][m][c][d][cpu];
134 if (func) return func;
139 func = op_sub_span_funcs[s][m][c][d][cpu];
140 if (func) return func;
146 op_sub_pixel_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels)
148 int s = SP_AN, m = SM_N, c = SC_N, d = DP_AN;
150 if (src && src->cache_entry.flags.alpha)
152 if (dst && dst->cache_entry.flags.alpha)
154 return sub_gfx_span_func_cpu(s, m, c, d);
158 op_sub_color_span_get(DATA32 col, RGBA_Image *dst, int pixels)
160 int s = SP_N, m = SM_N, c = SC_AN, d = DP_AN;
162 if ((col >> 24) < 255)
164 if (col == (col | 0x00ffffff))
166 if (col == 0xffffffff)
168 if (dst && dst->cache_entry.flags.alpha)
170 return sub_gfx_span_func_cpu(s, m, c, d);
174 op_sub_pixel_color_span_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels)
176 int s = SP_AN, m = SM_N, c = SC_AN, d = DP_AN;
178 if (src && src->cache_entry.flags.alpha)
180 if ((col >> 24) < 255)
182 if (col == (col | 0x00ffffff))
184 if (col == 0xffffffff)
186 if (dst && dst->cache_entry.flags.alpha)
188 return sub_gfx_span_func_cpu(s, m, c, d);
192 op_sub_mask_color_span_get(DATA32 col, RGBA_Image *dst, int pixels)
194 int s = SP_N, m = SM_AS, c = SC_AN, d = DP_AN;
196 if ((col >> 24) < 255)
198 if (col == (col | 0x00ffffff))
200 if (col == 0xffffffff)
202 if (dst && dst->cache_entry.flags.alpha)
204 return sub_gfx_span_func_cpu(s, m, c, d);
208 op_sub_pixel_mask_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels)
210 int s = SP_AN, m = SM_AS, c = SC_N, d = DP_AN;
212 if (src && src->cache_entry.flags.alpha)
214 if (dst && dst->cache_entry.flags.alpha)
216 return sub_gfx_span_func_cpu(s, m, c, d);
219 static RGBA_Gfx_Pt_Func
220 sub_gfx_pt_func_cpu(int s, int m, int c, int d)
222 RGBA_Gfx_Pt_Func func = NULL;
225 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
228 func = op_sub_pt_funcs[s][m][c][d][cpu];
229 if (func) return func;
234 func = op_sub_pt_funcs[s][m][c][d][cpu];
235 if (func) return func;
240 static RGBA_Gfx_Pt_Func
241 op_sub_pixel_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst)
243 int s = SP_AN, m = SM_N, c = SC_N, d = DP_AN;
247 if (dst && dst->cache_entry.flags.alpha)
249 return sub_gfx_pt_func_cpu(s, m, c, d);
252 static RGBA_Gfx_Pt_Func
253 op_sub_color_pt_get(DATA32 col, RGBA_Image *dst)
255 int s = SP_N, m = SM_N, c = SC_AN, d = DP_AN;
257 if ((col >> 24) < 255)
259 if (col == (col | 0x00ffffff))
261 if (col == 0xffffffff)
263 if (dst && dst->cache_entry.flags.alpha)
265 return sub_gfx_pt_func_cpu(s, m, c, d);
268 static RGBA_Gfx_Pt_Func
269 op_sub_pixel_color_pt_get(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst)
271 int s = SP_AN, m = SM_N, c = SC_AN, d = DP_AN;
275 if ((col >> 24) < 255)
277 if (col == (col | 0x00ffffff))
279 if (col == 0xffffffff)
281 if (dst && dst->cache_entry.flags.alpha)
283 return sub_gfx_pt_func_cpu(s, m, c, d);
286 static RGBA_Gfx_Pt_Func
287 op_sub_mask_color_pt_get(DATA32 col, RGBA_Image *dst)
289 int s = SP_N, m = SM_AS, c = SC_AN, d = DP_AN;
291 if ((col >> 24) < 255)
293 if (col == (col | 0x00ffffff))
295 if (col == 0xffffffff)
297 if (dst && dst->cache_entry.flags.alpha)
299 return sub_gfx_pt_func_cpu(s, m, c, d);
302 static RGBA_Gfx_Pt_Func
303 op_sub_pixel_mask_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst)
305 int s = SP_AN, m = SM_AS, c = SC_N, d = DP_AN;
309 if (dst && dst->cache_entry.flags.alpha)
311 return sub_gfx_pt_func_cpu(s, m, c, d);
317 op_sub_rel_init(void)
319 memset(op_sub_rel_span_funcs, 0, sizeof(op_sub_rel_span_funcs));
320 memset(op_sub_rel_pt_funcs, 0, sizeof(op_sub_rel_pt_funcs));
322 init_sub_rel_pixel_span_funcs_mmx();
323 init_sub_rel_pixel_color_span_funcs_mmx();
324 init_sub_rel_pixel_mask_span_funcs_mmx();
325 init_sub_rel_color_span_funcs_mmx();
326 init_sub_rel_mask_color_span_funcs_mmx();
328 init_sub_rel_pixel_pt_funcs_mmx();
329 init_sub_rel_pixel_color_pt_funcs_mmx();
330 init_sub_rel_pixel_mask_pt_funcs_mmx();
331 init_sub_rel_color_pt_funcs_mmx();
332 init_sub_rel_mask_color_pt_funcs_mmx();
335 init_sub_rel_pixel_span_funcs_c();
336 init_sub_rel_pixel_color_span_funcs_c();
337 init_sub_rel_pixel_mask_span_funcs_c();
338 init_sub_rel_color_span_funcs_c();
339 init_sub_rel_mask_color_span_funcs_c();
341 init_sub_rel_pixel_pt_funcs_c();
342 init_sub_rel_pixel_color_pt_funcs_c();
343 init_sub_rel_pixel_mask_pt_funcs_c();
344 init_sub_rel_color_pt_funcs_c();
345 init_sub_rel_mask_color_pt_funcs_c();
350 op_sub_rel_shutdown(void)
355 sub_rel_gfx_span_func_cpu(int s, int m, int c, int d)
357 RGBA_Gfx_Func func = NULL;
360 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
363 func = op_sub_rel_span_funcs[s][m][c][d][cpu];
364 if (func) return func;
369 func = op_sub_rel_span_funcs[s][m][c][d][cpu];
370 if (func) return func;
376 op_sub_rel_pixel_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels)
378 int s = SP_AN, m = SM_N, c = SC_N, d = DP_AN;
380 if (src && src->cache_entry.flags.alpha)
382 if (dst && dst->cache_entry.flags.alpha)
384 return sub_rel_gfx_span_func_cpu(s, m, c, d);
388 op_sub_rel_color_span_get(DATA32 col, RGBA_Image *dst, int pixels)
390 int s = SP_N, m = SM_N, c = SC_AN, d = DP_AN;
392 if ((col >> 24) < 255)
394 if (col == (col | 0x00ffffff))
396 if (col == 0xffffffff)
398 if (dst && dst->cache_entry.flags.alpha)
400 return sub_rel_gfx_span_func_cpu(s, m, c, d);
404 op_sub_rel_pixel_color_span_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels)
406 int s = SP_AN, m = SM_N, c = SC_AN, d = DP_AN;
408 if (src && src->cache_entry.flags.alpha)
410 if ((col >> 24) < 255)
412 if (col == (col | 0x00ffffff))
414 if (col == 0xffffffff)
416 if (dst && dst->cache_entry.flags.alpha)
418 return sub_rel_gfx_span_func_cpu(s, m, c, d);
422 op_sub_rel_mask_color_span_get(DATA32 col, RGBA_Image *dst, int pixels)
424 int s = SP_N, m = SM_AS, c = SC_AN, d = DP_AN;
426 if ((col >> 24) < 255)
428 if (col == (col | 0x00ffffff))
430 if (col == 0xffffffff)
432 if (dst && dst->cache_entry.flags.alpha)
434 return sub_rel_gfx_span_func_cpu(s, m, c, d);
438 op_sub_rel_pixel_mask_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels)
440 int s = SP_AN, m = SM_AS, c = SC_N, d = DP_AN;
442 if (src && src->cache_entry.flags.alpha)
444 if (dst && dst->cache_entry.flags.alpha)
446 return sub_rel_gfx_span_func_cpu(s, m, c, d);
449 static RGBA_Gfx_Pt_Func
450 sub_rel_gfx_pt_func_cpu(int s, int m, int c, int d)
452 RGBA_Gfx_Pt_Func func = NULL;
455 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
458 func = op_sub_rel_pt_funcs[s][m][c][d][cpu];
459 if (func) return func;
464 func = op_sub_rel_pt_funcs[s][m][c][d][cpu];
465 if (func) return func;
470 static RGBA_Gfx_Pt_Func
471 op_sub_rel_pixel_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst)
473 int s = SP_AN, m = SM_N, c = SC_N, d = DP_AN;
477 if (dst && dst->cache_entry.flags.alpha)
479 return sub_rel_gfx_pt_func_cpu(s, m, c, d);
482 static RGBA_Gfx_Pt_Func
483 op_sub_rel_color_pt_get(DATA32 col, RGBA_Image *dst)
485 int s = SP_N, m = SM_N, c = SC_AN, d = DP_AN;
487 if ((col >> 24) < 255)
489 if (col == (col | 0x00ffffff))
491 if (col == 0xffffffff)
493 if (dst && dst->cache_entry.flags.alpha)
495 return sub_rel_gfx_pt_func_cpu(s, m, c, d);
498 static RGBA_Gfx_Pt_Func
499 op_sub_rel_pixel_color_pt_get(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst)
501 int s = SP_AN, m = SM_N, c = SC_AN, d = DP_AN;
505 if ((col >> 24) < 255)
507 if (col == (col | 0x00ffffff))
509 if (col == 0xffffffff)
511 if (dst && dst->cache_entry.flags.alpha)
513 return sub_rel_gfx_pt_func_cpu(s, m, c, d);
516 static RGBA_Gfx_Pt_Func
517 op_sub_rel_mask_color_pt_get(DATA32 col, RGBA_Image *dst)
519 int s = SP_N, m = SM_AS, c = SC_AN, d = DP_AN;
521 if ((col >> 24) < 255)
523 if (col == (col | 0x00ffffff))
525 if (col == 0xffffffff)
527 if (dst && dst->cache_entry.flags.alpha)
529 return sub_rel_gfx_pt_func_cpu(s, m, c, d);
532 static RGBA_Gfx_Pt_Func
533 op_sub_rel_pixel_mask_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst)
535 int s = SP_AN, m = SM_AS, c = SC_N, d = DP_AN;
539 if (dst && dst->cache_entry.flags.alpha)
541 return sub_rel_gfx_pt_func_cpu(s, m, c, d);