diff options
author | David Walter Seikel | 2012-01-04 18:41:13 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-01-04 18:41:13 +1000 |
commit | dd7595a3475407a7fa96a97393bae8c5220e8762 (patch) | |
tree | e341e911d7eb911a51684a7412ef7f7c7605d28e /libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_.c | |
parent | Add the skeleton. (diff) | |
download | SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.zip SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.gz SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.bz2 SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.xz |
Add the base Enlightenment Foundation Libraries - eina, eet, evas, ecore, embryo, and edje.
Note that embryo wont be used, but I'm not sure yet if you can build edje without it.
Diffstat (limited to 'libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_.c')
-rw-r--r-- | libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_.c | 162 |
1 files changed, 162 insertions, 0 deletions
diff --git a/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_.c b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_.c new file mode 100644 index 0000000..0ce78d8 --- /dev/null +++ b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_.c | |||
@@ -0,0 +1,162 @@ | |||
1 | /* blend pixel --> dst */ | ||
2 | |||
3 | #ifdef BUILD_C | ||
4 | static void | ||
5 | _op_blend_p_dp(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c __UNUSED__, DATA32 *d, int l) { | ||
6 | DATA32 *e; | ||
7 | int alpha; | ||
8 | UNROLL8_PLD_WHILE(d, l, e, | ||
9 | { | ||
10 | alpha = 256 - (*s >> 24); | ||
11 | *d = *s++ + MUL_256(alpha, *d); | ||
12 | d++; | ||
13 | }); | ||
14 | } | ||
15 | |||
16 | static void | ||
17 | _op_blend_pas_dp(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c __UNUSED__, DATA32 *d, int l) { | ||
18 | DATA32 *e; | ||
19 | int alpha; | ||
20 | UNROLL8_PLD_WHILE(d, l, e, | ||
21 | { | ||
22 | switch (*s & 0xff000000) | ||
23 | { | ||
24 | case 0: | ||
25 | break; | ||
26 | case 0xff000000: | ||
27 | *d = *s; | ||
28 | break; | ||
29 | default: | ||
30 | alpha = 256 - (*s >> 24); | ||
31 | *d = *s + MUL_256(alpha, *d); | ||
32 | break; | ||
33 | } | ||
34 | s++; d++; | ||
35 | }); | ||
36 | } | ||
37 | |||
38 | #define _op_blend_pan_dp NULL | ||
39 | |||
40 | #define _op_blend_p_dpan _op_blend_p_dp | ||
41 | #define _op_blend_pas_dpan _op_blend_pas_dp | ||
42 | #define _op_blend_pan_dpan _op_blend_pan_dp | ||
43 | |||
44 | static void | ||
45 | init_blend_pixel_span_funcs_c(void) | ||
46 | { | ||
47 | op_blend_span_funcs[SP][SM_N][SC_N][DP][CPU_C] = _op_blend_p_dp; | ||
48 | op_blend_span_funcs[SP_AS][SM_N][SC_N][DP][CPU_C] = _op_blend_pas_dp; | ||
49 | op_blend_span_funcs[SP_AN][SM_N][SC_N][DP][CPU_C] = _op_blend_pan_dp; | ||
50 | |||
51 | op_blend_span_funcs[SP][SM_N][SC_N][DP_AN][CPU_C] = _op_blend_p_dpan; | ||
52 | op_blend_span_funcs[SP_AS][SM_N][SC_N][DP_AN][CPU_C] = _op_blend_pas_dpan; | ||
53 | op_blend_span_funcs[SP_AN][SM_N][SC_N][DP_AN][CPU_C] = _op_blend_pan_dpan; | ||
54 | } | ||
55 | #endif | ||
56 | |||
57 | #ifdef BUILD_C | ||
58 | static void | ||
59 | _op_blend_pt_p_dp(DATA32 s, DATA8 m __UNUSED__, DATA32 c, DATA32 *d) { | ||
60 | c = 256 - (s >> 24); | ||
61 | *d = s + MUL_256(c, *d); | ||
62 | } | ||
63 | |||
64 | #define _op_blend_pt_pas_dp _op_blend_pt_p_dp | ||
65 | #define _op_blend_pt_pan_dp NULL | ||
66 | |||
67 | #define _op_blend_pt_p_dpan _op_blend_pt_p_dp | ||
68 | #define _op_blend_pt_pan_dpan _op_blend_pt_pan_dp | ||
69 | #define _op_blend_pt_pas_dpan _op_blend_pt_pas_dp | ||
70 | |||
71 | static void | ||
72 | init_blend_pixel_pt_funcs_c(void) | ||
73 | { | ||
74 | op_blend_pt_funcs[SP][SM_N][SC_N][DP][CPU_C] = _op_blend_pt_p_dp; | ||
75 | op_blend_pt_funcs[SP_AS][SM_N][SC_N][DP][CPU_C] = _op_blend_pt_pas_dp; | ||
76 | op_blend_pt_funcs[SP_AN][SM_N][SC_N][DP][CPU_C] = _op_blend_pt_pan_dp; | ||
77 | |||
78 | op_blend_pt_funcs[SP][SM_N][SC_N][DP_AN][CPU_C] = _op_blend_pt_p_dpan; | ||
79 | op_blend_pt_funcs[SP_AS][SM_N][SC_N][DP_AN][CPU_C] = _op_blend_pt_pas_dpan; | ||
80 | op_blend_pt_funcs[SP_AN][SM_N][SC_N][DP_AN][CPU_C] = _op_blend_pt_pan_dpan; | ||
81 | } | ||
82 | #endif | ||
83 | |||
84 | /*-----*/ | ||
85 | |||
86 | /* blend_rel pixel -> dst */ | ||
87 | |||
88 | #ifdef BUILD_C | ||
89 | static void | ||
90 | _op_blend_rel_p_dp(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) { | ||
91 | DATA32 *e; | ||
92 | int alpha; | ||
93 | UNROLL8_PLD_WHILE(d, l, e, | ||
94 | { | ||
95 | alpha = 256 - (*s >> 24); | ||
96 | c = 1 + (*d >> 24); | ||
97 | *d = MUL_256(c, *s) + MUL_256(alpha, *d); | ||
98 | d++; | ||
99 | s++; | ||
100 | }); | ||
101 | } | ||
102 | |||
103 | static void | ||
104 | _op_blend_rel_pan_dp(DATA32 *s, DATA8 *m __UNUSED__, DATA32 c, DATA32 *d, int l) { | ||
105 | DATA32 *e; | ||
106 | UNROLL8_PLD_WHILE(d, l, e, | ||
107 | { | ||
108 | c = 1 + (*d >> 24); | ||
109 | *d++ = MUL_256(c, *s); | ||
110 | s++; | ||
111 | }); | ||
112 | } | ||
113 | |||
114 | #define _op_blend_rel_pas_dp _op_blend_rel_p_dp | ||
115 | |||
116 | #define _op_blend_rel_p_dpan _op_blend_p_dpan | ||
117 | #define _op_blend_rel_pan_dpan _op_blend_pan_dpan | ||
118 | #define _op_blend_rel_pas_dpan _op_blend_pas_dpan | ||
119 | |||
120 | static void | ||
121 | init_blend_rel_pixel_span_funcs_c(void) | ||
122 | { | ||
123 | op_blend_rel_span_funcs[SP][SM_N][SC_N][DP][CPU_C] = _op_blend_rel_p_dp; | ||
124 | op_blend_rel_span_funcs[SP_AS][SM_N][SC_N][DP][CPU_C] = _op_blend_rel_pas_dp; | ||
125 | op_blend_rel_span_funcs[SP_AN][SM_N][SC_N][DP][CPU_C] = _op_blend_rel_pan_dp; | ||
126 | |||
127 | op_blend_rel_span_funcs[SP][SM_N][SC_N][DP_AN][CPU_C] = _op_blend_rel_p_dpan; | ||
128 | op_blend_rel_span_funcs[SP_AS][SM_N][SC_N][DP_AN][CPU_C] = _op_blend_rel_pas_dpan; | ||
129 | op_blend_rel_span_funcs[SP_AN][SM_N][SC_N][DP_AN][CPU_C] = _op_blend_rel_pan_dpan; | ||
130 | } | ||
131 | #endif | ||
132 | |||
133 | #ifdef BUILD_C | ||
134 | static void | ||
135 | _op_blend_rel_pt_p_dp(DATA32 s, DATA8 m __UNUSED__, DATA32 c, DATA32 *d) { | ||
136 | c = 256 - (s >> 24); | ||
137 | *d = MUL_SYM(*d >> 24, s) + MUL_256(c, *d); | ||
138 | } | ||
139 | |||
140 | static void | ||
141 | _op_blend_rel_pt_pan_dp(DATA32 s, DATA8 m __UNUSED__, DATA32 c __UNUSED__, DATA32 *d) { | ||
142 | *d = MUL_SYM(*d >> 24, s); | ||
143 | } | ||
144 | |||
145 | #define _op_blend_rel_pt_pas_dp _op_blend_rel_pt_p_dp | ||
146 | |||
147 | #define _op_blend_rel_pt_p_dpan _op_blend_pt_p_dpan | ||
148 | #define _op_blend_rel_pt_pan_dpan _op_blend_pt_pan_dpan | ||
149 | #define _op_blend_rel_pt_pas_dpan _op_blend_pt_pas_dpan | ||
150 | |||
151 | static void | ||
152 | init_blend_rel_pixel_pt_funcs_c(void) | ||
153 | { | ||
154 | op_blend_rel_pt_funcs[SP][SM_N][SC_N][DP][CPU_C] = _op_blend_rel_pt_p_dp; | ||
155 | op_blend_rel_pt_funcs[SP_AS][SM_N][SC_N][DP][CPU_C] = _op_blend_rel_pt_pas_dp; | ||
156 | op_blend_rel_pt_funcs[SP_AN][SM_N][SC_N][DP][CPU_C] = _op_blend_rel_pt_pan_dp; | ||
157 | |||
158 | op_blend_rel_pt_funcs[SP][SM_N][SC_N][DP_AN][CPU_C] = _op_blend_rel_pt_p_dpan; | ||
159 | op_blend_rel_pt_funcs[SP_AS][SM_N][SC_N][DP_AN][CPU_C] = _op_blend_rel_pt_pas_dpan; | ||
160 | op_blend_rel_pt_funcs[SP_AN][SM_N][SC_N][DP_AN][CPU_C] = _op_blend_rel_pt_pan_dpan; | ||
161 | } | ||
162 | #endif | ||