summaryrefslogtreecommitdiff
path: root/src/static_libs/draw
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-03-22 16:57:52 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-03-28 16:40:01 +0900
commit078117d367afff6862b72bec8bbc29909b259fd4 (patch)
tree336ef32402571048ef47bcfd63a86744c57b170f /src/static_libs/draw
parent39a970835b58fe82a0e2cb0f809c5ecdee201861 (diff)
draw: Import or implement some colorspace conversion routines
Those and many more will be required for proper map/unmap support. There will be problems with planar formats: YUV, RGB565_A5P, ETC1_ALPHA The quick solution to this problem is to not support region conversions, only full-image (so we can assume the location of the various planes in memory).
Diffstat (limited to 'src/static_libs/draw')
-rw-r--r--src/static_libs/draw/draw.h2
-rw-r--r--src/static_libs/draw/draw_convert.c527
-rw-r--r--src/static_libs/draw/draw_main.c3
-rw-r--r--src/static_libs/draw/draw_private.h27
4 files changed, 559 insertions, 0 deletions
diff --git a/src/static_libs/draw/draw.h b/src/static_libs/draw/draw.h
index 51bf917a30..b63b73d2e0 100644
--- a/src/static_libs/draw/draw.h
+++ b/src/static_libs/draw/draw.h
@@ -13,6 +13,7 @@ typedef void (*RGBA_Comp_Func_Solid) (uint32_t *dest, int length, uint32_t color
13typedef void (*RGBA_Comp_Func_Mask) (uint32_t *dest, uint8_t *mask, int length, uint32_t color); 13typedef void (*RGBA_Comp_Func_Mask) (uint32_t *dest, uint8_t *mask, int length, uint32_t color);
14typedef void (*Draw_Func_ARGB_Mix3) (uint32_t *dest, uint32_t *src, uint32_t *mul, int len, uint32_t color); 14typedef void (*Draw_Func_ARGB_Mix3) (uint32_t *dest, uint32_t *src, uint32_t *mul, int len, uint32_t color);
15typedef void (*Alpha_Gfx_Func) (uint8_t *src, uint8_t *dst, int len); 15typedef void (*Alpha_Gfx_Func) (uint8_t *src, uint8_t *dst, int len);
16typedef Eina_Bool (*Cspace_Convert_Func) (void *dst, const void *src, int w, int h, int src_stride, int dst_stride, Eina_Bool has_alpha, Efl_Gfx_Colorspace srccs, Efl_Gfx_Colorspace dstcs);
16 17
17int efl_draw_init(void); 18int efl_draw_init(void);
18 19
@@ -21,6 +22,7 @@ RGBA_Comp_Func_Solid efl_draw_func_solid_span_get (Efl_Gfx_Render_Op op, uint3
21RGBA_Comp_Func_Mask efl_draw_func_mask_span_get (Efl_Gfx_Render_Op op, uint32_t color); 22RGBA_Comp_Func_Mask efl_draw_func_mask_span_get (Efl_Gfx_Render_Op op, uint32_t color);
22Draw_Func_ARGB_Mix3 efl_draw_func_argb_mix3_get (Efl_Gfx_Render_Op op, uint32_t color); 23Draw_Func_ARGB_Mix3 efl_draw_func_argb_mix3_get (Efl_Gfx_Render_Op op, uint32_t color);
23Alpha_Gfx_Func efl_draw_alpha_func_get (Efl_Gfx_Render_Op op, Eina_Bool has_mask); 24Alpha_Gfx_Func efl_draw_alpha_func_get (Efl_Gfx_Render_Op op, Eina_Bool has_mask);
25Cspace_Convert_Func efl_draw_convert_func_get (Efl_Gfx_Colorspace origcs, Efl_Gfx_Colorspace dstcs, Eina_Bool *region_can);
24 26
25 27
26/* common sw draw helpers */ 28/* common sw draw helpers */
diff --git a/src/static_libs/draw/draw_convert.c b/src/static_libs/draw/draw_convert.c
new file mode 100644
index 0000000000..6e1a35b29d
--- /dev/null
+++ b/src/static_libs/draw/draw_convert.c
@@ -0,0 +1,527 @@
1#include "draw.h"
2#include "draw_private.h"
3#include "../rg_etc/rg_etc1.h"
4
5#if DIV_USING_BITSHIFT
6# define DEFINE_DIVIDER(div) const int pow2 = _pow2_geq((div) << 10); const int numerator = (1 << pow2) / (div);
7# define DIVIDE(val) (((val) * numerator) >> pow2)
8#else
9# define DEFINE_DIVIDER(div) const int divider = (div);
10# define DIVIDE(val) ((val) / divider)
11#endif
12
13#define CONVERT_RGB_565_TO_RGB_888(s) \
14 (((((s) << 3) & 0xf8) | (((s) >> 2) & 0x7)) | \
15 ((((s) << 5) & 0xfc00) | (((s) >> 1) & 0x300)) | \
16 ((((s) << 8) & 0xf80000) | (((s) << 3) & 0x70000)))
17
18#define CONVERT_A5P_TO_A8(s) \
19 ((((s) << 3) & 0xf8) | (((s) >> 2) & 0x7))
20
21#define CONVERT_ARGB_8888_TO_A_8(s) ((s) >> 24)
22
23// finds smallest power of 2 above val
24static int
25_pow2_geq(int val)
26{
27 for (int n = 0; n < 32; n++)
28 if (val <= (1 << n))
29 return n;
30
31 return 32; // impossible
32}
33
34static Eina_Bool
35_convert_gry8_to_argb8888(void *dst, const void *src, int w, int h,
36 int src_stride, int dst_stride, Eina_Bool has_alpha,
37 Efl_Gfx_Colorspace srccs EINA_UNUSED,
38 Efl_Gfx_Colorspace dstcs EINA_UNUSED)
39{
40 const uint8_t *in = src;
41 uint32_t *out = dst;
42 int in_step, out_step, x, y;
43
44 if (!src_stride) src_stride = w;
45 if (!dst_stride) dst_stride = w * 4;
46 in_step = src_stride;
47 out_step = dst_stride / 4;
48
49 if (has_alpha)
50 {
51 // transparent white
52 for (y = 0; y < h; y++)
53 {
54 for (x = 0; x < w; x++)
55 {
56 int c = in[x];
57 out[x] = DRAW_ARGB_JOIN(c, c, c, c);
58 }
59 in += in_step;
60 out += out_step;
61 }
62 }
63 else
64 {
65 // opaque grayscale
66 for (y = 0; y < h; y++)
67 {
68 for (x = 0; x < w; x++)
69 {
70 int c = in[x];
71 out[x] = DRAW_ARGB_JOIN(0xFF, c, c, c);
72 }
73 in += in_step;
74 out += out_step;
75 }
76 }
77
78 return EINA_TRUE;
79}
80
81static Eina_Bool
82_convert_agry88_to_argb8888(void *dst, const void *src, int w, int h,
83 int src_stride, int dst_stride, Eina_Bool has_alpha,
84 Efl_Gfx_Colorspace srccs EINA_UNUSED,
85 Efl_Gfx_Colorspace dstcs EINA_UNUSED)
86{
87 const uint16_t *in = src;
88 uint32_t *out = dst;
89 int in_step, out_step, x, y;
90
91 if (!src_stride) src_stride = w * 2;
92 if (!dst_stride) dst_stride = w * 4;
93 in_step = src_stride / 2;
94 out_step = dst_stride / 4;
95
96 if (has_alpha)
97 {
98 for (y = 0; y < h; y++)
99 {
100 for (x = 0; x < w; x++)
101 {
102 int c = in[x] & 0xFF;
103 int a = in[x] >> 8;
104 out[x] = DRAW_ARGB_JOIN(a, c, c, c);
105 }
106 in += in_step;
107 out += out_step;
108 }
109 }
110 else
111 {
112 for (y = 0; y < h; y++)
113 {
114 for (x = 0; x < w; x++)
115 {
116 int c = in[x] & 0xFF;
117 out[x] = DRAW_ARGB_JOIN(0xFF, c, c, c);
118 }
119 in += in_step;
120 out += out_step;
121 }
122 }
123
124 return EINA_TRUE;
125}
126
127static Eina_Bool
128_convert_argb8888_to_gry8(void *dst, const void *src, int w, int h,
129 int src_stride, int dst_stride, Eina_Bool has_alpha,
130 Efl_Gfx_Colorspace srccs EINA_UNUSED,
131 Efl_Gfx_Colorspace dstcs EINA_UNUSED)
132{
133 const uint32_t *in = src;
134 uint8_t *out = dst;
135 int in_step, out_step, x, y;
136#if RGBA2LUM_WEIGHTED
137 const int WR = 299;
138 const int WG = 587;
139 const int WB = 114;
140#else
141 const int WR = 1;
142 const int WG = 1;
143 const int WB = 1;
144#endif
145 DEFINE_DIVIDER(WR + WG + WB);
146
147 if (!src_stride) src_stride = w * 4;
148 if (!dst_stride) dst_stride = w;
149 in_step = src_stride / 4;
150 out_step = dst_stride;
151
152 if (has_alpha)
153 {
154 // copy only alpha
155 for (y = 0; y < h; y++)
156 {
157 for (x = 0; x < w; x++)
158 out[x] = A_VAL(in + x);
159 in += in_step;
160 out += out_step;
161 }
162 }
163 else
164 {
165 // copy only color to grayscale
166 for (y = 0; y < h; y++)
167 {
168 for (x = 0; x < w; x++)
169 out[x] = DIVIDE((R_VAL(in + x) * WR) + (G_VAL(in + x) * WG) + (B_VAL(in + x) * WB));
170 in += in_step;
171 out += out_step;
172 }
173 }
174
175 return EINA_TRUE;
176}
177
178static Eina_Bool
179_convert_argb8888_to_agry88(void *dst, const void *src, int w, int h,
180 int src_stride, int dst_stride, Eina_Bool has_alpha,
181 Efl_Gfx_Colorspace srccs EINA_UNUSED,
182 Efl_Gfx_Colorspace dstcs EINA_UNUSED)
183{
184 const uint32_t *in = src;
185 uint16_t *out = dst;
186 int in_step, out_step, x, y;
187#if RGBA2LUM_WEIGHTED
188 const int WR = 299;
189 const int WG = 587;
190 const int WB = 114;
191#else
192 const int WR = 1;
193 const int WG = 1;
194 const int WB = 1;
195#endif
196 DEFINE_DIVIDER(WR + WG + WB);
197
198 if (!src_stride) src_stride = w * 4;
199 if (!dst_stride) dst_stride = w * 2;
200 in_step = src_stride / 4;
201 out_step = dst_stride / 2;
202
203 if (has_alpha)
204 {
205 // copy only alpha
206 for (y = 0; y < h; y++)
207 {
208 for (x = 0; x < w; x++)
209 {
210 int a = A_VAL(in + x);
211 int c = DIVIDE((R_VAL(in + x) * WR) + (G_VAL(in + x) * WG) + (B_VAL(in + x) * WB));
212 out[x] = (a << 8) | c;
213 }
214 in += in_step;
215 out += out_step;
216 }
217 }
218 else
219 {
220 // copy only color to grayscale
221 for (y = 0; y < h; y++)
222 {
223 for (x = 0; x < w; x++)
224 {
225 int c = DIVIDE((R_VAL(in + x) * WR) + (G_VAL(in + x) * WG) + (B_VAL(in + x) * WB));
226 out[x] = 0xFF00 | c;
227 }
228 in += in_step;
229 out += out_step;
230 }
231 }
232
233 return EINA_TRUE;
234}
235
236static Eina_Bool
237_convert_rgb565_a5p_to_argb8888(void *dst, const void *src, int w, int h,
238 int src_stride, int dst_stride, Eina_Bool has_alpha,
239 Efl_Gfx_Colorspace srccs EINA_UNUSED,
240 Efl_Gfx_Colorspace dstcs EINA_UNUSED)
241{
242 const uint16_t *in = src;
243 const uint8_t *in_alpha;
244 uint32_t *out = dst;
245 int in_step, out_step, a_step, x, y;
246
247 if (!src_stride) src_stride = w * 2;
248 if (!dst_stride) dst_stride = w * 4;
249 in_step = src_stride / 2;
250 a_step = src_stride;
251 out_step = dst_stride / 4;
252
253 // no region support (2 planes): basic safety check (can't verify h)
254 EINA_SAFETY_ON_FALSE_RETURN_VAL((src_stride == (w * 2)) && (dst_stride == (w * 4)), EINA_FALSE);
255
256 if (has_alpha)
257 {
258 in_alpha = ((uint8_t *) in) + (src_stride * h);
259 for (y = 0; y < h; y++)
260 {
261 for (x = 0; x < w; x++)
262 {
263 int a = CONVERT_A5P_TO_A8(in_alpha[x]);
264 int c = CONVERT_RGB_565_TO_RGB_888(in[x]);
265 out[x] = (a << 24) | c;
266 }
267 in_alpha += a_step;
268 in += in_step;
269 out += out_step;
270 }
271 }
272 else
273 {
274 for (y = 0; y < h; y++)
275 {
276 for (x = 0; x < w; x++)
277 {
278 int c = CONVERT_RGB_565_TO_RGB_888(in[x]);
279 out[x] = 0xFF000000 | c;
280 }
281 in += in_step;
282 out += out_step;
283 }
284 }
285
286 return EINA_TRUE;
287}
288
289static Eina_Bool
290_convert_etc2_rgb8_to_argb8888(void *dst, const void *src, int w, int h,
291 int src_stride, int dst_stride, Eina_Bool has_alpha,
292 Efl_Gfx_Colorspace srccs EINA_UNUSED,
293 Efl_Gfx_Colorspace dstcs EINA_UNUSED)
294{
295 const uint8_t *in = src;
296 uint32_t *out = dst;
297 int out_step, x, y, k;
298 unsigned int bgra[16];
299
300 EINA_SAFETY_ON_FALSE_RETURN_VAL(!(w & 3) && !(h & 3), EINA_FALSE);
301 EINA_SAFETY_ON_FALSE_RETURN_VAL(!has_alpha, EINA_FALSE);
302
303 // jumps lines 4 by 4
304 if (!src_stride) src_stride = w * 8 / 4;
305 if (!dst_stride) dst_stride = w * 4;
306 out_step = dst_stride / 4;
307
308 for (y = 0; y < h; y += 4)
309 {
310 for (x = 0; x < w; x += 4, in += 8)
311 {
312 rg_etc2_rgb8_decode_block(in, bgra);
313 for (k = 0; k < 4; k++)
314 memcpy(out + x + k * out_step, bgra + k * 16, 16);
315 }
316 }
317
318 return EINA_TRUE;
319}
320
321static Eina_Bool
322_convert_etc2_rgba8_to_argb8888(void *dst, const void *src, int w, int h,
323 int src_stride, int dst_stride, Eina_Bool has_alpha,
324 Efl_Gfx_Colorspace srccs EINA_UNUSED,
325 Efl_Gfx_Colorspace dstcs EINA_UNUSED)
326{
327 const uint8_t *in = src;
328 uint32_t *out = dst;
329 int out_step, x, y, k;
330 unsigned int bgra[16];
331
332 EINA_SAFETY_ON_FALSE_RETURN_VAL(!(w & 3) && !(h & 3), EINA_FALSE);
333 EINA_SAFETY_ON_FALSE_RETURN_VAL(!has_alpha, EINA_FALSE);
334
335 // jumps lines 4 by 4
336 if (!src_stride) src_stride = w * 16 / 4;
337 if (!dst_stride) dst_stride = w * 4;
338 out_step = dst_stride / 4;
339
340 for (y = 0; y < h; y += 4)
341 {
342 for (x = 0; x < w; x += 4, in += 16)
343 {
344 rg_etc2_rgba8_decode_block(in, bgra);
345 for (k = 0; k < 4; k++)
346 memcpy(out + x + k * out_step, bgra + k * 16, 16);
347 }
348 out += out_step * 4;
349 }
350
351 return EINA_TRUE;
352}
353
354static Eina_Bool
355_convert_etc1_alpha_to_argb8888(void *dst, const void *src, int w, int h,
356 int src_stride, int dst_stride, Eina_Bool has_alpha,
357 Efl_Gfx_Colorspace srccs EINA_UNUSED,
358 Efl_Gfx_Colorspace dstcs EINA_UNUSED)
359{
360 const uint8_t *in = src, *in_alpha;
361 uint32_t *out = dst;
362 int out_step, x, y, j, k;
363 unsigned int bgra[16], alpha[16];
364
365 EINA_SAFETY_ON_FALSE_RETURN_VAL(!(w & 3) && !(h & 3), EINA_FALSE);
366 EINA_SAFETY_ON_FALSE_RETURN_VAL(!has_alpha, EINA_FALSE);
367
368 // jumps lines 4 by 4
369 if (!src_stride) src_stride = w * 8 / 4;
370 if (!dst_stride) dst_stride = w * 4;
371 out_step = dst_stride / 4;
372
373 in_alpha = in + src_stride * h;
374
375 for (y = 0; y < h; y += 4)
376 {
377 for (x = 0; x < w; x += 4, in += 8, in_alpha += 8)
378 {
379 rg_etc2_rgba8_decode_block(in, bgra);
380 rg_etc2_rgba8_decode_block(in_alpha, alpha);
381 for (k = 0; k < 4; k++)
382 for (j = 0; j < 4; j++)
383 {
384 int a = (alpha[(k * 4) + j] & 0x00FF00) >> 8;
385 int c = (bgra[(k * 4) + j] & 0x00FFFFFF);
386 out[(k * out_step) + j] = (a << 24) | c;
387 }
388 }
389 out += out_step;
390 }
391
392 return EINA_TRUE;
393}
394
395static Eina_Bool
396_convert_generic_two_pass(void *dst, const void *src, int w, int h,
397 int src_stride, int dst_stride, Eina_Bool has_alpha,
398 Efl_Gfx_Colorspace srccs, Efl_Gfx_Colorspace dstcs)
399{
400 Cspace_Convert_Func to_argb = efl_draw_convert_func_get(srccs, EFL_GFX_COLORSPACE_ARGB8888, NULL);
401 Cspace_Convert_Func from_argb = efl_draw_convert_func_get(EFL_GFX_COLORSPACE_ARGB8888, dstcs, NULL);
402 uint32_t *argb;
403
404 EINA_SAFETY_ON_NULL_RETURN_VAL(to_argb, EINA_FALSE);
405 EINA_SAFETY_ON_NULL_RETURN_VAL(from_argb, EINA_FALSE);
406
407 argb = malloc(w * h * sizeof(uint32_t));
408 if (!argb) return EINA_FALSE;
409
410 if (!to_argb(argb, src, w, h, src_stride, 0, has_alpha, srccs, EFL_GFX_COLORSPACE_ARGB8888))
411 goto fail;
412
413 if (!from_argb(dst, argb, w, h, 0, dst_stride, has_alpha, EFL_GFX_COLORSPACE_ARGB8888, dstcs))
414 goto fail;
415
416 free(argb);
417 return EINA_TRUE;
418
419fail:
420 free(argb);
421 return EINA_FALSE;
422}
423
424Cspace_Convert_Func
425efl_draw_convert_func_get(Efl_Gfx_Colorspace srccs, Efl_Gfx_Colorspace dstcs,
426 Eina_Bool *region_can)
427{
428 Eina_Bool reg1 = EINA_FALSE, reg2 = EINA_FALSE;
429 Cspace_Convert_Func to_argb = NULL;
430 Cspace_Convert_Func from_argb = NULL;
431
432 EINA_SAFETY_ON_FALSE_RETURN_VAL(srccs != dstcs, NULL);
433
434 if (dstcs != EFL_GFX_COLORSPACE_ARGB8888)
435 to_argb = efl_draw_convert_func_get(srccs, EFL_GFX_COLORSPACE_ARGB8888, &reg1);
436
437 if (srccs != EFL_GFX_COLORSPACE_ARGB8888)
438 from_argb = efl_draw_convert_func_get(EFL_GFX_COLORSPACE_ARGB8888, dstcs, &reg2);
439
440 if (region_can) *region_can = EINA_TRUE;
441
442 switch (srccs)
443 {
444 case EFL_GFX_COLORSPACE_ARGB8888:
445 if (dstcs == EFL_GFX_COLORSPACE_GRY8)
446 return _convert_argb8888_to_gry8;
447 if (dstcs == EFL_GFX_COLORSPACE_AGRY88)
448 return _convert_argb8888_to_agry88;
449 break;
450
451 case EFL_GFX_COLORSPACE_GRY8:
452 if (dstcs == EFL_GFX_COLORSPACE_ARGB8888)
453 return _convert_gry8_to_argb8888;
454 break;
455
456 case EFL_GFX_COLORSPACE_AGRY88:
457 if (dstcs == EFL_GFX_COLORSPACE_ARGB8888)
458 return _convert_agry88_to_argb8888;
459 break;
460
461 case EFL_GFX_COLORSPACE_RGB565_A5P:
462 if (dstcs == EFL_GFX_COLORSPACE_ARGB8888)
463 {
464 // we could do regions, but we would need a pointer to the alpha plane.
465 if (region_can) *region_can = EINA_FALSE;
466 return _convert_rgb565_a5p_to_argb8888;
467 }
468 break;
469
470 case EFL_GFX_COLORSPACE_YCBCR422P601_PL:
471 case EFL_GFX_COLORSPACE_YCBCR422601_PL:
472 case EFL_GFX_COLORSPACE_YCBCR420NV12601_PL:
473 case EFL_GFX_COLORSPACE_YCBCR420TM12601_PL:
474 case EFL_GFX_COLORSPACE_YCBCR422P709_PL:
475 /* FIXME */
476
477 case EFL_GFX_COLORSPACE_ETC1:
478 case EFL_GFX_COLORSPACE_RGB8_ETC2:
479 if (dstcs == EFL_GFX_COLORSPACE_ARGB8888)
480 {
481 // we could do regions, but only if they are 4x4 aligned.
482 if (region_can) *region_can = EINA_FALSE;
483 return _convert_etc2_rgb8_to_argb8888;
484 }
485 break;
486
487 case EFL_GFX_COLORSPACE_RGBA8_ETC2_EAC:
488 if (dstcs == EFL_GFX_COLORSPACE_ARGB8888)
489 {
490 // we could do regions, but only if they are 4x4 aligned.
491 if (region_can) *region_can = EINA_FALSE;
492 return _convert_etc2_rgba8_to_argb8888;
493 }
494 break;
495
496 case EFL_GFX_COLORSPACE_ETC1_ALPHA:
497 if (dstcs == EFL_GFX_COLORSPACE_ARGB8888)
498 {
499 // we could do regions, but only if they are 4x4 aligned.
500 if (region_can) *region_can = EINA_FALSE;
501 return _convert_etc1_alpha_to_argb8888;
502 }
503 break;
504
505 case EFL_GFX_COLORSPACE_RGB_S3TC_DXT1:
506 case EFL_GFX_COLORSPACE_RGBA_S3TC_DXT1:
507 case EFL_GFX_COLORSPACE_RGBA_S3TC_DXT2:
508 case EFL_GFX_COLORSPACE_RGBA_S3TC_DXT3:
509 case EFL_GFX_COLORSPACE_RGBA_S3TC_DXT4:
510 case EFL_GFX_COLORSPACE_RGBA_S3TC_DXT5:
511 /* FIXME: can convert to ARGB */
512
513 default:
514 break;
515 }
516
517
518 // fallback to two-pass
519 if (to_argb && from_argb)
520 {
521 if (region_can) *region_can = (reg1 && reg2);
522 return _convert_generic_two_pass;
523 }
524
525 ERR("unsupported colorspace conversion from %d to %d", srccs, dstcs);
526 return NULL;
527}
diff --git a/src/static_libs/draw/draw_main.c b/src/static_libs/draw/draw_main.c
index 0e423aaa38..3d920639ab 100644
--- a/src/static_libs/draw/draw_main.c
+++ b/src/static_libs/draw/draw_main.c
@@ -5,6 +5,8 @@
5#include <Ector.h> 5#include <Ector.h>
6#include "draw_private.h" 6#include "draw_private.h"
7 7
8int _draw_log_dom = -1;
9
8/* 10/*
9 s = source pixel 11 s = source pixel
10 d = destination pixel 12 d = destination pixel
@@ -281,6 +283,7 @@ efl_draw_init()
281 static int i = 0; 283 static int i = 0;
282 if (!(i++)) 284 if (!(i++))
283 { 285 {
286 _draw_log_dom = eina_log_domain_register("efl_draw", EINA_COLOR_ORANGE);
284 efl_draw_sse2_init(); 287 efl_draw_sse2_init();
285 efl_draw_neon_init(); 288 efl_draw_neon_init();
286 } 289 }
diff --git a/src/static_libs/draw/draw_private.h b/src/static_libs/draw/draw_private.h
index c07d00a684..329ed113b4 100644
--- a/src/static_libs/draw/draw_private.h
+++ b/src/static_libs/draw/draw_private.h
@@ -25,6 +25,11 @@
25 } \ 25 } \
26 } 26 }
27 27
28// optimization
29#define DIV_USING_BITSHIFT 1
30// behaviour setting
31#define RGBA2LUM_WEIGHTED 1
32
28/* 255 - alpha */ 33/* 255 - alpha */
29static inline int 34static inline int
30alpha_inverse(uint32_t color) 35alpha_inverse(uint32_t color)
@@ -35,8 +40,30 @@ alpha_inverse(uint32_t color)
35 40
36extern RGBA_Comp_Func_Solid func_for_mode_solid[EFL_GFX_RENDER_OP_LAST]; 41extern RGBA_Comp_Func_Solid func_for_mode_solid[EFL_GFX_RENDER_OP_LAST];
37extern RGBA_Comp_Func func_for_mode[EFL_GFX_RENDER_OP_LAST]; 42extern RGBA_Comp_Func func_for_mode[EFL_GFX_RENDER_OP_LAST];
43extern int _draw_log_dom;
38 44
39void efl_draw_sse2_init(void); 45void efl_draw_sse2_init(void);
40void efl_draw_neon_init(void); 46void efl_draw_neon_init(void);
41 47
48#ifdef ERR
49# undef ERR
50#endif
51#define ERR(...) EINA_LOG_DOM_ERR(_draw_log_dom, __VA_ARGS__)
52#ifdef INF
53# undef INF
54#endif
55#define INF(...) EINA_LOG_DOM_INFO(_draw_log_dom, __VA_ARGS__)
56#ifdef WRN
57# undef WRN
58#endif
59#define WRN(...) EINA_LOG_DOM_WARN(_draw_log_dom, __VA_ARGS__)
60#ifdef CRI
61# undef CRI
62#endif
63#define CRI(...) EINA_LOG_DOM_CRIT(_draw_log_dom, __VA_ARGS__)
64#ifdef DBG
65# undef DBG
66#endif
67#define DBG(...) EINA_LOG_DOM_DBG(_draw_log_dom, __VA_ARGS__)
68
42#endif 69#endif