1 #include "evas_common.h"
3 static RGBA_Gfx_Func op_mul_span_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
4 static RGBA_Gfx_Pt_Func op_mul_pt_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
6 static void op_mul_init(void);
7 static void op_mul_shutdown(void);
9 static RGBA_Gfx_Func op_mul_pixel_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels);
10 static RGBA_Gfx_Func op_mul_color_span_get(DATA32 col, RGBA_Image *dst, int pixels);
11 static RGBA_Gfx_Func op_mul_pixel_color_span_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels);
12 static RGBA_Gfx_Func op_mul_mask_color_span_get(DATA32 col, RGBA_Image *dst, int pixels);
13 static RGBA_Gfx_Func op_mul_pixel_mask_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels);
15 static RGBA_Gfx_Pt_Func op_mul_pixel_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst);
16 static RGBA_Gfx_Pt_Func op_mul_color_pt_get(DATA32 col, RGBA_Image *dst);
17 static RGBA_Gfx_Pt_Func op_mul_pixel_color_pt_get(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst);
18 static RGBA_Gfx_Pt_Func op_mul_mask_color_pt_get(DATA32 col, RGBA_Image *dst);
19 static RGBA_Gfx_Pt_Func op_mul_pixel_mask_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst);
21 static RGBA_Gfx_Compositor _composite_mul = { "mul",
22 op_mul_init, op_mul_shutdown,
23 op_mul_pixel_span_get, op_mul_color_span_get,
24 op_mul_pixel_color_span_get, op_mul_mask_color_span_get,
25 op_mul_pixel_mask_span_get,
26 op_mul_pixel_pt_get, op_mul_color_pt_get,
27 op_mul_pixel_color_pt_get, op_mul_mask_color_pt_get,
28 op_mul_pixel_mask_pt_get
32 evas_common_gfx_compositor_mul_get(void)
34 return &(_composite_mul);
38 # include "./evas_op_mul/op_mul_pixel_.c"
39 # include "./evas_op_mul/op_mul_color_.c"
40 # include "./evas_op_mul/op_mul_pixel_color_.c"
41 # include "./evas_op_mul/op_mul_pixel_mask_.c"
42 # include "./evas_op_mul/op_mul_mask_color_.c"
43 //# include "./evas_op_mul/op_mul_pixel_mask_color_.c"
45 # include "./evas_op_mul/op_mul_pixel_i386.c"
46 # include "./evas_op_mul/op_mul_color_i386.c"
47 # include "./evas_op_mul/op_mul_pixel_color_i386.c"
48 # include "./evas_op_mul/op_mul_pixel_mask_i386.c"
49 # include "./evas_op_mul/op_mul_mask_color_i386.c"
50 // # include "./evas_op_mul/op_mul_pixel_mask_color_i386.c"
55 memset(op_mul_span_funcs, 0, sizeof(op_mul_span_funcs));
56 memset(op_mul_pt_funcs, 0, sizeof(op_mul_pt_funcs));
58 init_mul_pixel_span_funcs_mmx();
59 init_mul_pixel_color_span_funcs_mmx();
60 init_mul_pixel_mask_span_funcs_mmx();
61 init_mul_color_span_funcs_mmx();
62 init_mul_mask_color_span_funcs_mmx();
64 init_mul_pixel_pt_funcs_mmx();
65 init_mul_pixel_color_pt_funcs_mmx();
66 init_mul_pixel_mask_pt_funcs_mmx();
67 init_mul_color_pt_funcs_mmx();
68 init_mul_mask_color_pt_funcs_mmx();
71 init_mul_pixel_span_funcs_c();
72 init_mul_pixel_color_span_funcs_c();
73 init_mul_pixel_mask_span_funcs_c();
74 init_mul_color_span_funcs_c();
75 init_mul_mask_color_span_funcs_c();
77 init_mul_pixel_pt_funcs_c();
78 init_mul_pixel_color_pt_funcs_c();
79 init_mul_pixel_mask_pt_funcs_c();
80 init_mul_color_pt_funcs_c();
81 init_mul_mask_color_pt_funcs_c();
91 mul_gfx_span_func_cpu(int s, int m, int c, int d)
93 RGBA_Gfx_Func func = NULL;
96 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
99 func = op_mul_span_funcs[s][m][c][d][cpu];
100 if (func) return func;
105 func = op_mul_span_funcs[s][m][c][d][cpu];
106 if (func) return func;
112 op_mul_pixel_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels)
114 int s = SP_AN, m = SM_N, c = SC_N, d = DP_AN;
116 if (src && src->cache_entry.flags.alpha)
118 dst->cache_entry.flags.alpha = 1;
121 if (dst && dst->cache_entry.flags.alpha)
123 return mul_gfx_span_func_cpu(s, m, c, d);
127 op_mul_color_span_get(DATA32 col, RGBA_Image *dst, int pixels)
129 int s = SP_N, m = SM_N, c = SC_AN, d = DP_AN;
131 if ((col >> 24) < 255)
134 dst->cache_entry.flags.alpha = 1;
137 if (col == (col | 0x00ffffff))
139 if (col == 0xffffffff)
141 if (dst && dst->cache_entry.flags.alpha)
143 return mul_gfx_span_func_cpu(s, m, c, d);
147 op_mul_pixel_color_span_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels)
149 int s = SP_AN, m = SM_N, c = SC_AN, d = DP_AN;
151 if (src && src->cache_entry.flags.alpha)
154 dst->cache_entry.flags.alpha = 1;
157 if ((col >> 24) < 255)
160 dst->cache_entry.flags.alpha = 1;
163 if (col == (col | 0x00ffffff))
165 if (col == 0xffffffff)
167 if (dst && dst->cache_entry.flags.alpha)
169 return mul_gfx_span_func_cpu(s, m, c, d);
173 op_mul_mask_color_span_get(DATA32 col, RGBA_Image *dst, int pixels)
175 int s = SP_N, m = SM_AS, c = SC_AN, d = DP;
178 dst->cache_entry.flags.alpha = 1;
179 if ((col >> 24) < 255)
181 if (col == (col | 0x00ffffff))
183 if (col == 0xffffffff)
185 return mul_gfx_span_func_cpu(s, m, c, d);
189 op_mul_pixel_mask_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels)
191 int s = SP_AN, m = SM_AS, c = SC_N, d = DP;
194 dst->cache_entry.flags.alpha = 1;
195 if (src && src->cache_entry.flags.alpha)
197 return mul_gfx_span_func_cpu(s, m, c, d);
200 static RGBA_Gfx_Pt_Func
201 mul_gfx_pt_func_cpu(int s, int m, int c, int d)
203 RGBA_Gfx_Pt_Func func = NULL;
206 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
209 func = op_mul_pt_funcs[s][m][c][d][cpu];
210 if (func) return func;
215 func = op_mul_pt_funcs[s][m][c][d][cpu];
216 if (func) return func;
221 static RGBA_Gfx_Pt_Func
222 op_mul_pixel_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst)
224 int s = SP_AN, m = SM_N, c = SC_N, d = DP_AN;
228 dst->cache_entry.flags.alpha = 1;
231 if (dst && dst->cache_entry.flags.alpha)
233 return mul_gfx_pt_func_cpu(s, m, c, d);
236 static RGBA_Gfx_Pt_Func
237 op_mul_color_pt_get(DATA32 col, RGBA_Image *dst)
239 int s = SP_N, m = SM_N, c = SC_AN, d = DP_AN;
241 if ((col >> 24) < 255)
244 dst->cache_entry.flags.alpha = 1;
247 if (col == (col | 0x00ffffff))
249 if (col == 0xffffffff)
251 if (dst && dst->cache_entry.flags.alpha)
253 return mul_gfx_pt_func_cpu(s, m, c, d);
256 static RGBA_Gfx_Pt_Func
257 op_mul_pixel_color_pt_get(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst)
259 int s = SP_AN, m = SM_N, c = SC_AN, d = DP_AN;
264 dst->cache_entry.flags.alpha = 1;
267 if ((col >> 24) < 255)
270 dst->cache_entry.flags.alpha = 1;
273 if (col == (col | 0x00ffffff))
275 if (col == 0xffffffff)
277 if (dst && dst->cache_entry.flags.alpha)
279 return mul_gfx_pt_func_cpu(s, m, c, d);
282 static RGBA_Gfx_Pt_Func
283 op_mul_mask_color_pt_get(DATA32 col, RGBA_Image *dst)
285 int s = SP_N, m = SM_AS, c = SC_AN, d = DP;
288 dst->cache_entry.flags.alpha = 1;
289 if ((col >> 24) < 255)
291 if (col == (col | 0x00ffffff))
293 if (col == 0xffffffff)
295 return mul_gfx_pt_func_cpu(s, m, c, d);
298 static RGBA_Gfx_Pt_Func
299 op_mul_pixel_mask_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst)
301 int s = SP_AN, m = SM_AS, c = SC_N, d = DP;
304 dst->cache_entry.flags.alpha = 1;
307 return mul_gfx_pt_func_cpu(s, m, c, d);