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_mask_color_.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_mask_color_.c')
-rw-r--r-- | libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_mask_color_.c | 185 |
1 files changed, 185 insertions, 0 deletions
diff --git a/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_mask_color_.c b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_mask_color_.c new file mode 100644 index 0000000..12a0a75 --- /dev/null +++ b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_mask_color_.c | |||
@@ -0,0 +1,185 @@ | |||
1 | /* blend mask x color -> dst */ | ||
2 | |||
3 | #ifdef BUILD_C | ||
4 | static void | ||
5 | _op_blend_mas_c_dp(DATA32 *s __UNUSED__, DATA8 *m, DATA32 c, DATA32 *d, int l) { | ||
6 | DATA32 *e; | ||
7 | int alpha = 256 - (c >> 24); | ||
8 | UNROLL8_PLD_WHILE(d, l, e, | ||
9 | { | ||
10 | DATA32 a = *m; | ||
11 | switch(a) | ||
12 | { | ||
13 | case 0: | ||
14 | break; | ||
15 | case 255: | ||
16 | *d = c + MUL_256(alpha, *d); | ||
17 | break; | ||
18 | default: | ||
19 | { | ||
20 | DATA32 mc = MUL_SYM(a, c); | ||
21 | a = 256 - (mc >> 24); | ||
22 | *d = mc + MUL_256(a, *d); | ||
23 | } | ||
24 | break; | ||
25 | } | ||
26 | m++; d++; | ||
27 | }); | ||
28 | } | ||
29 | |||
30 | static void | ||
31 | _op_blend_mas_can_dp(DATA32 *s __UNUSED__, DATA8 *m, DATA32 c, DATA32 *d, int l) { | ||
32 | DATA32 *e; | ||
33 | int alpha; | ||
34 | UNROLL8_PLD_WHILE(d, l, e, | ||
35 | { | ||
36 | alpha = *m; | ||
37 | switch(alpha) | ||
38 | { | ||
39 | case 0: | ||
40 | break; | ||
41 | case 255: | ||
42 | *d = c; | ||
43 | break; | ||
44 | default: | ||
45 | alpha++; | ||
46 | *d = INTERP_256(alpha, c, *d); | ||
47 | break; | ||
48 | } | ||
49 | m++; d++; | ||
50 | }); | ||
51 | } | ||
52 | |||
53 | #define _op_blend_mas_cn_dp _op_blend_mas_can_dp | ||
54 | #define _op_blend_mas_caa_dp _op_blend_mas_c_dp | ||
55 | |||
56 | #define _op_blend_mas_c_dpan _op_blend_mas_c_dp | ||
57 | #define _op_blend_mas_cn_dpan _op_blend_mas_cn_dp | ||
58 | #define _op_blend_mas_can_dpan _op_blend_mas_can_dp | ||
59 | #define _op_blend_mas_caa_dpan _op_blend_mas_caa_dp | ||
60 | |||
61 | static void | ||
62 | init_blend_mask_color_span_funcs_c(void) | ||
63 | { | ||
64 | op_blend_span_funcs[SP_N][SM_AS][SC][DP][CPU_C] = _op_blend_mas_c_dp; | ||
65 | op_blend_span_funcs[SP_N][SM_AS][SC_N][DP][CPU_C] = _op_blend_mas_cn_dp; | ||
66 | op_blend_span_funcs[SP_N][SM_AS][SC_AN][DP][CPU_C] = _op_blend_mas_can_dp; | ||
67 | op_blend_span_funcs[SP_N][SM_AS][SC_AA][DP][CPU_C] = _op_blend_mas_caa_dp; | ||
68 | |||
69 | op_blend_span_funcs[SP_N][SM_AS][SC][DP_AN][CPU_C] = _op_blend_mas_c_dpan; | ||
70 | op_blend_span_funcs[SP_N][SM_AS][SC_N][DP_AN][CPU_C] = _op_blend_mas_cn_dpan; | ||
71 | op_blend_span_funcs[SP_N][SM_AS][SC_AN][DP_AN][CPU_C] = _op_blend_mas_can_dpan; | ||
72 | op_blend_span_funcs[SP_N][SM_AS][SC_AA][DP_AN][CPU_C] = _op_blend_mas_caa_dpan; | ||
73 | } | ||
74 | #endif | ||
75 | |||
76 | #ifdef BUILD_C | ||
77 | static void | ||
78 | _op_blend_pt_mas_c_dp(DATA32 s, DATA8 m, DATA32 c, DATA32 *d) { | ||
79 | s = MUL_SYM(m, c); | ||
80 | m = 256 - (s >> 24); | ||
81 | *d = s + MUL_256(m, *d); | ||
82 | } | ||
83 | |||
84 | static void | ||
85 | _op_blend_pt_mas_can_dp(DATA32 s __UNUSED__, DATA8 m, DATA32 c, DATA32 *d) { | ||
86 | *d = INTERP_256(m + 1, c, *d); | ||
87 | } | ||
88 | |||
89 | #define _op_blend_pt_mas_cn_dp _op_blend_pt_mas_can_dp | ||
90 | #define _op_blend_pt_mas_caa_dp _op_blend_pt_mas_c_dp | ||
91 | |||
92 | #define _op_blend_pt_mas_c_dpan _op_blend_pt_mas_c_dp | ||
93 | #define _op_blend_pt_mas_cn_dpan _op_blend_pt_mas_cn_dp | ||
94 | #define _op_blend_pt_mas_can_dpan _op_blend_pt_mas_can_dp | ||
95 | #define _op_blend_pt_mas_caa_dpan _op_blend_pt_mas_caa_dp | ||
96 | |||
97 | static void | ||
98 | init_blend_mask_color_pt_funcs_c(void) | ||
99 | { | ||
100 | op_blend_pt_funcs[SP_N][SM_AS][SC][DP][CPU_C] = _op_blend_pt_mas_c_dp; | ||
101 | op_blend_pt_funcs[SP_N][SM_AS][SC_N][DP][CPU_C] = _op_blend_pt_mas_cn_dp; | ||
102 | op_blend_pt_funcs[SP_N][SM_AS][SC_AN][DP][CPU_C] = _op_blend_pt_mas_can_dp; | ||
103 | op_blend_pt_funcs[SP_N][SM_AS][SC_AA][DP][CPU_C] = _op_blend_pt_mas_caa_dp; | ||
104 | |||
105 | op_blend_pt_funcs[SP_N][SM_AS][SC][DP_AN][CPU_C] = _op_blend_pt_mas_c_dpan; | ||
106 | op_blend_pt_funcs[SP_N][SM_AS][SC_N][DP_AN][CPU_C] = _op_blend_pt_mas_cn_dpan; | ||
107 | op_blend_pt_funcs[SP_N][SM_AS][SC_AN][DP_AN][CPU_C] = _op_blend_pt_mas_can_dpan; | ||
108 | op_blend_pt_funcs[SP_N][SM_AS][SC_AA][DP_AN][CPU_C] = _op_blend_pt_mas_caa_dpan; | ||
109 | } | ||
110 | #endif | ||
111 | |||
112 | /*-----*/ | ||
113 | |||
114 | /* blend_rel mask x color --> dst */ | ||
115 | |||
116 | #ifdef BUILD_C | ||
117 | static void | ||
118 | _op_blend_rel_mas_c_dp(DATA32 *s __UNUSED__, DATA8 *m, DATA32 c, DATA32 *d, int l) { | ||
119 | DATA32 *e; | ||
120 | int alpha; | ||
121 | UNROLL8_PLD_WHILE(d, l, e, | ||
122 | { | ||
123 | DATA32 mc = MUL_SYM(*m, c); | ||
124 | alpha = 256 - (mc >> 24); | ||
125 | *d = MUL_SYM(*d >> 24, mc) + MUL_256(alpha, *d); | ||
126 | d++; | ||
127 | m++; | ||
128 | }); | ||
129 | } | ||
130 | |||
131 | #define _op_blend_rel_mas_cn_dp _op_blend_rel_mas_c_dp | ||
132 | #define _op_blend_rel_mas_can_dp _op_blend_rel_mas_c_dp | ||
133 | #define _op_blend_rel_mas_caa_dp _op_blend_rel_mas_c_dp | ||
134 | |||
135 | #define _op_blend_rel_mas_c_dpan _op_blend_mas_c_dpan | ||
136 | #define _op_blend_rel_mas_cn_dpan _op_blend_mas_cn_dpan | ||
137 | #define _op_blend_rel_mas_can_dpan _op_blend_mas_can_dpan | ||
138 | #define _op_blend_rel_mas_caa_dpan _op_blend_mas_caa_dpan | ||
139 | |||
140 | static void | ||
141 | init_blend_rel_mask_color_span_funcs_c(void) | ||
142 | { | ||
143 | op_blend_rel_span_funcs[SP_N][SM_AS][SC][DP][CPU_C] = _op_blend_rel_mas_c_dp; | ||
144 | op_blend_rel_span_funcs[SP_N][SM_AS][SC_N][DP][CPU_C] = _op_blend_rel_mas_can_dp; | ||
145 | op_blend_rel_span_funcs[SP_N][SM_AS][SC_AN][DP][CPU_C] = _op_blend_rel_mas_can_dp; | ||
146 | op_blend_rel_span_funcs[SP_N][SM_AS][SC_AA][DP][CPU_C] = _op_blend_rel_mas_caa_dp; | ||
147 | |||
148 | op_blend_rel_span_funcs[SP_N][SM_AS][SC][DP_AN][CPU_C] = _op_blend_rel_mas_c_dpan; | ||
149 | op_blend_rel_span_funcs[SP_N][SM_AS][SC_N][DP_AN][CPU_C] = _op_blend_rel_mas_cn_dpan; | ||
150 | op_blend_rel_span_funcs[SP_N][SM_AS][SC_AN][DP_AN][CPU_C] = _op_blend_rel_mas_can_dpan; | ||
151 | op_blend_rel_span_funcs[SP_N][SM_AS][SC_AA][DP_AN][CPU_C] = _op_blend_rel_mas_caa_dpan; | ||
152 | } | ||
153 | #endif | ||
154 | |||
155 | #ifdef BUILD_C | ||
156 | static void | ||
157 | _op_blend_rel_pt_mas_c_dp(DATA32 s, DATA8 m, DATA32 c, DATA32 *d) { | ||
158 | s = MUL_SYM(m, c); | ||
159 | c = 256 - (s >> 24); | ||
160 | *d = MUL_SYM(*d >> 24, s) + MUL_256(c, *d); | ||
161 | } | ||
162 | |||
163 | #define _op_blend_rel_pt_mas_cn_dp _op_blend_rel_pt_mas_c_dp | ||
164 | #define _op_blend_rel_pt_mas_can_dp _op_blend_rel_pt_mas_c_dp | ||
165 | #define _op_blend_rel_pt_mas_caa_dp _op_blend_rel_pt_mas_c_dp | ||
166 | |||
167 | #define _op_blend_rel_pt_mas_c_dpan _op_blend_pt_mas_c_dpan | ||
168 | #define _op_blend_rel_pt_mas_cn_dpan _op_blend_pt_mas_cn_dpan | ||
169 | #define _op_blend_rel_pt_mas_can_dpan _op_blend_pt_mas_can_dpan | ||
170 | #define _op_blend_rel_pt_mas_caa_dpan _op_blend_pt_mas_caa_dpan | ||
171 | |||
172 | static void | ||
173 | init_blend_rel_mask_color_pt_funcs_c(void) | ||
174 | { | ||
175 | op_blend_rel_pt_funcs[SP_N][SM_AS][SC][DP][CPU_C] = _op_blend_rel_pt_mas_c_dp; | ||
176 | op_blend_rel_pt_funcs[SP_N][SM_AS][SC_N][DP][CPU_C] = _op_blend_rel_pt_mas_cn_dp; | ||
177 | op_blend_rel_pt_funcs[SP_N][SM_AS][SC_AN][DP][CPU_C] = _op_blend_rel_pt_mas_can_dp; | ||
178 | op_blend_rel_pt_funcs[SP_N][SM_AS][SC_AA][DP][CPU_C] = _op_blend_rel_pt_mas_caa_dp; | ||
179 | |||
180 | op_blend_rel_pt_funcs[SP_N][SM_AS][SC][DP_AN][CPU_C] = _op_blend_rel_pt_mas_c_dpan; | ||
181 | op_blend_rel_pt_funcs[SP_N][SM_AS][SC_N][DP_AN][CPU_C] = _op_blend_rel_pt_mas_cn_dpan; | ||
182 | op_blend_rel_pt_funcs[SP_N][SM_AS][SC_AN][DP_AN][CPU_C] = _op_blend_rel_pt_mas_can_dpan; | ||
183 | op_blend_rel_pt_funcs[SP_N][SM_AS][SC_AA][DP_AN][CPU_C] = _op_blend_rel_pt_mas_caa_dpan; | ||
184 | } | ||
185 | #endif | ||