summaryrefslogtreecommitdiff
path: root/src/static_libs/draw
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2015-12-03 20:15:17 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-12-03 20:28:27 +0900
commitc09199f0e036a4abb806dbc9fca4960316ecdd08 (patch)
tree59a97974def195fc0ede4f58130e44288c7b8450 /src/static_libs/draw
parent648cef1db1b96e5d5dbae58f0dafa78e67958903 (diff)
Ector: use uint32_t instead of uint
This fixes the build for Windows. Thanks @vtorri for the report. I'm not using "unsigned int" as uint was mostly used like DATA32, ie. color data (one pixel color or a pixel buffer).
Diffstat (limited to 'src/static_libs/draw')
-rw-r--r--src/static_libs/draw/draw.h16
-rw-r--r--src/static_libs/draw/draw_main.c18
-rw-r--r--src/static_libs/draw/draw_main_neon.c4
-rw-r--r--src/static_libs/draw/draw_main_sse2.c16
4 files changed, 27 insertions, 27 deletions
diff --git a/src/static_libs/draw/draw.h b/src/static_libs/draw/draw.h
index ae00cc26fd..c25517d93e 100644
--- a/src/static_libs/draw/draw.h
+++ b/src/static_libs/draw/draw.h
@@ -7,14 +7,14 @@
7 7
8#include <Efl.h> 8#include <Efl.h>
9 9
10typedef void (*RGBA_Comp_Func) (uint *dest, const uint *src, int length, uint mul_col, uint const_alpha); 10typedef void (*RGBA_Comp_Func) (uint32_t *dest, const uint32_t *src, int length, uint32_t mul_col, uint32_t const_alpha);
11typedef void (*RGBA_Comp_Func_Solid) (uint *dest, int length, uint color, uint const_alpha); 11typedef void (*RGBA_Comp_Func_Solid) (uint32_t *dest, int length, uint32_t color, uint32_t const_alpha);
12typedef void (*Alpha_Gfx_Func) (uint8_t *src, uint8_t *dst, int len); 12typedef void (*Alpha_Gfx_Func) (uint8_t *src, uint8_t *dst, int len);
13 13
14int efl_draw_init(void); 14int efl_draw_init(void);
15 15
16RGBA_Comp_Func efl_draw_func_span_get(Efl_Gfx_Render_Op op, uint color, Eina_Bool src_alpha); 16RGBA_Comp_Func efl_draw_func_span_get(Efl_Gfx_Render_Op op, uint32_t color, Eina_Bool src_alpha);
17RGBA_Comp_Func_Solid efl_draw_func_solid_span_get(Efl_Gfx_Render_Op op, uint color); 17RGBA_Comp_Func_Solid efl_draw_func_solid_span_get(Efl_Gfx_Render_Op op, uint32_t color);
18Alpha_Gfx_Func efl_draw_alpha_func_get(Efl_Gfx_Render_Op op, Eina_Bool has_mask); 18Alpha_Gfx_Func efl_draw_alpha_func_get(Efl_Gfx_Render_Op op, Eina_Bool has_mask);
19 19
20 20
@@ -61,10 +61,10 @@ Alpha_Gfx_Func efl_draw_alpha_func_get(Efl_Gfx_Render_Op op, Eina_Bool has_mask)
61 ( (((((c) >> 8) & 0x00ff00ff) * (a)) & 0xff00ff00) + \ 61 ( (((((c) >> 8) & 0x00ff00ff) * (a)) & 0xff00ff00) + \
62 (((((c) & 0x00ff00ff) * (a)) >> 8) & 0x00ff00ff) ) 62 (((((c) & 0x00ff00ff) * (a)) >> 8) & 0x00ff00ff) )
63 63
64static inline uint 64static inline uint32_t
65draw_interpolate_256(uint x, uint a, uint y, uint b) 65draw_interpolate_256(uint32_t x, uint32_t a, uint32_t y, uint32_t b)
66{ 66{
67 uint t = (x & 0xff00ff) * a + (y & 0xff00ff) * b; 67 uint32_t t = (x & 0xff00ff) * a + (y & 0xff00ff) * b;
68 t >>= 8; 68 t >>= 8;
69 t &= 0xff00ff; 69 t &= 0xff00ff;
70 x = ((x >> 8) & 0xff00ff) * a + ((y >> 8) & 0xff00ff) * b; 70 x = ((x >> 8) & 0xff00ff) * a + ((y >> 8) & 0xff00ff) * b;
@@ -74,7 +74,7 @@ draw_interpolate_256(uint x, uint a, uint y, uint b)
74} 74}
75 75
76static inline void 76static inline void
77draw_memset32(uint *dest, uint value, int length) 77draw_memset32(uint32_t *dest, uint32_t value, int length)
78{ 78{
79 int n; 79 int n;
80 80
diff --git a/src/static_libs/draw/draw_main.c b/src/static_libs/draw/draw_main.c
index 8db3d20885..1d19de3a1a 100644
--- a/src/static_libs/draw/draw_main.c
+++ b/src/static_libs/draw/draw_main.c
@@ -22,7 +22,7 @@
22*/ 22*/
23 23
24static void 24static void
25_comp_func_solid_source_over(uint *dest, int length, uint color, uint const_alpha) 25_comp_func_solid_source_over(uint32_t *dest, int length, uint32_t color, uint32_t const_alpha)
26{ 26{
27 int ialpha, i; 27 int ialpha, i;
28 28
@@ -34,10 +34,10 @@ _comp_func_solid_source_over(uint *dest, int length, uint color, uint const_alph
34} 34}
35 35
36static void 36static void
37_comp_func_source_over(uint *dest, const uint *src, int length, uint color, uint const_alpha) 37_comp_func_source_over(uint32_t *dest, const uint32_t *src, int length, uint32_t color, uint32_t const_alpha)
38{ 38{
39 int i; 39 int i;
40 uint s, sc, sia; 40 uint32_t s, sc, sia;
41 41
42 if (const_alpha != 255) 42 if (const_alpha != 255)
43 color = DRAW_BYTE_MUL(color, const_alpha); 43 color = DRAW_BYTE_MUL(color, const_alpha);
@@ -73,7 +73,7 @@ _comp_func_source_over(uint *dest, const uint *src, int length, uint color, uint
73 dest = s * ca + d * cia 73 dest = s * ca + d * cia
74*/ 74*/
75static void 75static void
76_comp_func_solid_source(uint *dest, int length, uint color, uint const_alpha) 76_comp_func_solid_source(uint32_t *dest, int length, uint32_t color, uint32_t const_alpha)
77{ 77{
78 int ialpha, i; 78 int ialpha, i;
79 79
@@ -91,16 +91,16 @@ _comp_func_solid_source(uint *dest, int length, uint color, uint const_alpha)
91} 91}
92 92
93static void 93static void
94_comp_func_source(uint *dest, const uint *src, int length, uint color, uint const_alpha) 94_comp_func_source(uint32_t *dest, const uint32_t *src, int length, uint32_t color, uint32_t const_alpha)
95{ 95{
96 int i, ialpha; 96 int i, ialpha;
97 uint src_color; 97 uint32_t src_color;
98 98
99 if (color == 0xffffffff) // No color multiplier 99 if (color == 0xffffffff) // No color multiplier
100 { 100 {
101 if (const_alpha == 255) 101 if (const_alpha == 255)
102 { 102 {
103 memcpy(dest, src, length * sizeof(uint)); 103 memcpy(dest, src, length * sizeof(uint32_t));
104 } 104 }
105 else 105 else
106 { 106 {
@@ -139,7 +139,7 @@ RGBA_Comp_Func func_for_mode[EFL_GFX_RENDER_OP_LAST] = {
139}; 139};
140 140
141RGBA_Comp_Func_Solid 141RGBA_Comp_Func_Solid
142efl_draw_func_solid_span_get(Efl_Gfx_Render_Op op, uint color) 142efl_draw_func_solid_span_get(Efl_Gfx_Render_Op op, uint32_t color)
143{ 143{
144 if ((color & 0xff000000) == 0xff000000) 144 if ((color & 0xff000000) == 0xff000000)
145 { 145 {
@@ -150,7 +150,7 @@ efl_draw_func_solid_span_get(Efl_Gfx_Render_Op op, uint color)
150} 150}
151 151
152RGBA_Comp_Func 152RGBA_Comp_Func
153efl_draw_func_span_get(Efl_Gfx_Render_Op op, uint color, Eina_Bool src_alpha) 153efl_draw_func_span_get(Efl_Gfx_Render_Op op, uint32_t color, Eina_Bool src_alpha)
154{ 154{
155 if (((color & 0xff000000) == 0xff000000) && !src_alpha) 155 if (((color & 0xff000000) == 0xff000000) && !src_alpha)
156 { 156 {
diff --git a/src/static_libs/draw/draw_main_neon.c b/src/static_libs/draw/draw_main_neon.c
index 2d87d6933f..044114733e 100644
--- a/src/static_libs/draw/draw_main_neon.c
+++ b/src/static_libs/draw/draw_main_neon.c
@@ -9,7 +9,7 @@
9#include <arm_neon.h> 9#include <arm_neon.h>
10 10
11static void 11static void
12comp_func_solid_source_over_neon(uint * __restrict dest, int length, uint color, uint const_alpha) 12comp_func_solid_source_over_neon(uint32_t * __restrict dest, int length, uint32_t color, uint32_t const_alpha)
13{ 13{
14 uint16x8_t temp00_16x8; 14 uint16x8_t temp00_16x8;
15 uint16x8_t temp01_16x8; 15 uint16x8_t temp01_16x8;
@@ -100,7 +100,7 @@ comp_func_solid_source_over_neon(uint * __restrict dest, int length, uint color,
100/* Note: Optimisation is based on keeping _dest_ aligned: else it's a pair of 100/* Note: Optimisation is based on keeping _dest_ aligned: else it's a pair of
101 * reads, then two writes, a miss on read is 'just' two reads */ 101 * reads, then two writes, a miss on read is 'just' two reads */
102static void 102static void
103comp_func_source_over_sse2(uint * __restrict dest, const uint * __restrict src, int length, uint color, uint const_alpha) 103comp_func_source_over_sse2(uint32_t * __restrict dest, const uint32_t * __restrict src, int length, uint32_t color, uint32_t const_alpha)
104{ 104{
105 uint16x8_t ad0_16x8; 105 uint16x8_t ad0_16x8;
106 uint16x8_t ad1_16x8; 106 uint16x8_t ad1_16x8;
diff --git a/src/static_libs/draw/draw_main_sse2.c b/src/static_libs/draw/draw_main_sse2.c
index c07234a4f8..e8f934055b 100644
--- a/src/static_libs/draw/draw_main_sse2.c
+++ b/src/static_libs/draw/draw_main_sse2.c
@@ -118,7 +118,7 @@ v4_ialpha_sse2(__m128i c)
118 118
119// dest = color + (dest * alpha) 119// dest = color + (dest * alpha)
120inline static void 120inline static void
121comp_func_helper_sse2 (uint *dest, int length, uint color, uint alpha) 121comp_func_helper_sse2(uint32_t *dest, int length, uint32_t color, uint32_t alpha)
122{ 122{
123 const __m128i v_color = _mm_set1_epi32(color); 123 const __m128i v_color = _mm_set1_epi32(color);
124 const __m128i v_a = _mm_set1_epi16(alpha); 124 const __m128i v_a = _mm_set1_epi16(alpha);
@@ -141,7 +141,7 @@ comp_func_helper_sse2 (uint *dest, int length, uint color, uint alpha)
141} 141}
142 142
143void 143void
144comp_func_solid_source_sse2(uint *dest, int length, uint color, uint const_alpha) 144comp_func_solid_source_sse2(uint32_t *dest, int length, uint32_t color, uint32_t const_alpha)
145{ 145{
146 if (const_alpha == 255) 146 if (const_alpha == 255)
147 { 147 {
@@ -158,7 +158,7 @@ comp_func_solid_source_sse2(uint *dest, int length, uint color, uint const_alpha
158} 158}
159 159
160void 160void
161comp_func_solid_source_over_sse2(uint *dest, int length, uint color, uint const_alpha) 161comp_func_solid_source_over_sse2(uint32_t *dest, int length, uint32_t color, uint32_t const_alpha)
162{ 162{
163 int ialpha; 163 int ialpha;
164 164
@@ -202,16 +202,16 @@ comp_func_solid_source_over_sse2(uint *dest, int length, uint color, uint const_
202 v_src = v4_interpolate_color_sse2(v_alpha, v_src, v_dest); 202 v_src = v4_interpolate_color_sse2(v_alpha, v_src, v_dest);
203 203
204static void 204static void
205comp_func_source_sse2(uint *dest, const uint *src, int length, uint color, uint const_alpha) 205comp_func_source_sse2(uint32_t *dest, const uint32_t *src, int length, uint32_t color, uint32_t const_alpha)
206{ 206{
207 int ialpha; 207 int ialpha;
208 uint src_color; 208 uint32_t src_color;
209 209
210 if (color == 0xffffffff) // No color multiplier 210 if (color == 0xffffffff) // No color multiplier
211 { 211 {
212 if (const_alpha == 255) 212 if (const_alpha == 255)
213 { 213 {
214 memcpy(dest, src, length * sizeof(uint)); 214 memcpy(dest, src, length * sizeof(uint32_t));
215 } 215 }
216 else 216 else
217 { 217 {
@@ -272,9 +272,9 @@ comp_func_source_sse2(uint *dest, const uint *src, int length, uint color, uint
272} 272}
273 273
274static void 274static void
275comp_func_source_over_sse2(uint *dest, const uint *src, int length, uint color, uint const_alpha) 275comp_func_source_over_sse2(uint32_t *dest, const uint32_t *src, int length, uint32_t color, uint32_t const_alpha)
276{ 276{
277 uint s, sia; 277 uint32_t s, sia;
278 278
279 if (const_alpha != 255) 279 if (const_alpha != 255)
280 color = DRAW_BYTE_MUL(color, const_alpha); 280 color = DRAW_BYTE_MUL(color, const_alpha);