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"
90 memset(op_blend_span_funcs, 0, sizeof(op_blend_span_funcs));
91 memset(op_blend_pt_funcs, 0, sizeof(op_blend_pt_funcs));
93 init_blend_pixel_span_funcs_mmx();
94 init_blend_pixel_color_span_funcs_mmx();
95 init_blend_pixel_mask_span_funcs_mmx();
96 init_blend_color_span_funcs_mmx();
97 init_blend_mask_color_span_funcs_mmx();
99 init_blend_pixel_pt_funcs_mmx();
100 init_blend_pixel_color_pt_funcs_mmx();
101 init_blend_pixel_mask_pt_funcs_mmx();
102 init_blend_color_pt_funcs_mmx();
103 init_blend_mask_color_pt_funcs_mmx();
106 init_blend_pixel_span_funcs_c();
107 init_blend_pixel_color_span_funcs_c();
108 init_blend_pixel_mask_span_funcs_c();
109 init_blend_color_span_funcs_c();
110 init_blend_mask_color_span_funcs_c();
112 init_blend_pixel_pt_funcs_c();
113 init_blend_pixel_color_pt_funcs_c();
114 init_blend_pixel_mask_pt_funcs_c();
115 init_blend_color_pt_funcs_c();
116 init_blend_mask_color_pt_funcs_c();
121 op_blend_shutdown(void)
126 blend_gfx_span_func_cpu(int s, int m, int c, int d)
128 RGBA_Gfx_Func func = NULL;
131 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
134 func = op_blend_span_funcs[s][m][c][d][cpu];
135 if (func) return func;
140 func = op_blend_span_funcs[s][m][c][d][cpu];
141 if (func) return func;
147 op_blend_pixel_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels)
149 int s = SP_AN, m = SM_N, c = SC_N, d = DP_AN;
151 if (src && src->cache_entry.flags.alpha)
154 if (src->cache_entry.flags.alpha_sparse)
157 if (dst && dst->cache_entry.flags.alpha)
159 return blend_gfx_span_func_cpu(s, m, c, d);
163 op_blend_color_span_get(DATA32 col, RGBA_Image *dst, int pixels)
165 int s = SP_N, m = SM_N, c = SC_AN, d = DP_AN;
167 if ((col >> 24) < 255)
169 if (col == ((col >> 24) * 0x01010101))
171 if (col == 0xffffffff)
173 if (dst && dst->cache_entry.flags.alpha)
175 return blend_gfx_span_func_cpu(s, m, c, d);
179 op_blend_pixel_color_span_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels)
181 int s = SP_AN, m = SM_N, c = SC_AN, d = DP_AN;
183 if (src && src->cache_entry.flags.alpha)
186 if (src->cache_entry.flags.alpha_sparse)
189 if ((col >> 24) < 255)
191 if (col == ((col >> 24) * 0x01010101))
193 if (col == 0xffffffff)
195 if (dst && dst->cache_entry.flags.alpha)
197 return blend_gfx_span_func_cpu(s, m, c, d);
201 op_blend_mask_color_span_get(DATA32 col, RGBA_Image *dst, int pixels)
203 int s = SP_N, m = SM_AS, c = SC_AN, d = DP_AN;
205 if ((col >> 24) < 255)
207 if (col == ((col >> 24) * 0x01010101))
209 if (col == 0xffffffff)
211 if (dst && dst->cache_entry.flags.alpha)
213 return blend_gfx_span_func_cpu(s, m, c, d);
217 op_blend_pixel_mask_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels)
219 int s = SP_AN, m = SM_AS, c = SC_N, d = DP_AN;
221 if (src && src->cache_entry.flags.alpha)
224 if (src->cache_entry.flags.alpha_sparse)
227 if (dst && dst->cache_entry.flags.alpha)
229 return blend_gfx_span_func_cpu(s, m, c, d);
233 static RGBA_Gfx_Pt_Func
234 blend_gfx_pt_func_cpu(int s, int m, int c, int d)
236 RGBA_Gfx_Pt_Func func = NULL;
239 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
242 func = op_blend_pt_funcs[s][m][c][d][cpu];
243 if (func) return func;
248 func = op_blend_pt_funcs[s][m][c][d][cpu];
249 if (func) return func;
254 static RGBA_Gfx_Pt_Func
255 op_blend_pixel_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst)
257 int s = SP_AN, m = SM_N, c = SC_N, d = DP_AN;
261 if (dst && dst->cache_entry.flags.alpha)
263 return blend_gfx_pt_func_cpu(s, m, c, d);
266 static RGBA_Gfx_Pt_Func
267 op_blend_color_pt_get(DATA32 col, RGBA_Image *dst)
269 int s = SP_N, m = SM_N, c = SC_AN, d = DP_AN;
271 if ((col >> 24) < 255)
273 if (col == ((col >> 24) * 0x01010101))
275 if (col == 0xffffffff)
277 if (dst && dst->cache_entry.flags.alpha)
279 return blend_gfx_pt_func_cpu(s, m, c, d);
282 static RGBA_Gfx_Pt_Func
283 op_blend_pixel_color_pt_get(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst)
285 int s = SP_AN, m = SM_N, c = SC_AN, d = DP_AN;
289 if ((col >> 24) < 255)
291 if (col == ((col >> 24) * 0x01010101))
293 if (col == 0xffffffff)
295 if (dst && dst->cache_entry.flags.alpha)
297 return blend_gfx_pt_func_cpu(s, m, c, d);
300 static RGBA_Gfx_Pt_Func
301 op_blend_mask_color_pt_get(DATA32 col, RGBA_Image *dst)
303 int s = SP_N, m = SM_AS, c = SC_AN, d = DP_AN;
305 if ((col >> 24) < 255)
307 if (col == ((col >> 24) * 0x01010101))
309 if (col == 0xffffffff)
311 if (dst && dst->cache_entry.flags.alpha)
313 return blend_gfx_pt_func_cpu(s, m, c, d);
316 static RGBA_Gfx_Pt_Func
317 op_blend_pixel_mask_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst)
319 int s = SP_AN, m = SM_AS, c = SC_N, d = DP_AN;
323 if (dst && dst->cache_entry.flags.alpha)
325 return blend_gfx_pt_func_cpu(s, m, c, d);
330 op_blend_rel_init(void)
332 memset(op_blend_rel_span_funcs, 0, sizeof(op_blend_rel_span_funcs));
333 memset(op_blend_rel_pt_funcs, 0, sizeof(op_blend_rel_pt_funcs));
335 init_blend_rel_pixel_span_funcs_mmx();
336 init_blend_rel_pixel_color_span_funcs_mmx();
337 init_blend_rel_pixel_mask_span_funcs_mmx();
338 init_blend_rel_color_span_funcs_mmx();
339 init_blend_rel_mask_color_span_funcs_mmx();
341 init_blend_rel_pixel_pt_funcs_mmx();
342 init_blend_rel_pixel_color_pt_funcs_mmx();
343 init_blend_rel_pixel_mask_pt_funcs_mmx();
344 init_blend_rel_color_pt_funcs_mmx();
345 init_blend_rel_mask_color_pt_funcs_mmx();
348 init_blend_rel_pixel_span_funcs_c();
349 init_blend_rel_pixel_color_span_funcs_c();
350 init_blend_rel_pixel_mask_span_funcs_c();
351 init_blend_rel_color_span_funcs_c();
352 init_blend_rel_mask_color_span_funcs_c();
354 init_blend_rel_pixel_pt_funcs_c();
355 init_blend_rel_pixel_color_pt_funcs_c();
356 init_blend_rel_pixel_mask_pt_funcs_c();
357 init_blend_rel_color_pt_funcs_c();
358 init_blend_rel_mask_color_pt_funcs_c();
363 op_blend_rel_shutdown(void)
368 blend_rel_gfx_span_func_cpu(int s, int m, int c, int d)
370 RGBA_Gfx_Func func = NULL;
373 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
376 func = op_blend_rel_span_funcs[s][m][c][d][cpu];
377 if (func) return func;
382 func = op_blend_rel_span_funcs[s][m][c][d][cpu];
383 if (func) return func;
389 op_blend_rel_pixel_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels)
391 int s = SP_AN, m = SM_N, c = SC_N, d = DP_AN;
393 if (src && src->cache_entry.flags.alpha)
396 if (src->cache_entry.flags.alpha_sparse)
399 if (dst && dst->cache_entry.flags.alpha)
401 return blend_rel_gfx_span_func_cpu(s, m, c, d);
405 op_blend_rel_color_span_get(DATA32 col, RGBA_Image *dst, int pixels)
407 int s = SP_N, m = SM_N, c = SC_AN, d = DP_AN;
409 if ((col >> 24) < 255)
411 if (col == ((col >> 24) * 0x01010101))
413 if (col == 0xffffffff)
415 if (dst && dst->cache_entry.flags.alpha)
417 return blend_rel_gfx_span_func_cpu(s, m, c, d);
421 op_blend_rel_pixel_color_span_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels)
423 int s = SP_AN, m = SM_N, c = SC_AN, d = DP_AN;
425 if (src && src->cache_entry.flags.alpha)
427 if ((col >> 24) < 255)
429 if (col == ((col >> 24) * 0x01010101))
431 if (col == 0xffffffff)
433 if (dst && dst->cache_entry.flags.alpha)
435 return blend_rel_gfx_span_func_cpu(s, m, c, d);
439 op_blend_rel_mask_color_span_get(DATA32 col, RGBA_Image *dst, int pixels)
441 int s = SP_N, m = SM_AS, c = SC_AN, d = DP_AN;
443 if ((col >> 24) < 255)
445 if (col == ((col >> 24) * 0x01010101))
447 if (col == 0xffffffff)
449 if (dst && dst->cache_entry.flags.alpha)
451 return blend_rel_gfx_span_func_cpu(s, m, c, d);
455 op_blend_rel_pixel_mask_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels)
457 int s = SP_AN, m = SM_AS, c = SC_N, d = DP_AN;
459 if (src && src->cache_entry.flags.alpha)
462 if (src->cache_entry.flags.alpha_sparse)
465 if (dst && dst->cache_entry.flags.alpha)
467 return blend_rel_gfx_span_func_cpu(s, m, c, d);
470 static RGBA_Gfx_Pt_Func
471 blend_rel_gfx_pt_func_cpu(int s, int m, int c, int d)
473 RGBA_Gfx_Pt_Func func = NULL;
476 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
479 func = op_blend_rel_pt_funcs[s][m][c][d][cpu];
480 if (func) return func;
485 func = op_blend_rel_pt_funcs[s][m][c][d][cpu];
486 if (func) return func;
491 static RGBA_Gfx_Pt_Func
492 op_blend_rel_pixel_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst)
494 int s = SP_AN, m = SM_N, c = SC_N, d = DP_AN;
498 if (dst && dst->cache_entry.flags.alpha)
500 return blend_rel_gfx_pt_func_cpu(s, m, c, d);
503 static RGBA_Gfx_Pt_Func
504 op_blend_rel_color_pt_get(DATA32 col, RGBA_Image *dst)
506 int s = SP_N, m = SM_N, c = SC_AN, d = DP_AN;
508 if ((col >> 24) < 255)
510 if (col == ((col >> 24) * 0x01010101))
512 if (col == 0xffffffff)
514 if (dst && dst->cache_entry.flags.alpha)
516 return blend_rel_gfx_pt_func_cpu(s, m, c, d);
519 static RGBA_Gfx_Pt_Func
520 op_blend_rel_pixel_color_pt_get(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst)
522 int s = SP_AN, m = SM_N, c = SC_AN, d = DP_AN;
526 if ((col >> 24) < 255)
528 if (col == ((col >> 24) * 0x01010101))
530 if (col == 0xffffffff)
532 if (dst && dst->cache_entry.flags.alpha)
534 return blend_rel_gfx_pt_func_cpu(s, m, c, d);
537 static RGBA_Gfx_Pt_Func
538 op_blend_rel_mask_color_pt_get(DATA32 col, RGBA_Image *dst)
540 int s = SP_N, m = SM_AS, c = SC_AN, d = DP_AN;
542 if ((col >> 24) < 255)
544 if (col == ((col >> 24) * 0x01010101))
546 if (col == 0xffffffff)
548 if (dst && dst->cache_entry.flags.alpha)
550 return blend_rel_gfx_pt_func_cpu(s, m, c, d);
553 static RGBA_Gfx_Pt_Func
554 op_blend_rel_pixel_mask_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst)
556 int s = SP_AN, m = SM_AS, c = SC_N, d = DP_AN;
560 if (dst && dst->cache_entry.flags.alpha)
562 return blend_rel_gfx_pt_func_cpu(s, m, c, d);