2 * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
5 #include "evas_common.h"
6 #include "evas_blend_private.h"
8 static RGBA_Gfx_Func op_copy_span_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
9 static RGBA_Gfx_Pt_Func op_copy_pt_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
11 static void op_copy_init(void);
12 static void op_copy_shutdown(void);
14 static RGBA_Gfx_Func op_copy_pixel_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels);
15 static RGBA_Gfx_Func op_copy_color_span_get(DATA32 col, RGBA_Image *dst, int pixels);
16 static RGBA_Gfx_Func op_copy_pixel_color_span_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels);
17 static RGBA_Gfx_Func op_copy_mask_color_span_get(DATA32 col, RGBA_Image *dst, int pixels);
18 static RGBA_Gfx_Func op_copy_pixel_mask_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels);
20 static RGBA_Gfx_Pt_Func op_copy_pixel_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst);
21 static RGBA_Gfx_Pt_Func op_copy_color_pt_get(DATA32 col, RGBA_Image *dst);
22 static RGBA_Gfx_Pt_Func op_copy_pixel_color_pt_get(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst);
23 static RGBA_Gfx_Pt_Func op_copy_mask_color_pt_get(DATA32 col, RGBA_Image *dst);
24 static RGBA_Gfx_Pt_Func op_copy_pixel_mask_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst);
26 static RGBA_Gfx_Compositor _composite_copy = { "copy",
27 op_copy_init, op_copy_shutdown,
28 op_copy_pixel_span_get, op_copy_color_span_get,
29 op_copy_pixel_color_span_get, op_copy_mask_color_span_get,
30 op_copy_pixel_mask_span_get,
31 op_copy_pixel_pt_get, op_copy_color_pt_get,
32 op_copy_pixel_color_pt_get, op_copy_mask_color_pt_get,
33 op_copy_pixel_mask_pt_get
37 evas_common_gfx_compositor_copy_get(void)
39 return &(_composite_copy);
43 static RGBA_Gfx_Func op_copy_rel_span_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
44 static RGBA_Gfx_Pt_Func op_copy_rel_pt_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
46 static void op_copy_rel_init(void);
47 static void op_copy_rel_shutdown(void);
49 static RGBA_Gfx_Func op_copy_rel_pixel_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels);
50 static RGBA_Gfx_Func op_copy_rel_color_span_get(DATA32 col, RGBA_Image *dst, int pixels);
51 static RGBA_Gfx_Func op_copy_rel_pixel_color_span_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels);
52 static RGBA_Gfx_Func op_copy_rel_mask_color_span_get(DATA32 col, RGBA_Image *dst, int pixels);
53 static RGBA_Gfx_Func op_copy_rel_pixel_mask_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels);
55 static RGBA_Gfx_Pt_Func op_copy_rel_pixel_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst);
56 static RGBA_Gfx_Pt_Func op_copy_rel_color_pt_get(DATA32 col, RGBA_Image *dst);
57 static RGBA_Gfx_Pt_Func op_copy_rel_pixel_color_pt_get(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst);
58 static RGBA_Gfx_Pt_Func op_copy_rel_mask_color_pt_get(DATA32 col, RGBA_Image *dst);
59 static RGBA_Gfx_Pt_Func op_copy_rel_pixel_mask_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst);
61 static RGBA_Gfx_Compositor _composite_copy_rel = { "copy_rel",
62 op_copy_rel_init, op_copy_rel_shutdown,
63 op_copy_rel_pixel_span_get, op_copy_rel_color_span_get,
64 op_copy_rel_pixel_color_span_get, op_copy_rel_mask_color_span_get,
65 op_copy_rel_pixel_mask_span_get,
66 op_copy_rel_pixel_pt_get, op_copy_color_pt_get,
67 op_copy_rel_pixel_color_pt_get, op_copy_rel_mask_color_pt_get,
68 op_copy_rel_pixel_mask_pt_get
72 evas_common_gfx_compositor_copy_rel_get(void)
74 return &(_composite_copy_rel);
78 # include "./evas_op_copy/op_copy_pixel_.c"
79 # include "./evas_op_copy/op_copy_color_.c"
80 # include "./evas_op_copy/op_copy_pixel_color_.c"
81 # include "./evas_op_copy/op_copy_pixel_mask_.c"
82 # include "./evas_op_copy/op_copy_mask_color_.c"
83 //# include "./evas_op_copy/op_copy_pixel_mask_color_.c"
85 # include "./evas_op_copy/op_copy_pixel_i386.c"
86 # include "./evas_op_copy/op_copy_color_i386.c"
87 # include "./evas_op_copy/op_copy_pixel_color_i386.c"
88 # include "./evas_op_copy/op_copy_pixel_mask_i386.c"
89 # include "./evas_op_copy/op_copy_mask_color_i386.c"
90 //# include "./evas_op_copy/op_copy_pixel_mask_color_i386.c"
96 memset(op_copy_span_funcs, 0, sizeof(op_copy_span_funcs));
97 memset(op_copy_pt_funcs, 0, sizeof(op_copy_pt_funcs));
99 init_copy_pixel_span_funcs_mmx();
100 init_copy_pixel_color_span_funcs_mmx();
101 init_copy_pixel_mask_span_funcs_mmx();
102 init_copy_color_span_funcs_mmx();
103 init_copy_mask_color_span_funcs_mmx();
105 init_copy_pixel_pt_funcs_mmx();
106 init_copy_pixel_color_pt_funcs_mmx();
107 init_copy_pixel_mask_pt_funcs_mmx();
108 init_copy_color_pt_funcs_mmx();
109 init_copy_mask_color_pt_funcs_mmx();
112 init_copy_pixel_span_funcs_c();
113 init_copy_pixel_color_span_funcs_c();
114 init_copy_pixel_mask_span_funcs_c();
115 init_copy_color_span_funcs_c();
116 init_copy_mask_color_span_funcs_c();
118 init_copy_pixel_pt_funcs_c();
119 init_copy_pixel_color_pt_funcs_c();
120 init_copy_pixel_mask_pt_funcs_c();
121 init_copy_color_pt_funcs_c();
122 init_copy_mask_color_pt_funcs_c();
127 op_copy_shutdown(void)
132 copy_gfx_span_func_cpu(int s, int m, int c, int d)
134 RGBA_Gfx_Func func = NULL;
137 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
140 func = op_copy_span_funcs[s][m][c][d][cpu];
141 if (func) return func;
146 func = op_copy_span_funcs[s][m][c][d][cpu];
147 if (func) return func;
153 op_copy_pixel_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels)
155 int s = SP_AN, m = SM_N, c = SC_N, d = DP_AN;
157 if (src && src->cache_entry.flags.alpha)
159 dst->cache_entry.flags.alpha = 1;
162 if (dst && dst->cache_entry.flags.alpha)
164 return copy_gfx_span_func_cpu(s, m, c, d);
168 op_copy_color_span_get(DATA32 col, RGBA_Image *dst, int pixels)
170 int s = SP_N, m = SM_N, c = SC_AN, d = DP_AN;
172 if ((col >> 24) < 255)
175 dst->cache_entry.flags.alpha = 1;
178 if (col == ((col >> 24) * 0x01010101))
180 if (col == 0xffffffff)
182 if (dst && dst->cache_entry.flags.alpha)
184 return copy_gfx_span_func_cpu(s, m, c, d);
188 op_copy_pixel_color_span_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels)
190 int s = SP_AN, m = SM_N, c = SC_AN, d = DP_AN;
192 if (src && src->cache_entry.flags.alpha)
195 dst->cache_entry.flags.alpha = 1;
198 if ((col >> 24) < 255)
201 dst->cache_entry.flags.alpha = 1;
204 if (col == ((col >> 24) * 0x01010101))
206 if (col == 0xffffffff)
208 if (dst && dst->cache_entry.flags.alpha)
210 return copy_gfx_span_func_cpu(s, m, c, d);
214 op_copy_mask_color_span_get(DATA32 col, RGBA_Image *dst, int pixels)
216 int s = SP_N, m = SM_AS, c = SC_AN, d = DP;
219 dst->cache_entry.flags.alpha = 1;
220 if ((col >> 24) < 255)
222 if (col == ((col >> 24) * 0x01010101))
224 if (col == 0xffffffff)
226 return copy_gfx_span_func_cpu(s, m, c, d);
230 op_copy_pixel_mask_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels)
232 int s = SP_AN, m = SM_AS, c = SC_N, d = DP;
235 dst->cache_entry.flags.alpha = 1;
236 if (src && src->cache_entry.flags.alpha)
238 return copy_gfx_span_func_cpu(s, m, c, d);
241 static RGBA_Gfx_Pt_Func
242 copy_gfx_pt_func_cpu(int s, int m, int c, int d)
244 RGBA_Gfx_Pt_Func func = NULL;
247 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
250 func = op_copy_pt_funcs[s][m][c][d][cpu];
251 if (func) return func;
256 func = op_copy_pt_funcs[s][m][c][d][cpu];
257 if (func) return func;
262 static RGBA_Gfx_Pt_Func
263 op_copy_pixel_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst)
265 int s = SP_AN, m = SM_N, c = SC_N, d = DP_AN;
269 dst->cache_entry.flags.alpha = 1;
272 if (dst && dst->cache_entry.flags.alpha)
274 return copy_gfx_pt_func_cpu(s, m, c, d);
277 static RGBA_Gfx_Pt_Func
278 op_copy_color_pt_get(DATA32 col, RGBA_Image *dst)
280 int s = SP_N, m = SM_N, c = SC_AN, d = DP_AN;
282 if ((col >> 24) < 255)
285 dst->cache_entry.flags.alpha = 1;
288 if (col == ((col >> 24) * 0x01010101))
290 if (col == 0xffffffff)
292 if (dst && dst->cache_entry.flags.alpha)
294 return copy_gfx_pt_func_cpu(s, m, c, d);
297 static RGBA_Gfx_Pt_Func
298 op_copy_pixel_color_pt_get(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst)
300 int s = SP_AN, m = SM_N, c = SC_AN, d = DP_AN;
305 dst->cache_entry.flags.alpha = 1;
308 if ((col >> 24) < 255)
311 dst->cache_entry.flags.alpha = 1;
314 if (col == ((col >> 24) * 0x01010101))
316 if (col == 0xffffffff)
318 if (dst && dst->cache_entry.flags.alpha)
320 return copy_gfx_pt_func_cpu(s, m, c, d);
323 static RGBA_Gfx_Pt_Func
324 op_copy_mask_color_pt_get(DATA32 col, RGBA_Image *dst)
326 int s = SP_N, m = SM_AS, c = SC_AN, d = DP;
329 dst->cache_entry.flags.alpha = 1;
330 if ((col >> 24) < 255)
332 if (col == ((col >> 24) * 0x01010101))
334 if (col == 0xffffffff)
336 return copy_gfx_pt_func_cpu(s, m, c, d);
339 static RGBA_Gfx_Pt_Func
340 op_copy_pixel_mask_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst)
342 int s = SP_AN, m = SM_AS, c = SC_N, d = DP;
345 dst->cache_entry.flags.alpha = 1;
348 return copy_gfx_pt_func_cpu(s, m, c, d);
353 op_copy_rel_init(void)
355 memset(op_copy_rel_span_funcs, 0, sizeof(op_copy_rel_span_funcs));
356 memset(op_copy_rel_pt_funcs, 0, sizeof(op_copy_rel_pt_funcs));
358 init_copy_rel_pixel_span_funcs_mmx();
359 init_copy_rel_pixel_color_span_funcs_mmx();
360 init_copy_rel_pixel_mask_span_funcs_mmx();
361 init_copy_rel_color_span_funcs_mmx();
362 init_copy_rel_mask_color_span_funcs_mmx();
364 init_copy_rel_pixel_pt_funcs_mmx();
365 init_copy_rel_pixel_color_pt_funcs_mmx();
366 init_copy_rel_pixel_mask_pt_funcs_mmx();
367 init_copy_rel_color_pt_funcs_mmx();
368 init_copy_rel_mask_color_pt_funcs_mmx();
371 init_copy_rel_pixel_span_funcs_c();
372 init_copy_rel_pixel_color_span_funcs_c();
373 init_copy_rel_pixel_mask_span_funcs_c();
374 init_copy_rel_color_span_funcs_c();
375 init_copy_rel_mask_color_span_funcs_c();
377 init_copy_rel_pixel_pt_funcs_c();
378 init_copy_rel_pixel_color_pt_funcs_c();
379 init_copy_rel_pixel_mask_pt_funcs_c();
380 init_copy_rel_color_pt_funcs_c();
381 init_copy_rel_mask_color_pt_funcs_c();
386 op_copy_rel_shutdown(void)
391 copy_rel_gfx_span_func_cpu(int s, int m, int c, int d)
393 RGBA_Gfx_Func func = NULL;
396 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
399 func = op_copy_rel_span_funcs[s][m][c][d][cpu];
400 if (func) return func;
405 func = op_copy_rel_span_funcs[s][m][c][d][cpu];
406 if (func) return func;
412 op_copy_rel_pixel_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels)
414 int s = SP_AN, m = SM_N, c = SC_N, d = DP_AN;
416 if (src && src->cache_entry.flags.alpha)
419 dst->cache_entry.flags.alpha = 1;
422 if (dst && dst->cache_entry.flags.alpha)
424 return copy_rel_gfx_span_func_cpu(s, m, c, d);
428 op_copy_rel_color_span_get(DATA32 col, RGBA_Image *dst, int pixels)
430 int s = SP_N, m = SM_N, c = SC_AN, d = DP_AN;
432 if ((col >> 24) < 255)
435 dst->cache_entry.flags.alpha = 1;
438 if (col == ((col >> 24) * 0x01010101))
440 if (col == 0xffffffff)
442 if (dst && dst->cache_entry.flags.alpha)
444 return copy_rel_gfx_span_func_cpu(s, m, c, d);
448 op_copy_rel_pixel_color_span_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels)
450 int s = SP_AN, m = SM_N, c = SC_AN, d = DP_AN;
452 if (src && src->cache_entry.flags.alpha)
455 dst->cache_entry.flags.alpha = 1;
458 if ((col >> 24) < 255)
461 dst->cache_entry.flags.alpha = 1;
464 if (col == ((col >> 24) * 0x01010101))
466 if (col == 0xffffffff)
468 if (dst && dst->cache_entry.flags.alpha)
470 return copy_rel_gfx_span_func_cpu(s, m, c, d);
474 op_copy_rel_mask_color_span_get(DATA32 col, RGBA_Image *dst, int pixels)
476 int s = SP_N, m = SM_AS, c = SC_AN, d = DP;
479 dst->cache_entry.flags.alpha = 1;
480 if ((col >> 24) < 255)
482 if (col == ((col >> 24) * 0x01010101))
484 if (col == 0xffffffff)
486 return copy_rel_gfx_span_func_cpu(s, m, c, d);
490 op_copy_rel_pixel_mask_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels)
492 int s = SP_AN, m = SM_AS, c = SC_N, d = DP;
495 dst->cache_entry.flags.alpha = 1;
496 if (src && src->cache_entry.flags.alpha)
498 return copy_rel_gfx_span_func_cpu(s, m, c, d);
501 static RGBA_Gfx_Pt_Func
502 copy_rel_gfx_pt_func_cpu(int s, int m, int c, int d)
504 RGBA_Gfx_Pt_Func func = NULL;
507 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
510 func = op_copy_rel_pt_funcs[s][m][c][d][cpu];
511 if (func) return func;
516 func = op_copy_rel_pt_funcs[s][m][c][d][cpu];
517 if (func) return func;
522 static RGBA_Gfx_Pt_Func
523 op_copy_rel_pixel_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst)
525 int s = SP_AN, m = SM_N, c = SC_N, d = DP_AN;
530 dst->cache_entry.flags.alpha = 1;
533 if (dst && dst->cache_entry.flags.alpha)
535 return copy_rel_gfx_pt_func_cpu(s, m, c, d);
538 static RGBA_Gfx_Pt_Func
539 op_copy_rel_color_pt_get(DATA32 col, RGBA_Image *dst)
541 int s = SP_N, m = SM_N, c = SC_AN, d = DP_AN;
543 if ((col >> 24) < 255)
546 dst->cache_entry.flags.alpha = 1;
549 if (col == ((col >> 24) * 0x01010101))
551 if (col == 0xffffffff)
553 if (dst && dst->cache_entry.flags.alpha)
555 return copy_rel_gfx_pt_func_cpu(s, m, c, d);
558 static RGBA_Gfx_Pt_Func
559 op_copy_rel_pixel_color_pt_get(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst)
561 int s = SP_AN, m = SM_N, c = SC_AN, d = DP_AN;
566 dst->cache_entry.flags.alpha = 1;
569 if ((col >> 24) < 255)
572 dst->cache_entry.flags.alpha = 1;
575 if (col == ((col >> 24) * 0x01010101))
577 if (col == 0xffffffff)
579 if (dst && dst->cache_entry.flags.alpha)
581 return copy_rel_gfx_pt_func_cpu(s, m, c, d);
584 static RGBA_Gfx_Pt_Func
585 op_copy_rel_mask_color_pt_get(DATA32 col, RGBA_Image *dst)
587 int s = SP_N, m = SM_AS, c = SC_AN, d = DP;
590 dst->cache_entry.flags.alpha = 1;
591 if ((col >> 24) < 255)
593 if (col == ((col >> 24) * 0x01010101))
595 if (col == 0xffffffff)
597 return copy_rel_gfx_pt_func_cpu(s, m, c, d);
600 static RGBA_Gfx_Pt_Func
601 op_copy_rel_pixel_mask_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst)
603 int s = SP_AN, m = SM_AS, c = SC_N, d = DP;
606 dst->cache_entry.flags.alpha = 1;
609 return copy_rel_gfx_pt_func_cpu(s, m, c, d);