summaryrefslogtreecommitdiff
path: root/src/bin/evas/evas_cserve2_utils.c
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2013-07-01 17:52:06 +0900
committerCedric Bail <cedric.bail@samsung.com>2013-07-02 16:58:10 +0900
commit8db3d4d2bf6cea1c5ca7478170ba8dd3e67a5a5f (patch)
tree02dad28f6434054997446187949f1553301b7d43 /src/bin/evas/evas_cserve2_utils.c
parent90d8647c0238a80632033ed2b1c3ad3c896cac15 (diff)
evas/cserve2: remove dead code (old loaders API).
Remove: cserve-specific loaders and deprecated code. Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
Diffstat (limited to 'src/bin/evas/evas_cserve2_utils.c')
-rw-r--r--src/bin/evas/evas_cserve2_utils.c62
1 files changed, 9 insertions, 53 deletions
diff --git a/src/bin/evas/evas_cserve2_utils.c b/src/bin/evas/evas_cserve2_utils.c
index f606974f3a..c1921969b1 100644
--- a/src/bin/evas/evas_cserve2_utils.c
+++ b/src/bin/evas/evas_cserve2_utils.c
@@ -1,67 +1,23 @@
1#include "evas_cserve2_slave.h" 1#include "evas_cserve2_slave.h"
2 2
3static unsigned int 3Eina_Bool
4evas_cserve2_convert_argb_premul(unsigned int *data, unsigned int len) 4evas_cserve2_image_premul_data(unsigned int *data, unsigned int len)
5{ 5{
6 unsigned int *de = data + len; 6 unsigned int *de = data + len;
7 unsigned int nas = 0; 7 unsigned int nas = 0;
8 8
9 while (data < de) 9 while (data < de)
10 { 10 {
11 unsigned int a = 1 + (*data >> 24); 11 unsigned int a = 1 + (*data >> 24);
12 12
13 *data = (*data & 0xff000000) + 13 *data = (*data & 0xff000000) +
14 (((((*data) >> 8) & 0xff) * a) & 0xff00) + 14 (((((*data) >> 8) & 0xff) * a) & 0xff00) +
15 (((((*data) & 0x00ff00ff) * a) >> 8) & 0x00ff00ff); 15 (((((*data) & 0x00ff00ff) * a) >> 8) & 0x00ff00ff);
16 data++; 16 data++;
17 17
18 if ((a == 1) || (a == 256)) 18 if ((a == 1) || (a == 256))
19 nas++; 19 nas++;
20 } 20 }
21 21
22 return nas;
23}
24
25Eina_Bool
26evas_cserve2_image_premul_data(unsigned int *data, unsigned int len)
27{
28 unsigned int nas;
29
30 nas = evas_cserve2_convert_argb_premul(data, len);
31 return ((ALPHA_SPARSE_INV_FRACTION * nas) >= len); 22 return ((ALPHA_SPARSE_INV_FRACTION * nas) >= len);
32} 23}
33
34EAPI void
35evas_cserve2_image_premul(Evas_Img_Load_Params *ilp)
36{
37 unsigned int nas;
38
39 if (!ilp->alpha) return;
40
41 nas = evas_cserve2_convert_argb_premul(ilp->buffer, ilp->w * ilp->h);
42 if ((ALPHA_SPARSE_INV_FRACTION * nas) >= (ilp->w * ilp->h))
43 ilp->alpha_sparse = EINA_TRUE;
44}
45
46EAPI void
47evas_cserve2_imave_alpha_sparse_set(Evas_Img_Load_Params *ilp)
48{
49 unsigned int *s, *se;
50 unsigned int nas = 0;
51 unsigned int len = ilp->w * ilp->h;
52
53 if (!ilp->alpha) return;
54
55 s = ilp->buffer;
56 se = s + len;
57 while (s < se)
58 {
59 unsigned int p = *s & 0xff000000;
60
61 if (!p || (p == 0xff000000))
62 nas++;
63 s++;
64 }
65 if ((ALPHA_SPARSE_INV_FRACTION * nas) >= len)
66 ilp->alpha_sparse = EINA_TRUE;
67}