summaryrefslogtreecommitdiff
path: root/src/lib/evas/common/evas_op_add_main_.c
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2012-11-04 11:51:42 +0000
committerVincent Torri <vincent.torri@gmail.com>2012-11-04 11:51:42 +0000
commitc15e9c6575c3b5f39ded167dda5259de3de96151 (patch)
tree5115d7ae3620af24c2bc094cd062575af7adeda9 /src/lib/evas/common/evas_op_add_main_.c
parenta5ac6a987caec5a7f7596a25d0a065b9cc94c50c (diff)
merge: and now Evas
I've tested make -j 3 install and it works nicely I've tested expedite with software and opengl xlib, and it works. Not tested other engines, so please report any problems (engines or other) on the ML. TODO: examples and tests, I'll add them later ISSUE: Eina_Unicode size check. It indirectly depends on eina_config.h, which is created at the end of the configure script. So its size is always 0. I don't know how that size is used, so I can't do a lot, for now. SVN revision: 78895
Diffstat (limited to 'src/lib/evas/common/evas_op_add_main_.c')
-rw-r--r--src/lib/evas/common/evas_op_add_main_.c529
1 files changed, 529 insertions, 0 deletions
diff --git a/src/lib/evas/common/evas_op_add_main_.c b/src/lib/evas/common/evas_op_add_main_.c
new file mode 100644
index 0000000000..bde553c458
--- /dev/null
+++ b/src/lib/evas/common/evas_op_add_main_.c
@@ -0,0 +1,529 @@
1#include "evas_common.h"
2static RGBA_Gfx_Func op_add_span_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
3static RGBA_Gfx_Pt_Func op_add_pt_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
4
5static void op_add_init(void);
6static void op_add_shutdown(void);
7
8static RGBA_Gfx_Func op_add_pixel_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels);
9static RGBA_Gfx_Func op_add_color_span_get(DATA32 col, RGBA_Image *dst, int pixels);
10static RGBA_Gfx_Func op_add_pixel_color_span_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels);
11static RGBA_Gfx_Func op_add_mask_color_span_get(DATA32 col, RGBA_Image *dst, int pixels);
12static RGBA_Gfx_Func op_add_pixel_mask_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels);
13
14static RGBA_Gfx_Pt_Func op_add_pixel_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst);
15static RGBA_Gfx_Pt_Func op_add_color_pt_get(DATA32 col, RGBA_Image *dst);
16static RGBA_Gfx_Pt_Func op_add_pixel_color_pt_get(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst);
17static RGBA_Gfx_Pt_Func op_add_mask_color_pt_get(DATA32 col, RGBA_Image *dst);
18static RGBA_Gfx_Pt_Func op_add_pixel_mask_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst);
19
20static RGBA_Gfx_Compositor _composite_add = { "add",
21 op_add_init, op_add_shutdown,
22 op_add_pixel_span_get, op_add_color_span_get,
23 op_add_pixel_color_span_get, op_add_mask_color_span_get,
24 op_add_pixel_mask_span_get,
25 op_add_pixel_pt_get, op_add_color_pt_get,
26 op_add_pixel_color_pt_get, op_add_mask_color_pt_get,
27 op_add_pixel_mask_pt_get
28 };
29
30RGBA_Gfx_Compositor *
31evas_common_gfx_compositor_add_get(void)
32{
33 return &(_composite_add);
34}
35
36static RGBA_Gfx_Func op_add_rel_span_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
37static RGBA_Gfx_Pt_Func op_add_rel_pt_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
38
39static void op_add_rel_init(void);
40static void op_add_rel_shutdown(void);
41
42static RGBA_Gfx_Func op_add_rel_pixel_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels);
43static RGBA_Gfx_Func op_add_rel_color_span_get(DATA32 col, RGBA_Image *dst, int pixels);
44static RGBA_Gfx_Func op_add_rel_pixel_color_span_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels);
45static RGBA_Gfx_Func op_add_rel_mask_color_span_get(DATA32 col, RGBA_Image *dst, int pixels);
46static RGBA_Gfx_Func op_add_rel_pixel_mask_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels);
47
48static RGBA_Gfx_Pt_Func op_add_rel_pixel_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst);
49static RGBA_Gfx_Pt_Func op_add_rel_color_pt_get(DATA32 col, RGBA_Image *dst);
50static RGBA_Gfx_Pt_Func op_add_rel_pixel_color_pt_get(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst);
51static RGBA_Gfx_Pt_Func op_add_rel_mask_color_pt_get(DATA32 col, RGBA_Image *dst);
52static RGBA_Gfx_Pt_Func op_add_rel_pixel_mask_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst);
53
54static RGBA_Gfx_Compositor _composite_add_rel = { "add_rel",
55 op_add_rel_init, op_add_rel_shutdown,
56 op_add_rel_pixel_span_get, op_add_rel_color_span_get,
57 op_add_rel_pixel_color_span_get, op_add_rel_mask_color_span_get,
58 op_add_rel_pixel_mask_span_get,
59 op_add_rel_pixel_pt_get, op_add_rel_color_pt_get,
60 op_add_rel_pixel_color_pt_get, op_add_rel_mask_color_pt_get,
61 op_add_rel_pixel_mask_pt_get
62 };
63
64RGBA_Gfx_Compositor *
65evas_common_gfx_compositor_add_rel_get(void)
66{
67 return &(_composite_add_rel);
68}
69
70
71# include "./evas_op_add/op_add_pixel_.c"
72# include "./evas_op_add/op_add_color_.c"
73# include "./evas_op_add/op_add_pixel_color_.c"
74# include "./evas_op_add/op_add_pixel_mask_.c"
75# include "./evas_op_add/op_add_mask_color_.c"
76//# include "./evas_op_add/op_add_pixel_mask_color_.c"
77
78# include "./evas_op_add/op_add_pixel_i386.c"
79# include "./evas_op_add/op_add_color_i386.c"
80# include "./evas_op_add/op_add_pixel_color_i386.c"
81# include "./evas_op_add/op_add_pixel_mask_i386.c"
82# include "./evas_op_add/op_add_mask_color_i386.c"
83//# include "op_add_pixel_mask_color_.c"
84
85static void
86op_add_init(void)
87{
88 memset(op_add_span_funcs, 0, sizeof(op_add_span_funcs));
89 memset(op_add_pt_funcs, 0, sizeof(op_add_pt_funcs));
90#ifdef BUILD_MMX
91 init_add_pixel_span_funcs_mmx();
92 init_add_pixel_color_span_funcs_mmx();
93 init_add_pixel_mask_span_funcs_mmx();
94 init_add_color_span_funcs_mmx();
95 init_add_mask_color_span_funcs_mmx();
96
97 init_add_pixel_pt_funcs_mmx();
98 init_add_pixel_color_pt_funcs_mmx();
99 init_add_pixel_mask_pt_funcs_mmx();
100 init_add_color_pt_funcs_mmx();
101 init_add_mask_color_pt_funcs_mmx();
102#endif
103 init_add_pixel_span_funcs_c();
104 init_add_pixel_color_span_funcs_c();
105 init_add_rel_pixel_mask_span_funcs_c();
106 init_add_color_span_funcs_c();
107 init_add_mask_color_span_funcs_c();
108
109 init_add_pixel_pt_funcs_c();
110 init_add_pixel_color_pt_funcs_c();
111 init_add_rel_pixel_mask_pt_funcs_c();
112 init_add_color_pt_funcs_c();
113 init_add_mask_color_pt_funcs_c();
114}
115
116static void
117op_add_shutdown(void)
118{
119}
120
121static RGBA_Gfx_Func
122add_gfx_span_func_cpu(int s, int m, int c, int d)
123{
124 RGBA_Gfx_Func func = NULL;
125 int cpu = CPU_N;
126#ifdef BUILD_MMX
127 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
128 {
129 cpu = CPU_MMX;
130 func = op_add_span_funcs[s][m][c][d][cpu];
131 if (func) return func;
132 }
133#endif
134 cpu = CPU_C;
135 func = op_add_span_funcs[s][m][c][d][cpu];
136 if (func) return func;
137 return func;
138}
139
140static RGBA_Gfx_Func
141op_add_pixel_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels EINA_UNUSED)
142{
143 int s = SP_AN, m = SM_N, c = SC_N, d = DP_AN;
144
145 if (src && src->cache_entry.flags.alpha)
146 s = SP;
147 if (dst && dst->cache_entry.flags.alpha)
148 d = DP;
149 return add_gfx_span_func_cpu(s, m, c, d);
150}
151
152static RGBA_Gfx_Func
153op_add_color_span_get(DATA32 col, RGBA_Image *dst, int pixels EINA_UNUSED)
154{
155 int s = SP_N, m = SM_N, c = SC_AN, d = DP_AN;
156
157 if ((col >> 24) < 255)
158 c = SC;
159 if (col == (col | 0x00ffffff))
160 c = SC_AA;
161 if (col == 0xffffffff)
162 c = SC_N;
163 if (dst && dst->cache_entry.flags.alpha)
164 d = DP;
165 return add_gfx_span_func_cpu(s, m, c, d);
166}
167
168static RGBA_Gfx_Func
169op_add_pixel_color_span_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels EINA_UNUSED)
170{
171 int s = SP_AN, m = SM_N, c = SC_AN, d = DP_AN;
172
173 if (src && src->cache_entry.flags.alpha)
174 s = SP;
175 if ((col >> 24) < 255)
176 c = SC;
177 if (col == (col | 0x00ffffff))
178 c = SC_AA;
179 if (col == 0xffffffff)
180 c = SC_N;
181 if (dst && dst->cache_entry.flags.alpha)
182 d = DP;
183 return add_gfx_span_func_cpu(s, m, c, d);
184}
185
186static RGBA_Gfx_Func
187op_add_mask_color_span_get(DATA32 col, RGBA_Image *dst, int pixels EINA_UNUSED)
188{
189 int s = SP_N, m = SM_AS, c = SC_AN, d = DP_AN;
190
191 if ((col >> 24) < 255)
192 c = SC;
193 if (col == (col | 0x00ffffff))
194 c = SC_AA;
195 if (col == 0xffffffff)
196 c = SC_N;
197 if (dst && dst->cache_entry.flags.alpha)
198 d = DP;
199 return add_gfx_span_func_cpu(s, m, c, d);
200}
201
202static RGBA_Gfx_Func
203op_add_pixel_mask_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels EINA_UNUSED)
204{
205 int s = SP_AN, m = SM_AS, c = SC_N, d = DP_AN;
206
207 if (src && src->cache_entry.flags.alpha)
208 s = SP;
209 if (dst && dst->cache_entry.flags.alpha)
210 d = DP;
211 return add_gfx_span_func_cpu(s, m, c, d);
212}
213
214static RGBA_Gfx_Pt_Func
215add_gfx_pt_func_cpu(int s, int m, int c, int d)
216{
217 RGBA_Gfx_Pt_Func func = NULL;
218 int cpu = CPU_N;
219#ifdef BUILD_MMX
220 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
221 {
222 cpu = CPU_MMX;
223 func = op_add_pt_funcs[s][m][c][d][cpu];
224 if (func) return func;
225 }
226#endif
227 cpu = CPU_C;
228 func = op_add_pt_funcs[s][m][c][d][cpu];
229 if (func) return func;
230 return func;
231}
232
233static RGBA_Gfx_Pt_Func
234op_add_pixel_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst)
235{
236 int s = SP_AN, m = SM_N, c = SC_N, d = DP_AN;
237
238 if (src_flags.alpha)
239 s = SP;
240 if (dst && dst->cache_entry.flags.alpha)
241 d = DP;
242 return add_gfx_pt_func_cpu(s, m, c, d);
243}
244
245static RGBA_Gfx_Pt_Func
246op_add_color_pt_get(DATA32 col, RGBA_Image *dst)
247{
248 int s = SP_N, m = SM_N, c = SC_AN, d = DP_AN;
249
250 if ((col >> 24) < 255)
251 c = SC;
252 if (col == (col | 0x00ffffff))
253 c = SC_AA;
254 if (col == 0xffffffff)
255 c = SC_N;
256 if (dst && dst->cache_entry.flags.alpha)
257 d = DP;
258 return add_gfx_pt_func_cpu(s, m, c, d);
259}
260
261static RGBA_Gfx_Pt_Func
262op_add_pixel_color_pt_get(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst)
263{
264 int s = SP_AN, m = SM_N, c = SC_AN, d = DP_AN;
265
266 if (src_flags.alpha)
267 s = SP;
268 if ((col >> 24) < 255)
269 c = SC;
270 if (col == (col | 0x00ffffff))
271 c = SC_AA;
272 if (col == 0xffffffff)
273 c = SC_N;
274 if (dst && dst->cache_entry.flags.alpha)
275 d = DP;
276 return add_gfx_pt_func_cpu(s, m, c, d);
277}
278
279static RGBA_Gfx_Pt_Func
280op_add_mask_color_pt_get(DATA32 col, RGBA_Image *dst)
281{
282 int s = SP_N, m = SM_AS, c = SC_AN, d = DP_AN;
283
284 if ((col >> 24) < 255)
285 c = SC;
286 if (col == (col | 0x00ffffff))
287 c = SC_AA;
288 if (col == 0xffffffff)
289 c = SC_N;
290 if (dst && dst->cache_entry.flags.alpha)
291 d = DP;
292 return add_gfx_pt_func_cpu(s, m, c, d);
293}
294
295static RGBA_Gfx_Pt_Func
296op_add_pixel_mask_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst)
297{
298 int s = SP_AN, m = SM_AS, c = SC_N, d = DP_AN;
299
300 if (src_flags.alpha)
301 s = SP;
302 if (dst && dst->cache_entry.flags.alpha)
303 d = DP;
304 return add_gfx_pt_func_cpu(s, m, c, d);
305}
306
307
308
309static void
310op_add_rel_init(void)
311{
312 memset(op_add_rel_span_funcs, 0, sizeof(op_add_rel_span_funcs));
313 memset(op_add_rel_pt_funcs, 0, sizeof(op_add_rel_pt_funcs));
314#ifdef BUILD_MMX
315 init_add_rel_pixel_span_funcs_mmx();
316 init_add_rel_pixel_color_span_funcs_mmx();
317 init_add_rel_pixel_mask_span_funcs_mmx();
318 init_add_rel_color_span_funcs_mmx();
319 init_add_rel_mask_color_span_funcs_mmx();
320
321 init_add_rel_pixel_pt_funcs_mmx();
322 init_add_rel_pixel_color_pt_funcs_mmx();
323 init_add_rel_pixel_mask_pt_funcs_mmx();
324 init_add_rel_color_pt_funcs_mmx();
325 init_add_rel_mask_color_pt_funcs_mmx();
326#endif
327 init_add_rel_pixel_span_funcs_c();
328 init_add_rel_pixel_color_span_funcs_c();
329 init_add_rel_pixel_mask_span_funcs_c();
330 init_add_rel_color_span_funcs_c();
331 init_add_rel_mask_color_span_funcs_c();
332
333 init_add_rel_pixel_pt_funcs_c();
334 init_add_rel_pixel_color_pt_funcs_c();
335 init_add_rel_pixel_mask_pt_funcs_c();
336 init_add_rel_color_pt_funcs_c();
337 init_add_rel_mask_color_pt_funcs_c();
338}
339
340static void
341op_add_rel_shutdown(void)
342{
343}
344
345static RGBA_Gfx_Func
346add_rel_gfx_span_func_cpu(int s, int m, int c, int d)
347{
348 RGBA_Gfx_Func func = NULL;
349 int cpu = CPU_N;
350#ifdef BUILD_MMX
351 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
352 {
353 cpu = CPU_MMX;
354 func = op_add_rel_span_funcs[s][m][c][d][cpu];
355 if (func) return func;
356 }
357#endif
358 cpu = CPU_C;
359 func = op_add_rel_span_funcs[s][m][c][d][cpu];
360 if (func) return func;
361 return func;
362}
363
364static RGBA_Gfx_Func
365op_add_rel_pixel_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels EINA_UNUSED)
366{
367 int s = SP_AN, m = SM_N, c = SC_N, d = DP_AN;
368
369 if (src && src->cache_entry.flags.alpha)
370 s = SP;
371 if (dst && dst->cache_entry.flags.alpha)
372 d = DP;
373 return add_rel_gfx_span_func_cpu(s, m, c, d);
374}
375
376static RGBA_Gfx_Func
377op_add_rel_color_span_get(DATA32 col, RGBA_Image *dst, int pixels EINA_UNUSED)
378{
379 int s = SP_N, m = SM_N, c = SC_AN, d = DP_AN;
380
381 if ((col >> 24) < 255)
382 c = SC;
383 if (col == (col | 0x00ffffff))
384 c = SC_AA;
385 if (col == 0xffffffff)
386 c = SC_N;
387 if (dst && dst->cache_entry.flags.alpha)
388 d = DP;
389 return add_rel_gfx_span_func_cpu(s, m, c, d);
390}
391
392static RGBA_Gfx_Func
393op_add_rel_pixel_color_span_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels EINA_UNUSED)
394{
395 int s = SP_AN, m = SM_N, c = SC_AN, d = DP_AN;
396
397 if (src && src->cache_entry.flags.alpha)
398 s = SP;
399 if ((col >> 24) < 255)
400 c = SC;
401 if (col == (col | 0x00ffffff))
402 c = SC_AA;
403 if (col == 0xffffffff)
404 c = SC_N;
405 if (dst && dst->cache_entry.flags.alpha)
406 d = DP;
407 return add_rel_gfx_span_func_cpu(s, m, c, d);
408}
409
410static RGBA_Gfx_Func
411op_add_rel_mask_color_span_get(DATA32 col, RGBA_Image *dst, int pixels EINA_UNUSED)
412{
413 int s = SP_N, m = SM_AS, c = SC_AN, d = DP_AN;
414
415 if ((col >> 24) < 255)
416 c = SC;
417 if (col == (col | 0x00ffffff))
418 c = SC_AA;
419 if (col == 0xffffffff)
420 c = SC_N;
421 if (dst && dst->cache_entry.flags.alpha)
422 d = DP;
423 return add_rel_gfx_span_func_cpu(s, m, c, d);
424}
425
426static RGBA_Gfx_Func
427op_add_rel_pixel_mask_span_get(RGBA_Image *src, RGBA_Image *dst, int pixels EINA_UNUSED)
428{
429 int s = SP_AN, m = SM_AS, c = SC_N, d = DP_AN;
430
431 if (src && src->cache_entry.flags.alpha)
432 s = SP;
433 if (dst && dst->cache_entry.flags.alpha)
434 d = DP;
435 return add_rel_gfx_span_func_cpu(s, m, c, d);
436}
437
438static RGBA_Gfx_Pt_Func
439add_rel_gfx_pt_func_cpu(int s, int m, int c, int d)
440{
441 RGBA_Gfx_Pt_Func func = NULL;
442 int cpu = CPU_N;
443#ifdef BUILD_MMX
444 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
445 {
446 cpu = CPU_MMX;
447 func = op_add_rel_pt_funcs[s][m][c][d][cpu];
448 if (func) return func;
449 }
450#endif
451 cpu = CPU_C;
452 func = op_add_rel_pt_funcs[s][m][c][d][cpu];
453 if (func) return func;
454 return func;
455}
456
457static RGBA_Gfx_Pt_Func
458op_add_rel_pixel_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst)
459{
460 int s = SP_AN, m = SM_N, c = SC_N, d = DP_AN;
461
462 if (src_flags.alpha)
463 s = SP;
464 if (dst && dst->cache_entry.flags.alpha)
465 d = DP;
466 return add_rel_gfx_pt_func_cpu(s, m, c, d);
467}
468
469static RGBA_Gfx_Pt_Func
470op_add_rel_color_pt_get(DATA32 col, RGBA_Image *dst)
471{
472 int s = SP_N, m = SM_N, c = SC_AN, d = DP_AN;
473
474 if ((col >> 24) < 255)
475 c = SC;
476 if (col == (col | 0x00ffffff))
477 c = SC_AA;
478 if (col == 0xffffffff)
479 c = SC_N;
480 if (dst && dst->cache_entry.flags.alpha)
481 d = DP;
482 return add_rel_gfx_pt_func_cpu(s, m, c, d);
483}
484
485static RGBA_Gfx_Pt_Func
486op_add_rel_pixel_color_pt_get(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst)
487{
488 int s = SP_AN, m = SM_N, c = SC_AN, d = DP_AN;
489
490 if (src_flags.alpha)
491 s = SP;
492 if ((col >> 24) < 255)
493 c = SC;
494 if (col == (col | 0x00ffffff))
495 c = SC_AA;
496 if (col == 0xffffffff)
497 c = SC_N;
498 if (dst && dst->cache_entry.flags.alpha)
499 d = DP;
500 return add_rel_gfx_pt_func_cpu(s, m, c, d);
501}
502
503static RGBA_Gfx_Pt_Func
504op_add_rel_mask_color_pt_get(DATA32 col, RGBA_Image *dst)
505{
506 int s = SP_N, m = SM_AS, c = SC_AN, d = DP_AN;
507
508 if ((col >> 24) < 255)
509 c = SC;
510 if (col == (col | 0x00ffffff))
511 c = SC_AA;
512 if (col == 0xffffffff)
513 c = SC_N;
514 if (dst && dst->cache_entry.flags.alpha)
515 d = DP;
516 return add_rel_gfx_pt_func_cpu(s, m, c, d);
517}
518
519static RGBA_Gfx_Pt_Func
520op_add_rel_pixel_mask_pt_get(Image_Entry_Flags src_flags, RGBA_Image *dst)
521{
522 int s = SP_AN, m = SM_AS, c = SC_N, d = DP_AN;
523
524 if (src_flags.alpha)
525 s = SP;
526 if (dst && dst->cache_entry.flags.alpha)
527 d = DP;
528 return add_rel_gfx_pt_func_cpu(s, m, c, d);
529}