diff options
Diffstat (limited to '')
-rw-r--r-- | libraries/evas/src/lib/engines/common_8/evas_soft8_image_unscaled.c | 284 |
1 files changed, 0 insertions, 284 deletions
diff --git a/libraries/evas/src/lib/engines/common_8/evas_soft8_image_unscaled.c b/libraries/evas/src/lib/engines/common_8/evas_soft8_image_unscaled.c deleted file mode 100644 index 6f4e76b..0000000 --- a/libraries/evas/src/lib/engines/common_8/evas_soft8_image_unscaled.c +++ /dev/null | |||
@@ -1,284 +0,0 @@ | |||
1 | #include "evas_common_soft8.h" | ||
2 | #include "evas_soft8_scanline_blend.c" | ||
3 | |||
4 | static void | ||
5 | _soft8_image_draw_unscaled_solid_solid(Soft8_Image * src, Soft8_Image * dst, | ||
6 | RGBA_Draw_Context * dc __UNUSED__, | ||
7 | int src_offset, int dst_offset, | ||
8 | int w, int h) | ||
9 | { | ||
10 | DATA8 *src_itr, *dst_itr; | ||
11 | int y; | ||
12 | |||
13 | src_itr = src->pixels + src_offset; | ||
14 | dst_itr = dst->pixels + dst_offset; | ||
15 | |||
16 | for (y = 0; y < h; y++) | ||
17 | { | ||
18 | _soft8_scanline_blend_solid_solid(src_itr, dst_itr, w); | ||
19 | src_itr += src->stride; | ||
20 | dst_itr += dst->stride; | ||
21 | } | ||
22 | } | ||
23 | |||
24 | static void | ||
25 | _soft8_image_draw_unscaled_transp_solid(Soft8_Image * src, Soft8_Image * dst, | ||
26 | RGBA_Draw_Context * dc __UNUSED__, | ||
27 | int src_offset, int dst_offset, | ||
28 | int w, int h) | ||
29 | { | ||
30 | DATA8 *src_itr, *dst_itr; | ||
31 | DATA8 *alpha_itr; | ||
32 | int y; | ||
33 | |||
34 | src_itr = src->pixels + src_offset; | ||
35 | alpha_itr = src->alpha + src_offset; | ||
36 | dst_itr = dst->pixels + dst_offset; | ||
37 | |||
38 | for (y = 0; y < h; y++) | ||
39 | { | ||
40 | _soft8_scanline_blend_transp_solid(src_itr, alpha_itr, dst_itr, w); | ||
41 | src_itr += src->stride; | ||
42 | alpha_itr += src->stride; | ||
43 | dst_itr += dst->stride; | ||
44 | } | ||
45 | } | ||
46 | |||
47 | static inline void | ||
48 | _soft8_image_draw_unscaled_no_mul(Soft8_Image * src, Soft8_Image * dst, | ||
49 | RGBA_Draw_Context * dc, | ||
50 | int src_offset, int dst_offset, | ||
51 | int width, int height) | ||
52 | { | ||
53 | if (src->cache_entry.flags.alpha && (!dst->cache_entry.flags.alpha)) | ||
54 | _soft8_image_draw_unscaled_transp_solid(src, dst, dc, | ||
55 | src_offset, dst_offset, | ||
56 | width, height); | ||
57 | else if ((!src->cache_entry.flags.alpha) && (!dst->cache_entry.flags.alpha)) | ||
58 | _soft8_image_draw_unscaled_solid_solid(src, dst, dc, | ||
59 | src_offset, dst_offset, | ||
60 | width, height); | ||
61 | else | ||
62 | ERR("Unsupported draw of unscaled images src->cache_entry.flags.alpha=%d, " | ||
63 | "dst->cache_entry.flags.alpha=%d, WITHOUT COLOR MUL", | ||
64 | src->cache_entry.flags.alpha, dst->cache_entry.flags.alpha); | ||
65 | } | ||
66 | |||
67 | static void | ||
68 | _soft8_image_draw_unscaled_solid_solid_mul_alpha(Soft8_Image * src, | ||
69 | Soft8_Image * dst, | ||
70 | RGBA_Draw_Context * | ||
71 | dc __UNUSED__, int src_offset, | ||
72 | int dst_offset, int w, int h, | ||
73 | DATA8 a) | ||
74 | { | ||
75 | DATA8 *src_itr, *dst_itr; | ||
76 | int y; | ||
77 | |||
78 | src_itr = src->pixels + src_offset; | ||
79 | dst_itr = dst->pixels + dst_offset; | ||
80 | |||
81 | for (y = 0; y < h; y++) | ||
82 | { | ||
83 | _soft8_scanline_blend_solid_solid_mul_alpha(src_itr, dst_itr, w, a); | ||
84 | src_itr += src->stride; | ||
85 | dst_itr += dst->stride; | ||
86 | } | ||
87 | } | ||
88 | |||
89 | static void | ||
90 | _soft8_image_draw_unscaled_transp_solid_mul_alpha(Soft8_Image * src, | ||
91 | Soft8_Image * dst, | ||
92 | RGBA_Draw_Context * | ||
93 | dc __UNUSED__, int src_offset, | ||
94 | int dst_offset, int w, int h, | ||
95 | DATA8 a) | ||
96 | { | ||
97 | DATA8 *src_itr, *dst_itr; | ||
98 | DATA8 *alpha_itr; | ||
99 | int y; | ||
100 | |||
101 | src_itr = src->pixels + src_offset; | ||
102 | alpha_itr = src->alpha + src_offset; | ||
103 | dst_itr = dst->pixels + dst_offset; | ||
104 | |||
105 | for (y = 0; y < h; y++) | ||
106 | { | ||
107 | _soft8_scanline_blend_transp_solid_mul_alpha(src_itr, alpha_itr, | ||
108 | dst_itr, w, a); | ||
109 | src_itr += src->stride; | ||
110 | alpha_itr += src->stride; | ||
111 | dst_itr += dst->stride; | ||
112 | } | ||
113 | } | ||
114 | |||
115 | static inline void | ||
116 | _soft8_image_draw_unscaled_mul_alpha(Soft8_Image * src, Soft8_Image * dst, | ||
117 | RGBA_Draw_Context * dc, | ||
118 | int src_offset, int dst_offset, | ||
119 | int width, int height, DATA8 a) | ||
120 | { | ||
121 | if (src->cache_entry.flags.alpha && (!dst->cache_entry.flags.alpha)) | ||
122 | _soft8_image_draw_unscaled_transp_solid_mul_alpha | ||
123 | (src, dst, dc, src_offset, dst_offset, width, height, a); | ||
124 | else if ((!src->cache_entry.flags.alpha) && (!dst->cache_entry.flags.alpha)) | ||
125 | _soft8_image_draw_unscaled_solid_solid_mul_alpha | ||
126 | (src, dst, dc, src_offset, dst_offset, width, height, a); | ||
127 | else | ||
128 | ERR("Unsupported draw of unscaled images src->cache_entry.flags.alpha=%d, " | ||
129 | "dst->cache_entry.flags.alpha=%d, WITH ALPHA MUL %d", | ||
130 | src->cache_entry.flags.alpha, dst->cache_entry.flags.alpha, A_VAL(&dc->mul.col)); | ||
131 | } | ||
132 | |||
133 | static void | ||
134 | _soft8_image_draw_unscaled_solid_solid_mul_color(Soft8_Image * src, | ||
135 | Soft8_Image * dst, | ||
136 | RGBA_Draw_Context * | ||
137 | dc __UNUSED__, int src_offset, | ||
138 | int dst_offset, int w, int h, | ||
139 | DATA8 r, DATA8 g, DATA8 b, | ||
140 | DATA8 a) | ||
141 | { | ||
142 | DATA8 *src_itr, *dst_itr; | ||
143 | int y; | ||
144 | |||
145 | src_itr = src->pixels + src_offset; | ||
146 | dst_itr = dst->pixels + dst_offset; | ||
147 | |||
148 | if (a == 0xff) | ||
149 | for (y = 0; y < h; y++) | ||
150 | { | ||
151 | _soft8_scanline_blend_solid_solid_mul_color_solid | ||
152 | (src_itr, dst_itr, w, r, g, b); | ||
153 | src_itr += src->stride; | ||
154 | dst_itr += dst->stride; | ||
155 | } | ||
156 | else | ||
157 | for (y = 0; y < h; y++) | ||
158 | { | ||
159 | _soft8_scanline_blend_solid_solid_mul_color_transp | ||
160 | (src_itr, dst_itr, w, a, r, g, b); | ||
161 | src_itr += src->stride; | ||
162 | dst_itr += dst->stride; | ||
163 | } | ||
164 | } | ||
165 | |||
166 | static void | ||
167 | _soft8_image_draw_unscaled_transp_solid_mul_color(Soft8_Image * src, | ||
168 | Soft8_Image * dst, | ||
169 | RGBA_Draw_Context * | ||
170 | dc __UNUSED__, int src_offset, | ||
171 | int dst_offset, int w, int h, | ||
172 | DATA8 r, DATA8 g, DATA8 b, | ||
173 | DATA8 a) | ||
174 | { | ||
175 | DATA8 *src_itr, *dst_itr; | ||
176 | DATA8 *alpha_itr; | ||
177 | int y; | ||
178 | |||
179 | src_itr = src->pixels + src_offset; | ||
180 | alpha_itr = src->alpha + src_offset; | ||
181 | dst_itr = dst->pixels + dst_offset; | ||
182 | |||
183 | if (a == 0xff) | ||
184 | for (y = 0; y < h; y++) | ||
185 | { | ||
186 | _soft8_scanline_blend_transp_solid_mul_color_solid | ||
187 | (src_itr, alpha_itr, dst_itr, w, r, g, b); | ||
188 | src_itr += src->stride; | ||
189 | alpha_itr += src->stride; | ||
190 | dst_itr += dst->stride; | ||
191 | } | ||
192 | else | ||
193 | for (y = 0; y < h; y++) | ||
194 | { | ||
195 | _soft8_scanline_blend_transp_solid_mul_color_transp | ||
196 | (src_itr, alpha_itr, dst_itr, w, a, r, g, b); | ||
197 | src_itr += src->stride; | ||
198 | alpha_itr += src->stride; | ||
199 | dst_itr += dst->stride; | ||
200 | } | ||
201 | } | ||
202 | |||
203 | static inline void | ||
204 | _soft8_image_draw_unscaled_mul_color(Soft8_Image * src, Soft8_Image * dst, | ||
205 | RGBA_Draw_Context * dc, | ||
206 | int src_offset, int dst_offset, | ||
207 | int width, int height, | ||
208 | DATA8 r, DATA8 g, DATA8 b, DATA8 a) | ||
209 | { | ||
210 | if (src->cache_entry.flags.alpha && (!dst->cache_entry.flags.alpha)) | ||
211 | _soft8_image_draw_unscaled_transp_solid_mul_color | ||
212 | (src, dst, dc, src_offset, dst_offset, width, height, r, g, b, a); | ||
213 | else if ((!src->cache_entry.flags.alpha) && (!dst->cache_entry.flags.alpha)) | ||
214 | _soft8_image_draw_unscaled_solid_solid_mul_color | ||
215 | (src, dst, dc, src_offset, dst_offset, width, height, r, g, b, a); | ||
216 | else | ||
217 | ERR("Unsupported draw of unscaled images src->cache_entry.flags.alpha=%d, " | ||
218 | "dst->cache_entry.flags.alpha=%d, WITH COLOR MUL 0x%08x", | ||
219 | src->cache_entry.flags.alpha, dst->cache_entry.flags.alpha, dc->mul.col); | ||
220 | } | ||
221 | |||
222 | static inline void | ||
223 | _soft8_image_draw_unscaled_mul(Soft8_Image * src, Soft8_Image * dst, | ||
224 | RGBA_Draw_Context * dc, | ||
225 | int src_offset, int dst_offset, | ||
226 | int width, int height, DATA8 r, DATA8 g, | ||
227 | DATA8 b, DATA8 a) | ||
228 | { | ||
229 | if ((a == r) && (a == g) && (a == b)) | ||
230 | _soft8_image_draw_unscaled_mul_alpha(src, dst, dc, src_offset, | ||
231 | dst_offset, width, height, a); | ||
232 | else | ||
233 | _soft8_image_draw_unscaled_mul_color(src, dst, dc, src_offset, | ||
234 | dst_offset, width, height, | ||
235 | r, g, b, a); | ||
236 | } | ||
237 | |||
238 | void | ||
239 | evas_common_soft8_image_draw_unscaled(Soft8_Image * src, Soft8_Image * dst, | ||
240 | RGBA_Draw_Context * dc, | ||
241 | const Eina_Rectangle sr, | ||
242 | const Eina_Rectangle dr, const Eina_Rectangle cr) | ||
243 | { | ||
244 | int src_offset_rows, src_offset, dst_offset; | ||
245 | DATA8 mul_gry8; | ||
246 | DATA8 r, g, b, a; | ||
247 | |||
248 | if (!dc->mul.use) | ||
249 | { | ||
250 | r = g = b = a = 0xff; | ||
251 | mul_gry8 = 0xff; | ||
252 | } | ||
253 | else | ||
254 | { | ||
255 | a = A_VAL(&dc->mul.col); | ||
256 | if (a == 0) | ||
257 | return; | ||
258 | |||
259 | r = R_VAL(&dc->mul.col); | ||
260 | g = G_VAL(&dc->mul.col); | ||
261 | b = B_VAL(&dc->mul.col); | ||
262 | |||
263 | if (r > a) | ||
264 | r = a; | ||
265 | if (g > a) | ||
266 | g = a; | ||
267 | if (b > a) | ||
268 | b = a; | ||
269 | |||
270 | mul_gry8 = GRY_8_FROM_COMPONENTS(r, g, b); | ||
271 | } | ||
272 | |||
273 | src_offset_rows = (cr.y - dr.y) + sr.y; | ||
274 | src_offset = (src_offset_rows * src->stride) + (cr.x - dr.x) + sr.x; | ||
275 | |||
276 | dst_offset = cr.x + (cr.y * dst->stride); | ||
277 | |||
278 | if (mul_gry8 == 0xff) | ||
279 | _soft8_image_draw_unscaled_no_mul(src, dst, dc, src_offset, dst_offset, | ||
280 | cr.w, cr.h); | ||
281 | else | ||
282 | _soft8_image_draw_unscaled_mul(src, dst, dc, src_offset, dst_offset, | ||
283 | cr.w, cr.h, r, g, b, a); | ||
284 | } | ||