summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2017-08-25 10:49:19 -0700
committerCedric BAIL <cedric@osg.samsung.com>2017-08-25 10:49:19 -0700
commit93531868c729aa3e12cedeade67dbbd7d1c50c5d (patch)
treed698f96dc65645aa63d3279c96b56d1ff3616719 /src/modules
parent3e88aa37bc233ded87fdc69340ac02adc0830448 (diff)
evas: refactor buffer engine to have less indirect useless call.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/evas/engines/buffer/evas_engine.c59
1 files changed, 15 insertions, 44 deletions
diff --git a/src/modules/evas/engines/buffer/evas_engine.c b/src/modules/evas/engines/buffer/evas_engine.c
index 7e21915..7ece6c6 100644
--- a/src/modules/evas/engines/buffer/evas_engine.c
+++ b/src/modules/evas/engines/buffer/evas_engine.c
@@ -20,32 +20,25 @@ static Evas_Func func, pfunc;
20typedef Render_Output_Software_Generic Render_Engine; 20typedef Render_Output_Software_Generic Render_Engine;
21 21
22/* prototypes we will use here */ 22/* prototypes we will use here */
23static void *_output_setup(int w, int h, void *dest_buffer, int dest_buffer_row_bytes, int depth_type, int use_color_key, int alpha_threshold, int color_key_r, int color_key_g, int color_key_b, void *(*new_update_region) (int x, int y, int w, int h, int *row_bytes), void (*free_update_region) (int x, int y, int w, int h, void *data), void *(*switch_buffer) (void *data, void *dest_buffer), void *switch_data);
24
25static void eng_output_free(void *engine EINA_UNUSED, void *data); 23static void eng_output_free(void *engine EINA_UNUSED, void *data);
26 24
27/* internal engine routines */ 25/* engine api this module provides */
28static void * 26static void *
29_output_setup(int w, 27eng_output_setup(void *engine EINA_UNUSED, void *in, unsigned int w, unsigned int h)
30 int h,
31 void *dest_buffer,
32 int dest_buffer_row_bytes,
33 int depth_type,
34 int use_color_key,
35 int alpha_threshold,
36 int color_key_r,
37 int color_key_g,
38 int color_key_b,
39 void *(*new_update_region) (int x, int y, int w, int h, int *row_bytes),
40 void (*free_update_region) (int x, int y, int w, int h, void *data),
41 void *(*switch_buffer) (void *data, void *dest_buffer),
42 void *switch_data
43 )
44{ 28{
29 Evas_Engine_Info_Buffer *info = in;
45 Outbuf *ob; 30 Outbuf *ob;
46 Render_Engine *re; 31 Render_Engine *re;
47 Outbuf_Depth dep; 32 Outbuf_Depth dep;
48 DATA32 color_key = 0; 33 DATA32 color_key = 0;
34 void *dest_buffer = info->info.dest_buffer;
35 int dest_buffer_row_bytes = info->info.dest_buffer_row_bytes;
36 int depth_type = info->info.depth_type;
37 int use_color_key = info->info.use_color_key;
38 int alpha_threshold = info->info.alpha_threshold;
39 int color_key_r = info->info.color_key_r;
40 int color_key_g = info->info.color_key_g;
41 int color_key_b = info->info.color_key_b;
49 42
50 re = calloc(1, sizeof(Render_Engine)); 43 re = calloc(1, sizeof(Render_Engine));
51 if (!re) return NULL; 44 if (!re) return NULL;
@@ -75,10 +68,10 @@ _output_setup(int w,
75 use_color_key, 68 use_color_key,
76 color_key, 69 color_key,
77 alpha_threshold, 70 alpha_threshold,
78 new_update_region, 71 info->info.func.new_update_region,
79 free_update_region, 72 info->info.func.free_update_region,
80 switch_buffer, 73 info->info.func.switch_buffer,
81 switch_data); 74 info->info.switch_data);
82 if (!ob) goto on_error; 75 if (!ob) goto on_error;
83 76
84 if (!evas_render_engine_software_generic_init(re, ob, 77 if (!evas_render_engine_software_generic_init(re, ob,
@@ -104,7 +97,6 @@ _output_setup(int w,
104 return NULL; 97 return NULL;
105} 98}
106 99
107/* engine api this module provides */
108static void 100static void
109eng_output_info_setup(void *info) 101eng_output_info_setup(void *info)
110{ 102{
@@ -113,27 +105,6 @@ eng_output_info_setup(void *info)
113 einfo->render_mode = EVAS_RENDER_MODE_BLOCKING; 105 einfo->render_mode = EVAS_RENDER_MODE_BLOCKING;
114} 106}
115 107
116static void *
117eng_output_setup(void *engine EINA_UNUSED, void *in, unsigned int w, unsigned int h)
118{
119 Evas_Engine_Info_Buffer *info = in;
120
121 return _output_setup(w,
122 h,
123 info->info.dest_buffer,
124 info->info.dest_buffer_row_bytes,
125 info->info.depth_type,
126 info->info.use_color_key,
127 info->info.alpha_threshold,
128 info->info.color_key_r,
129 info->info.color_key_g,
130 info->info.color_key_b,
131 info->info.func.new_update_region,
132 info->info.func.free_update_region,
133 info->info.func.switch_buffer,
134 info->info.switch_data);
135}
136
137static void 108static void
138eng_output_free(void *engine EINA_UNUSED, void *data) 109eng_output_free(void *engine EINA_UNUSED, void *data)
139{ 110{