summaryrefslogtreecommitdiff
path: root/src/static_libs
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-01-17 16:13:35 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-04-14 11:26:42 +0900
commit0740010a061d15a4ecaa00dc21c10301e0af4847 (patch)
treeecd597c41438ca03a1f85cfb5a09bfbcffe6d094 /src/static_libs
parentf370ea803b977c245f173bae1b3b904e9bb68e38 (diff)
evas filters: Move blend to software_generic (1/8)
This is an attempt at refactoring the filters code so I can later implement GL support. This patch adds a few extra changes to remove avoid calling functions of libevas from the software engine: use the draw functions from static_libs/draw rather than evas_common APIs.
Diffstat (limited to 'src/static_libs')
-rw-r--r--src/static_libs/draw/draw.h9
-rw-r--r--src/static_libs/draw/draw_alpha_main.c8
-rw-r--r--src/static_libs/draw/draw_main.c12
3 files changed, 15 insertions, 14 deletions
diff --git a/src/static_libs/draw/draw.h b/src/static_libs/draw/draw.h
index 9f4089a..b3393d2 100644
--- a/src/static_libs/draw/draw.h
+++ b/src/static_libs/draw/draw.h
@@ -9,11 +9,12 @@
9#include "efl/interfaces/efl_gfx_types.eot.h" 9#include "efl/interfaces/efl_gfx_types.eot.h"
10 10
11/* FIXME: naming convention */ 11/* FIXME: naming convention */
12/* FIXME: mul_col & const_alpha are redondant */
12typedef void (*RGBA_Comp_Func) (uint32_t *dest, const uint32_t *src, int length, uint32_t mul_col, uint32_t const_alpha); 13typedef void (*RGBA_Comp_Func) (uint32_t *dest, const uint32_t *src, int length, uint32_t mul_col, uint32_t const_alpha);
13typedef void (*RGBA_Comp_Func_Solid) (uint32_t *dest, int length, uint32_t color, uint32_t const_alpha); 14typedef void (*RGBA_Comp_Func_Solid) (uint32_t *dest, int length, uint32_t color, uint32_t const_alpha);
14typedef void (*RGBA_Comp_Func_Mask) (uint32_t *dest, uint8_t *mask, int length, uint32_t color); 15typedef void (*RGBA_Comp_Func_Mask) (uint32_t *dest, const uint8_t *mask, int length, uint32_t color);
15typedef void (*Draw_Func_ARGB_Mix3) (uint32_t *dest, uint32_t *src, uint32_t *mul, int len, uint32_t color); 16typedef void (*Draw_Func_ARGB_Mix3) (uint32_t *dest, const uint32_t *src, const uint32_t *mul, int len, uint32_t color);
16typedef void (*Alpha_Gfx_Func) (uint8_t *src, uint8_t *dst, int len); 17typedef void (*Draw_Func_Alpha) (uint8_t *dest, const uint8_t *src, int len);
17typedef 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); 18typedef 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);
18 19
19int efl_draw_init(void); 20int efl_draw_init(void);
@@ -22,7 +23,7 @@ RGBA_Comp_Func efl_draw_func_span_get (Efl_Gfx_Render_Op op, uint3
22RGBA_Comp_Func_Solid efl_draw_func_solid_span_get (Efl_Gfx_Render_Op op, uint32_t color); 23RGBA_Comp_Func_Solid efl_draw_func_solid_span_get (Efl_Gfx_Render_Op op, uint32_t color);
23RGBA_Comp_Func_Mask efl_draw_func_mask_span_get (Efl_Gfx_Render_Op op, uint32_t color); 24RGBA_Comp_Func_Mask efl_draw_func_mask_span_get (Efl_Gfx_Render_Op op, uint32_t color);
24Draw_Func_ARGB_Mix3 efl_draw_func_argb_mix3_get (Efl_Gfx_Render_Op op, uint32_t color); 25Draw_Func_ARGB_Mix3 efl_draw_func_argb_mix3_get (Efl_Gfx_Render_Op op, uint32_t color);
25Alpha_Gfx_Func efl_draw_alpha_func_get (Efl_Gfx_Render_Op op, Eina_Bool has_mask); 26Draw_Func_Alpha efl_draw_alpha_func_get (Efl_Gfx_Render_Op op, Eina_Bool has_mask);
26Cspace_Convert_Func efl_draw_convert_func_get (Efl_Gfx_Colorspace origcs, Efl_Gfx_Colorspace dstcs, Eina_Bool *region_can); 27Cspace_Convert_Func efl_draw_convert_func_get (Efl_Gfx_Colorspace origcs, Efl_Gfx_Colorspace dstcs, Eina_Bool *region_can);
27 28
28 29
diff --git a/src/static_libs/draw/draw_alpha_main.c b/src/static_libs/draw/draw_alpha_main.c
index ebd93e8..8424d95 100644
--- a/src/static_libs/draw/draw_alpha_main.c
+++ b/src/static_libs/draw/draw_alpha_main.c
@@ -2,7 +2,7 @@
2 2
3/** default op: d = d*(1-sa) + s */ 3/** default op: d = d*(1-sa) + s */
4static void 4static void
5_alpha_func_blend(uint8_t *src, uint8_t *dst, int len) 5_alpha_func_blend(uint8_t *dst, const uint8_t *src, int len)
6{ 6{
7 int k; 7 int k;
8 8
@@ -19,7 +19,7 @@ _alpha_func_blend(uint8_t *src, uint8_t *dst, int len)
19 19
20/** d = s */ 20/** d = s */
21static void 21static void
22_alpha_func_copy(uint8_t *src, uint8_t *dst, int len) 22_alpha_func_copy(uint8_t *dst, const uint8_t *src, int len)
23{ 23{
24 EINA_SAFETY_ON_NULL_RETURN(src); 24 EINA_SAFETY_ON_NULL_RETURN(src);
25 EINA_SAFETY_ON_NULL_RETURN(dst); 25 EINA_SAFETY_ON_NULL_RETURN(dst);
@@ -29,7 +29,7 @@ _alpha_func_copy(uint8_t *src, uint8_t *dst, int len)
29 29
30/** d = d*s */ 30/** d = d*s */
31static void 31static void
32_alpha_func_mul(uint8_t *src, uint8_t *dst, int len) 32_alpha_func_mul(uint8_t *dst, const uint8_t *src, int len)
33{ 33{
34 int k; 34 int k;
35 35
@@ -44,7 +44,7 @@ _alpha_func_mul(uint8_t *src, uint8_t *dst, int len)
44 } 44 }
45} 45}
46 46
47Alpha_Gfx_Func 47Draw_Func_Alpha
48efl_draw_alpha_func_get(Efl_Gfx_Render_Op op, Eina_Bool has_mask) 48efl_draw_alpha_func_get(Efl_Gfx_Render_Op op, Eina_Bool has_mask)
49{ 49{
50 if (!has_mask) 50 if (!has_mask)
diff --git a/src/static_libs/draw/draw_main.c b/src/static_libs/draw/draw_main.c
index 8577bea..92d2044 100644
--- a/src/static_libs/draw/draw_main.c
+++ b/src/static_libs/draw/draw_main.c
@@ -133,7 +133,7 @@ _comp_func_source(uint32_t *dest, const uint32_t *src, int length, uint32_t colo
133 * d = d * (1-sa) + s * sa 133 * d = d * (1-sa) + s * sa
134 */ 134 */
135static void 135static void
136_comp_func_mask_blend(uint32_t *dest, uint8_t *mask, int length, uint32_t color) 136_comp_func_mask_blend(uint32_t *dest, const uint8_t *mask, int length, uint32_t color)
137{ 137{
138 int k; 138 int k;
139 139
@@ -149,7 +149,7 @@ _comp_func_mask_blend(uint32_t *dest, uint8_t *mask, int length, uint32_t color)
149 * d = s * sa 149 * d = s * sa
150 */ 150 */
151static void 151static void
152_comp_func_mask_copy(uint32_t *dest, uint8_t *mask, int length, uint32_t color) 152_comp_func_mask_copy(uint32_t *dest, const uint8_t *mask, int length, uint32_t color)
153{ 153{
154 int k; 154 int k;
155 155
@@ -163,7 +163,7 @@ _comp_func_mask_copy(uint32_t *dest, uint8_t *mask, int length, uint32_t color)
163 * d = d * (1-wa) + w * wa 163 * d = d * (1-wa) + w * wa
164 */ 164 */
165static void 165static void
166_comp_func_mix3_blend(uint32_t *dest, uint32_t *src, uint32_t *mul, int len, uint32_t color) 166_comp_func_mix3_blend(uint32_t *dest, const uint32_t *src, const uint32_t *mul, int len, uint32_t color)
167{ 167{
168 int k, a; 168 int k, a;
169 169
@@ -178,7 +178,7 @@ _comp_func_mix3_blend(uint32_t *dest, uint32_t *src, uint32_t *mul, int len, uin
178 178
179/* d = s * m * c */ 179/* d = s * m * c */
180static void 180static void
181_comp_func_mix3_copy(uint32_t *dest, uint32_t *src, uint32_t *mul, int len, uint32_t color) 181_comp_func_mix3_copy(uint32_t *dest, const uint32_t *src, const uint32_t *mul, int len, uint32_t color)
182{ 182{
183 int k; 183 int k;
184 184
@@ -193,7 +193,7 @@ _comp_func_mix3_copy(uint32_t *dest, uint32_t *src, uint32_t *mul, int len, uint
193 * d = d * (1-wa) + w * wa 193 * d = d * (1-wa) + w * wa
194 */ 194 */
195static void 195static void
196_comp_func_mix3_blend_nomul(uint32_t *dest, uint32_t *src, uint32_t *mul, int len, uint32_t color EINA_UNUSED) 196_comp_func_mix3_blend_nomul(uint32_t *dest, const uint32_t *src, const uint32_t *mul, int len, uint32_t color EINA_UNUSED)
197{ 197{
198 int k, a; 198 int k, a;
199 199
@@ -207,7 +207,7 @@ _comp_func_mix3_blend_nomul(uint32_t *dest, uint32_t *src, uint32_t *mul, int le
207 207
208/* d = s * m */ 208/* d = s * m */
209static void 209static void
210_comp_func_mix3_copy_nomul(uint32_t *dest, uint32_t *src, uint32_t *mul, int len, uint32_t color EINA_UNUSED) 210_comp_func_mix3_copy_nomul(uint32_t *dest, const uint32_t *src, const uint32_t *mul, int len, uint32_t color EINA_UNUSED)
211{ 211{
212 int k; 212 int k;
213 213