summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2017-08-25 10:48:13 -0700
committerCedric BAIL <cedric@osg.samsung.com>2017-08-25 10:48:13 -0700
commit46e1df839be16b057dbc2179626db180d90935c8 (patch)
tree2783b9d1749430c72d9597985277eca3bb7e0e2c /src
parent1e2bbf8feae36fbca083ed030f26fd42d5436c9a (diff)
evas: factorize call to info and info_free.
Diffstat (limited to 'src')
-rw-r--r--src/lib/evas/canvas/evas_main.c17
-rw-r--r--src/lib/evas/canvas/evas_out.c18
-rw-r--r--src/lib/evas/include/evas_private.h12
-rw-r--r--src/modules/evas/engines/buffer/evas_engine.c27
-rw-r--r--src/modules/evas/engines/drm/evas_engine.c29
-rw-r--r--src/modules/evas/engines/eglfs/evas_engine.c25
-rw-r--r--src/modules/evas/engines/fb/evas_engine.c25
-rw-r--r--src/modules/evas/engines/gl_cocoa/evas_engine.c27
-rw-r--r--src/modules/evas/engines/gl_drm/evas_engine.c27
-rw-r--r--src/modules/evas/engines/gl_sdl/evas_engine.c24
-rw-r--r--src/modules/evas/engines/gl_x11/evas_engine.c32
-rw-r--r--src/modules/evas/engines/psl1ght/evas_engine.c29
-rw-r--r--src/modules/evas/engines/software_ddraw/evas_engine.c26
-rw-r--r--src/modules/evas/engines/software_gdi/evas_engine.c23
-rw-r--r--src/modules/evas/engines/software_generic/evas_engine.c6
-rw-r--r--src/modules/evas/engines/software_x11/evas_engine.c39
-rw-r--r--src/modules/evas/engines/wayland_egl/evas_engine.c27
-rw-r--r--src/modules/evas/engines/wayland_shm/evas_engine.c32
18 files changed, 127 insertions, 318 deletions
diff --git a/src/lib/evas/canvas/evas_main.c b/src/lib/evas/canvas/evas_main.c
index 8cac669..d713c4a 100644
--- a/src/lib/evas/canvas/evas_main.c
+++ b/src/lib/evas/canvas/evas_main.c
@@ -1038,13 +1038,26 @@ evas_output_method_set(Evas *eo_e, int render_method)
1038 e->engine.module = em; 1038 e->engine.module = em;
1039 evas_module_ref(em); 1039 evas_module_ref(em);
1040 /* get the engine info struct */ 1040 /* get the engine info struct */
1041 if (e->engine.func->output_info) 1041 if (e->engine.func->info_size)
1042 { 1042 {
1043 Efl_Canvas_Output *output; 1043 Efl_Canvas_Output *output;
1044 Eina_List *l; 1044 Eina_List *l;
1045 1045
1046 EINA_LIST_FOREACH(e->outputs, l, output) 1046 EINA_LIST_FOREACH(e->outputs, l, output)
1047 if (!output->info) output->info = e->engine.func->output_info(); 1047 if (!output->info)
1048 {
1049 output->info = calloc(1, e->engine.func->info_size);
1050 if (!output->info) continue ;
1051 output->info->magic = rand();
1052 output->info_magic = output->info->magic;
1053
1054 if (e->engine.func->output_info_setup)
1055 e->engine.func->output_info_setup(output->info);
1056 }
1057 }
1058 else
1059 {
1060 CRI("Engine not up to date no info size provided.");
1048 } 1061 }
1049 1062
1050 // Wayland/drm already handles seats. 1063 // Wayland/drm already handles seats.
diff --git a/src/lib/evas/canvas/evas_out.c b/src/lib/evas/canvas/evas_out.c
index 48bd5df..567ea58 100644
--- a/src/lib/evas/canvas/evas_out.c
+++ b/src/lib/evas/canvas/evas_out.c
@@ -38,11 +38,22 @@ efl_canvas_output_add(Evas *canvas)
38 38
39 // The engine is already initialized, use it 39 // The engine is already initialized, use it
40 // right away to setup the info structure 40 // right away to setup the info structure
41 if (e->engine.func->output_info) 41 if (e->engine.func->info_size)
42 { 42 {
43 r->info = e->engine.func->output_info(); 43 r->info = calloc(1, e->engine.func->info_size);
44 if (!r->info) goto on_error;
45 r->info->magic = rand();
46 r->info_magic = r->info->magic;
47
48 if (e->engine.func->output_info_setup)
49 e->engine.func->output_info_setup(r->info);
50 }
51 else
52 {
53 CRI("Engine not up to date no info size provided.");
44 } 54 }
45 55
56 on_error:
46 return r; 57 return r;
47} 58}
48 59
@@ -62,7 +73,8 @@ efl_canvas_output_del(Efl_Canvas_Output *output)
62 output->ector); 73 output->ector);
63 e->engine.func->output_free(_evas_engine_context(e), 74 e->engine.func->output_free(_evas_engine_context(e),
64 output->output); 75 output->output);
65 e->engine.func->output_info_free(output->info); 76 free(output->info);
77 output->info = NULL;
66 } 78 }
67 e->outputs = eina_list_remove(e->outputs, output); 79 e->outputs = eina_list_remove(e->outputs, output);
68 80
diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h
index 0e71d31..ba6b752 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -1334,7 +1334,8 @@ struct _Efl_Canvas_Output
1334 1334
1335 Ector_Surface *ector; 1335 Ector_Surface *ector;
1336 1336
1337 void *info, *output; 1337 Evas_Engine_Info *info;
1338 void *output;
1338 Evas_Coord x, y, w, h; 1339 Evas_Coord x, y, w, h;
1339 1340
1340 int info_magic; 1341 int info_magic;
@@ -1393,10 +1394,9 @@ struct _Evas_Object_Func
1393 1394
1394struct _Evas_Func 1395struct _Evas_Func
1395{ 1396{
1396 void *(*output_info) (void); 1397 void (*output_info_setup) (void *info);
1397 void (*output_info_free) (void *info); 1398 void *(*output_setup) (void *engine, void *info, unsigned int w, unsigned int h);
1398 void *(*output_setup) (void *engine, void *info, unsigned int w, unsigned int h); 1399 int (*output_update) (void *engine, void *data, void *info, unsigned int w, unsigned int h);
1399 int (*output_update) (void *engine, void *data, void *info, unsigned int w, unsigned int h);
1400 1400
1401 void (*output_free) (void *engine, void *data); 1401 void (*output_free) (void *engine, void *data);
1402 void (*output_resize) (void *engine, void *data, int w, int h); 1402 void (*output_resize) (void *engine, void *data, int w, int h);
@@ -1616,6 +1616,8 @@ struct _Evas_Func
1616 1616
1617 Evas_Filter_Support (*gfx_filter_supports) (void *engine, Evas_Filter_Command *cmd); 1617 Evas_Filter_Support (*gfx_filter_supports) (void *engine, Evas_Filter_Command *cmd);
1618 Eina_Bool (*gfx_filter_process) (void *engine, Evas_Filter_Command *cmd); 1618 Eina_Bool (*gfx_filter_process) (void *engine, Evas_Filter_Command *cmd);
1619
1620 unsigned int info_size;
1619}; 1621};
1620 1622
1621struct _Evas_Image_Save_Func 1623struct _Evas_Image_Save_Func
diff --git a/src/modules/evas/engines/buffer/evas_engine.c b/src/modules/evas/engines/buffer/evas_engine.c
index 4cff96b..821e47d 100644
--- a/src/modules/evas/engines/buffer/evas_engine.c
+++ b/src/modules/evas/engines/buffer/evas_engine.c
@@ -22,8 +22,6 @@ typedef Render_Output_Software_Generic Render_Engine;
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); 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 24
25static void *eng_output_info(void);
26static void eng_output_info_free(void *info);
27static void eng_output_free(void *engine EINA_UNUSED, void *data); 25static void eng_output_free(void *engine EINA_UNUSED, void *data);
28 26
29/* internal engine routines */ 27/* internal engine routines */
@@ -107,23 +105,12 @@ _output_setup(int w,
107} 105}
108 106
109/* engine api this module provides */ 107/* engine api this module provides */
110static void *
111eng_output_info(void)
112{
113 Evas_Engine_Info_Buffer *info;
114 info = calloc(1, sizeof(Evas_Engine_Info_Buffer));
115 if (!info) return NULL;
116 info->magic.magic = rand();
117 info->render_mode = EVAS_RENDER_MODE_BLOCKING;
118 return info;
119}
120
121static void 108static void
122eng_output_info_free(void *info) 109eng_output_info_setup(void *info)
123{ 110{
124 Evas_Engine_Info_Buffer *in; 111 Evas_Engine_Info_Buffer *einfo = info;
125 in = (Evas_Engine_Info_Buffer *)info; 112
126 free(in); 113 einfo->render_mode = EVAS_RENDER_MODE_BLOCKING;
127} 114}
128 115
129static void * 116static void *
@@ -190,11 +177,13 @@ module_open(Evas_Module *em)
190 func = pfunc; 177 func = pfunc;
191 /* now to override methods */ 178 /* now to override methods */
192#define ORD(f) EVAS_API_OVERRIDE(f, &func, eng_) 179#define ORD(f) EVAS_API_OVERRIDE(f, &func, eng_)
193 ORD(output_info); 180 ORD(output_info_setup);
194 ORD(output_info_free);
195 ORD(output_setup); 181 ORD(output_setup);
196 ORD(canvas_alpha_get); 182 ORD(canvas_alpha_get);
197 ORD(output_free); 183 ORD(output_free);
184
185 func.info_size = sizeof (Evas_Engine_Info_Buffer);
186
198 /* now advertise out own api */ 187 /* now advertise out own api */
199 em->functions = (void *)(&func); 188 em->functions = (void *)(&func);
200 return 1; 189 return 1;
diff --git a/src/modules/evas/engines/drm/evas_engine.c b/src/modules/evas/engines/drm/evas_engine.c
index beb4476..927a17e 100644
--- a/src/modules/evas/engines/drm/evas_engine.c
+++ b/src/modules/evas/engines/drm/evas_engine.c
@@ -57,30 +57,12 @@ err:
57 return NULL; 57 return NULL;
58} 58}
59 59
60static void *
61eng_output_info(void)
62{
63 Evas_Engine_Info_Drm *info;
64
65 /* try to allocate space for our engine info structure */
66 info = calloc(1, sizeof(Evas_Engine_Info_Drm));
67 if (!info) return NULL;
68
69 /* set some engine default properties */
70 info->magic.magic = rand();
71 info->render_mode = EVAS_RENDER_MODE_BLOCKING;
72
73 return info;
74}
75
76static void 60static void
77eng_output_info_free(void *einfo) 61eng_output_info_setup(void *info)
78{ 62{
79 Evas_Engine_Info_Drm *info; 63 Evas_Engine_Info_Drm *einfo = info;
80 64
81 /* free the engine info */ 65 einfo->render_mode = EVAS_RENDER_MODE_BLOCKING;
82 info = (Evas_Engine_Info_Drm *)einfo;
83 free(info);
84} 66}
85 67
86static void * 68static void *
@@ -251,14 +233,15 @@ module_open(Evas_Module *em)
251 func = pfunc; 233 func = pfunc;
252 234
253 /* override the methods we provide */ 235 /* override the methods we provide */
254 EVAS_API_OVERRIDE(output_info, &func, eng_); 236 EVAS_API_OVERRIDE(output_info_setup, &func, eng_);
255 EVAS_API_OVERRIDE(output_info_free, &func, eng_);
256 EVAS_API_OVERRIDE(output_setup, &func, eng_); 237 EVAS_API_OVERRIDE(output_setup, &func, eng_);
257 EVAS_API_OVERRIDE(output_update, &func, eng_); 238 EVAS_API_OVERRIDE(output_update, &func, eng_);
258 EVAS_API_OVERRIDE(output_free, &func, eng_); 239 EVAS_API_OVERRIDE(output_free, &func, eng_);
259 EVAS_API_OVERRIDE(image_plane_assign, &func, eng_); 240 EVAS_API_OVERRIDE(image_plane_assign, &func, eng_);
260 EVAS_API_OVERRIDE(image_plane_release, &func, eng_); 241 EVAS_API_OVERRIDE(image_plane_release, &func, eng_);
261 242
243 func.info_size = sizeof (Evas_Engine_Info_Drm);
244
262 /* advertise our engine functions */ 245 /* advertise our engine functions */
263 em->functions = (void *)(&func); 246 em->functions = (void *)(&func);
264 247
diff --git a/src/modules/evas/engines/eglfs/evas_engine.c b/src/modules/evas/engines/eglfs/evas_engine.c
index 0394571..0aa53db 100644
--- a/src/modules/evas/engines/eglfs/evas_engine.c
+++ b/src/modules/evas/engines/eglfs/evas_engine.c
@@ -670,28 +670,12 @@ _native_cb_free(void *image)
670} 670}
671 671
672/* engine specific override functions */ 672/* engine specific override functions */
673static void *
674eng_output_info(void)
675{
676 Evas_Engine_Info_Eglfs *info;
677
678 /* try to allocate space for our engine info */
679 if (!(info = calloc(1, sizeof(Evas_Engine_Info_Eglfs))))
680 return NULL;
681
682 info->magic.magic = rand();
683 info->render_mode = EVAS_RENDER_MODE_BLOCKING;
684
685 return info;
686}
687
688static void 673static void
689eng_output_info_free(void *in) 674eng_output_info_setup(void *info)
690{ 675{
691 Evas_Engine_Info_Eglfs *info; 676 Evas_Engine_Info_Eglfs *einfo = info;
692 677
693 if ((info = (Evas_Engine_Info_Eglfs *)in)) 678 einfo->render_mode = EVAS_RENDER_MODE_BLOCKING;
694 free(info);
695} 679}
696 680
697static void * 681static void *
@@ -1128,7 +1112,6 @@ module_open(Evas_Module *em)
1128 1112
1129 /* now to override methods */ 1113 /* now to override methods */
1130 EVAS_API_OVERRIDE(output_info, &func, eng_); 1114 EVAS_API_OVERRIDE(output_info, &func, eng_);
1131 EVAS_API_OVERRIDE(output_info_free, &func, eng_);
1132 EVAS_API_OVERRIDE(output_setup, &func, eng_); 1115 EVAS_API_OVERRIDE(output_setup, &func, eng_);
1133 EVAS_API_OVERRIDE(output_update, &func, eng_); 1116 EVAS_API_OVERRIDE(output_update, &func, eng_);
1134 EVAS_API_OVERRIDE(canvas_alpha_get, &func, eng_); 1117 EVAS_API_OVERRIDE(canvas_alpha_get, &func, eng_);
@@ -1136,6 +1119,8 @@ module_open(Evas_Module *em)
1136 EVAS_API_OVERRIDE(output_dump, &func, eng_); 1119 EVAS_API_OVERRIDE(output_dump, &func, eng_);
1137 EVAS_API_OVERRIDE(image_native_set, &func, eng_); 1120 EVAS_API_OVERRIDE(image_native_set, &func, eng_);
1138 1121
1122 func.info_size = sizeof (Evas_Engine_Info_Eglfs);
1123
1139 setenv("EGL_PLATFORM", "fbdev", 1); 1124 setenv("EGL_PLATFORM", "fbdev", 1);
1140 1125
1141 gl_symbols(); 1126 gl_symbols();
diff --git a/src/modules/evas/engines/fb/evas_engine.c b/src/modules/evas/engines/fb/evas_engine.c
index f1c7e95..630118a 100644
--- a/src/modules/evas/engines/fb/evas_engine.c
+++ b/src/modules/evas/engines/fb/evas_engine.c
@@ -61,23 +61,12 @@ _output_setup(int w, int h, int rot, int vt, int dev, int refresh)
61} 61}
62 62
63/* engine api this module provides */ 63/* engine api this module provides */
64static void *
65eng_output_info(void)
66{
67 Evas_Engine_Info_FB *info;
68 info = calloc(1, sizeof(Evas_Engine_Info_FB));
69 if (!info) return NULL;
70 info->magic.magic = rand();
71 info->render_mode = EVAS_RENDER_MODE_BLOCKING;
72 return info;
73}
74
75static void 64static void
76eng_output_info_free(void *info) 65eng_output_info_setup(void *info)
77{ 66{
78 Evas_Engine_Info_FB *in; 67 Evas_Engine_Info_FB *einfo = info;
79 in = (Evas_Engine_Info_FB *)info; 68
80 free(in); 69 einfo->render_mode = EVAS_RENDER_MODE_BLOCKING;
81} 70}
82 71
83static void * 72static void *
@@ -135,11 +124,13 @@ module_open(Evas_Module *em)
135 func = pfunc; 124 func = pfunc;
136 /* now to override methods */ 125 /* now to override methods */
137#define ORD(f) EVAS_API_OVERRIDE(f, &func, eng_) 126#define ORD(f) EVAS_API_OVERRIDE(f, &func, eng_)
138 ORD(output_info); 127 ORD(output_info_setup);
139 ORD(output_info_free);
140 ORD(output_setup); 128 ORD(output_setup);
141 ORD(canvas_alpha_get); 129 ORD(canvas_alpha_get);
142 ORD(output_free); 130 ORD(output_free);
131
132 func.info_size = sizeof (Evas_Engine_Info_FB);
133
143 /* now advertise out own api */ 134 /* now advertise out own api */
144 em->functions = (void *)(&func); 135 em->functions = (void *)(&func);
145 return 1; 136 return 1;
diff --git a/src/modules/evas/engines/gl_cocoa/evas_engine.c b/src/modules/evas/engines/gl_cocoa/evas_engine.c
index bb3ea7e..500b118 100644
--- a/src/modules/evas/engines/gl_cocoa/evas_engine.c
+++ b/src/modules/evas/engines/gl_cocoa/evas_engine.c
@@ -125,29 +125,6 @@ static const EVGL_Interface evgl_funcs =
125 NULL, // native_win_surface_config_get 125 NULL, // native_win_surface_config_get
126}; 126};
127 127
128
129static void *
130eng_output_info(void)
131{
132 Evas_Engine_Info_GL_Cocoa *info;
133
134 info = calloc(1, sizeof(*info));
135 if (EINA_UNLIKELY(!info))
136 {
137 CRI("Failed to allocate memory");
138 return NULL;
139 }
140 info->magic.magic = rand();
141 return info;
142}
143
144static void
145eng_output_info_free(void *info)
146{
147 Evas_Engine_Info_GL_Cocoa *const in = info;
148 free(in);
149}
150
151static void * 128static void *
152eng_output_setup(void *engine EINA_UNUSED, void *in, unsigned int w, unsigned int h) 129eng_output_setup(void *engine EINA_UNUSED, void *in, unsigned int w, unsigned int h)
153{ 130{
@@ -306,13 +283,13 @@ module_open(Evas_Module *em)
306 283
307 /* now to override methods */ 284 /* now to override methods */
308#define ORD(f) EVAS_API_OVERRIDE(f, &func, eng_) 285#define ORD(f) EVAS_API_OVERRIDE(f, &func, eng_)
309 ORD(output_info);
310 ORD(output_info_free);
311 ORD(output_setup); 286 ORD(output_setup);
312 ORD(output_update); 287 ORD(output_update);
313 ORD(canvas_alpha_get); 288 ORD(canvas_alpha_get);
314 ORD(output_free); 289 ORD(output_free);
315 290
291 func.info_size = sizeof (Evas_Engine_Info_GL_Cocoa);
292
316 _gl_symbols(); 293 _gl_symbols();
317 294
318 /* now advertise out own api */ 295 /* now advertise out own api */
diff --git a/src/modules/evas/engines/gl_drm/evas_engine.c b/src/modules/evas/engines/gl_drm/evas_engine.c
index e636c0e..0951316 100644
--- a/src/modules/evas/engines/gl_drm/evas_engine.c
+++ b/src/modules/evas/engines/gl_drm/evas_engine.c
@@ -891,28 +891,12 @@ _native_cb_free(void *image)
891} 891}
892 892
893/* engine specific override functions */ 893/* engine specific override functions */
894static void *
895eng_output_info(void)
896{
897 Evas_Engine_Info_GL_Drm *info;
898
899 /* try to allocate space for our engine info */
900 if (!(info = calloc(1, sizeof(Evas_Engine_Info_GL_Drm))))
901 return NULL;
902
903 info->magic.magic = rand();
904 info->render_mode = EVAS_RENDER_MODE_BLOCKING;
905
906 return info;
907}
908
909static void 894static void
910eng_output_info_free(void *in) 895eng_output_info_setup(void *info)
911{ 896{
912 Evas_Engine_Info_GL_Drm *info; 897 Evas_Engine_Info_GL_Drm *einfo = info;
913 898
914 if ((info = (Evas_Engine_Info_GL_Drm *)in)) 899 einfo->render_mode = EVAS_RENDER_MODE_BLOCKING;
915 free(info);
916} 900}
917 901
918static Render_Engine_Merge_Mode 902static Render_Engine_Merge_Mode
@@ -1489,8 +1473,7 @@ module_open(Evas_Module *em)
1489 func = pfunc; 1473 func = pfunc;
1490 1474
1491 /* now to override methods */ 1475 /* now to override methods */
1492 EVAS_API_OVERRIDE(output_info, &func, eng_); 1476 EVAS_API_OVERRIDE(output_info_setup, &func, eng_);
1493 EVAS_API_OVERRIDE(output_info_free, &func, eng_);
1494 EVAS_API_OVERRIDE(output_setup, &func, eng_); 1477 EVAS_API_OVERRIDE(output_setup, &func, eng_);
1495 EVAS_API_OVERRIDE(output_update, &func, eng_); 1478 EVAS_API_OVERRIDE(output_update, &func, eng_);
1496 EVAS_API_OVERRIDE(canvas_alpha_get, &func, eng_); 1479 EVAS_API_OVERRIDE(canvas_alpha_get, &func, eng_);
@@ -1502,6 +1485,8 @@ module_open(Evas_Module *em)
1502 EVAS_API_OVERRIDE(image_plane_assign, &func, eng_); 1485 EVAS_API_OVERRIDE(image_plane_assign, &func, eng_);
1503 EVAS_API_OVERRIDE(image_plane_release, &func, eng_); 1486 EVAS_API_OVERRIDE(image_plane_release, &func, eng_);
1504 1487
1488 func.info_size = sizeof (Evas_Engine_Info_GL_Drm);
1489
1505 /* Mesa's EGL driver loads wayland egl by default. (called by eglGetProcaddr() ) 1490 /* Mesa's EGL driver loads wayland egl by default. (called by eglGetProcaddr() )
1506 * implicit env set (EGL_PLATFORM=drm) prevent that. */ 1491 * implicit env set (EGL_PLATFORM=drm) prevent that. */
1507 setenv("EGL_PLATFORM", "drm", 1); 1492 setenv("EGL_PLATFORM", "drm", 1);
diff --git a/src/modules/evas/engines/gl_sdl/evas_engine.c b/src/modules/evas/engines/gl_sdl/evas_engine.c
index e7b7408..940e74b 100644
--- a/src/modules/evas/engines/gl_sdl/evas_engine.c
+++ b/src/modules/evas/engines/gl_sdl/evas_engine.c
@@ -266,26 +266,6 @@ static const EVGL_Interface evgl_funcs =
266 NULL, // native_win_surface_config_get 266 NULL, // native_win_surface_config_get
267}; 267};
268 268
269
270static void *
271eng_output_info(void)
272{
273 Evas_Engine_Info_GL_SDL *info;
274
275 info = calloc(1, sizeof(Evas_Engine_Info_GL_SDL));
276 if (!info) return NULL;
277 info->magic.magic = rand();
278 return info;
279}
280
281static void
282eng_output_info_free(void *info)
283{
284 Evas_Engine_Info_GL_SDL *in;
285 in = (Evas_Engine_Info_GL_SDL *)info;
286 free(in);
287}
288
289static void * 269static void *
290eng_output_setup(void *engine EINA_UNUSED, void *in, unsigned int w, unsigned int h) 270eng_output_setup(void *engine EINA_UNUSED, void *in, unsigned int w, unsigned int h)
291{ 271{
@@ -400,13 +380,13 @@ module_open(Evas_Module *em)
400 func = pfunc; 380 func = pfunc;
401 /* now to override methods */ 381 /* now to override methods */
402 #define ORD(f) EVAS_API_OVERRIDE(f, &func, eng_) 382 #define ORD(f) EVAS_API_OVERRIDE(f, &func, eng_)
403 ORD(output_info);
404 ORD(output_info_free);
405 ORD(output_setup); 383 ORD(output_setup);
406 ORD(canvas_alpha_get); 384 ORD(canvas_alpha_get);
407 ORD(output_free); 385 ORD(output_free);
408 ORD(output_dump); 386 ORD(output_dump);
409 387
388 func.info_size = sizeof (Evas_Engine_Info_GL_SDL);
389
410 gl_symbols(); 390 gl_symbols();
411 391
412 /* now advertise out own api */ 392 /* now advertise out own api */
diff --git a/src/modules/evas/engines/gl_x11/evas_engine.c b/src/modules/evas/engines/gl_x11/evas_engine.c
index adf968f..d74ecce 100644
--- a/src/modules/evas/engines/gl_x11/evas_engine.c
+++ b/src/modules/evas/engines/gl_x11/evas_engine.c
@@ -1549,28 +1549,15 @@ int _evas_engine_GL_X11_log_dom = -1;
1549/* function tables - filled in later (func and parent func) */ 1549/* function tables - filled in later (func and parent func) */
1550static Evas_Func func, pfunc; 1550static Evas_Func func, pfunc;
1551 1551
1552static void *
1553eng_output_info(void)
1554{
1555 Evas_Engine_Info_GL_X11 *info;
1556
1557 info = calloc(1, sizeof(Evas_Engine_Info_GL_X11));
1558 info->magic.magic = rand();
1559 info->func.best_visual_get = eng_best_visual_get;
1560 info->func.best_colormap_get = eng_best_colormap_get;
1561 info->func.best_depth_get = eng_best_depth_get;
1562 info->render_mode = EVAS_RENDER_MODE_BLOCKING;
1563 return info;
1564}
1565
1566static void 1552static void
1567eng_output_info_free(void *info) 1553eng_output_info_setup(void *info)
1568{ 1554{
1569 Evas_Engine_Info_GL_X11 *in; 1555 Evas_Engine_Info_GL_X11 *einfo = info;
1570// dont free! why bother? its not worth it 1556
1571// eina_log_domain_unregister(_evas_engine_GL_X11_log_dom); 1557 einfo->func.best_visual_get = eng_best_visual_get;
1572 in = (Evas_Engine_Info_GL_X11 *)info; 1558 einfo->func.best_colormap_get = eng_best_colormap_get;
1573 free(in); 1559 einfo->func.best_depth_get = eng_best_depth_get;
1560 einfo->render_mode = EVAS_RENDER_MODE_BLOCKING;
1574} 1561}
1575 1562
1576static void 1563static void
@@ -3044,8 +3031,7 @@ module_open(Evas_Module *em)
3044 func = pfunc; 3031 func = pfunc;
3045 /* now to override methods */ 3032 /* now to override methods */
3046 #define ORD(f) EVAS_API_OVERRIDE(f, &func, eng_) 3033 #define ORD(f) EVAS_API_OVERRIDE(f, &func, eng_)
3047 ORD(output_info); 3034 ORD(output_info_setup);
3048 ORD(output_info_free);
3049 ORD(output_setup); 3035 ORD(output_setup);
3050 ORD(output_update); 3036 ORD(output_update);
3051 ORD(canvas_alpha_get); 3037 ORD(canvas_alpha_get);
@@ -3060,6 +3046,8 @@ module_open(Evas_Module *em)
3060 // gl_current_surface_get is in gl generic 3046 // gl_current_surface_get is in gl generic
3061 ORD(gl_current_context_get); 3047 ORD(gl_current_context_get);
3062 3048
3049 func.info_size = sizeof (Evas_Engine_Info_GL_X11);
3050
3063 if (!(platform_env = getenv("EGL_PLATFORM"))) 3051 if (!(platform_env = getenv("EGL_PLATFORM")))
3064 setenv("EGL_PLATFORM", "x11", 0); 3052 setenv("EGL_PLATFORM", "x11", 0);
3065 3053
diff --git a/src/modules/evas/engines/psl1ght/evas_engine.c b/src/modules/evas/engines/psl1ght/evas_engine.c
index 9b9bef0..5375fa5 100644
--- a/src/modules/evas/engines/psl1ght/evas_engine.c
+++ b/src/modules/evas/engines/psl1ght/evas_engine.c
@@ -98,30 +98,12 @@ _output_setup(int w, int h)
98} 98}
99 99
100/* engine api this module provides */ 100/* engine api this module provides */
101static void *
102eng_output_info(void)
103{
104 Evas_Engine_Info_PSL1GHT *info;
105
106 printf ("eng_info called\n");
107 info = calloc(1, sizeof(Evas_Engine_Info_PSL1GHT));
108 if (!info)
109 return NULL;
110
111 info->magic.magic = rand();
112 info->render_mode = EVAS_RENDER_MODE_BLOCKING;
113
114 return info;
115}
116
117static void 101static void
118eng_output_info_free(void *info) 102eng_output_info_setup(void *info)
119{ 103{
120 Evas_Engine_Info_PSL1GHT *in; 104 Evas_Engine_Info_PSL1GHT *einfo = info;
121 105
122 printf ("eng_info_free called\n"); 106 einfo->render_mode = EVAS_RENDER_MODE_BLOCKING;
123 in = (Evas_Engine_Info_PSL1GHT *)info;
124 free(in);
125} 107}
126 108
127static void * 109static void *
@@ -420,8 +402,7 @@ module_open(Evas_Module *em)
420 func = pfunc; 402 func = pfunc;
421 /* now to override methods */ 403 /* now to override methods */
422#define ORD(f) EVAS_API_OVERRIDE(f, &func, eng_) 404#define ORD(f) EVAS_API_OVERRIDE(f, &func, eng_)
423 ORD(output_info); 405 ORD(output_info_setup);
424 ORD(output_info_free);
425 ORD(output_setup); 406 ORD(output_setup);
426 ORD(canvas_alpha_get); 407 ORD(canvas_alpha_get);
427 ORD(output_free); 408 ORD(output_free);
@@ -435,6 +416,8 @@ module_open(Evas_Module *em)
435 ORD(output_flush); 416 ORD(output_flush);
436 ORD(output_idle_flush); 417 ORD(output_idle_flush);
437 418
419 func.info_size = sizeof (Evas_Engine_Info_PSL1GHT);
420
438 /* now advertise out own api */ 421 /* now advertise out own api */
439 em->functions = (void *)(&func); 422 em->functions = (void *)(&func);
440 return 1; 423 return 1;
diff --git a/src/modules/evas/engines/software_ddraw/evas_engine.c b/src/modules/evas/engines/software_ddraw/evas_engine.c
index 2d21d9d..bf647cb 100644
--- a/src/modules/evas/engines/software_ddraw/evas_engine.c
+++ b/src/modules/evas/engines/software_ddraw/evas_engine.c
@@ -65,26 +65,12 @@ _output_setup(int width,
65 65
66 66
67/* engine api this module provides */ 67/* engine api this module provides */
68
69static void *
70eng_output_info(void)
71{
72 Evas_Engine_Info_Software_DDraw *info;
73
74 info = calloc(1, sizeof(Evas_Engine_Info_Software_DDraw));
75 if (!info) return NULL;
76 info->magic.magic = rand();
77 info->render_mode = EVAS_RENDER_MODE_BLOCKING;
78 return info;
79}
80
81static void 68static void
82eng_output_info_free(void *info) 69eng_output_info_setup(void *info)
83{ 70{
84 Evas_Engine_Info_Software_DDraw *in; 71 Evas_Engine_Info_Software_DDraw *einfo = info;
85 72
86 in = (Evas_Engine_Info_Software_DDraw *)info; 73 einfo->render_mode = EVAS_RENDER_MODE_BLOCKING;
87 free(in);
88} 74}
89 75
90static void * 76static void *
@@ -136,11 +122,13 @@ module_open(Evas_Module *em)
136 func = pfunc; 122 func = pfunc;
137 /* now to override methods */ 123 /* now to override methods */
138#define ORD(f) EVAS_API_OVERRIDE(f, &func, eng_) 124#define ORD(f) EVAS_API_OVERRIDE(f, &func, eng_)
139 ORD(output_info); 125 ORD(output_info_setup);
140 ORD(output_info_free);
141 ORD(output_setup); 126 ORD(output_setup);
142 ORD(canvas_alpha_get); 127 ORD(canvas_alpha_get);
143 ORD(output_free); 128 ORD(output_free);
129
130 func.info_size = sizeof (Evas_Engine_Info_Software_DDraw);
131
144 /* now advertise out own api */ 132 /* now advertise out own api */
145 em->functions = (void *)(&func); 133 em->functions = (void *)(&func);
146 return 1; 134 return 1;
diff --git a/src/modules/evas/engines/software_gdi/evas_engine.c b/src/modules/evas/engines/software_gdi/evas_engine.c
index 5b88b7e..eb17e0e 100644
--- a/src/modules/evas/engines/software_gdi/evas_engine.c
+++ b/src/modules/evas/engines/software_gdi/evas_engine.c
@@ -71,25 +71,6 @@ _output_setup(int width,
71 71
72 72
73/* engine api this module provides */ 73/* engine api this module provides */
74
75static void *
76eng_output_info(void)
77{
78 Evas_Engine_Info_Software_Gdi *info;
79 info = calloc(1, sizeof(Evas_Engine_Info_Software_Gdi));
80 if (!info) return NULL;
81 info->magic.magic = rand();
82 return info;
83}
84
85static void
86eng_output_info_free(void *info)
87{
88 Evas_Engine_Info_Software_Gdi *in;
89 in = (Evas_Engine_Info_Software_Gdi *)info;
90 free(in);
91}
92
93static void * 74static void *
94eng_output_setup(void *engine EINA_UNUSED, void *in, unsigned int w, unsigned int h) 75eng_output_setup(void *engine EINA_UNUSED, void *in, unsigned int w, unsigned int h)
95{ 76{
@@ -173,12 +154,12 @@ module_open(Evas_Module *em)
173 func = pfunc; 154 func = pfunc;
174 /* now to override methods */ 155 /* now to override methods */
175#define ORD(f) EVAS_API_OVERRIDE(f, &func, eng_) 156#define ORD(f) EVAS_API_OVERRIDE(f, &func, eng_)
176 ORD(output_info);
177 ORD(output_info_free);
178 ORD(output_setup); 157 ORD(output_setup);
179 ORD(output_update); 158 ORD(output_update);
180 ORD(canvas_alpha_get); 159 ORD(canvas_alpha_get);
181 ORD(output_free); 160 ORD(output_free);
161
162 func.info_size = sizeof (Evas_Engine_Info_Software_Gdi);
182 /* now advertise out own api */ 163 /* now advertise out own api */
183 em->functions = (void *)(&func); 164 em->functions = (void *)(&func);
184 return 1; 165 return 1;
diff --git a/src/modules/evas/engines/software_generic/evas_engine.c b/src/modules/evas/engines/software_generic/evas_engine.c
index baede8f..3245f9a 100644
--- a/src/modules/evas/engines/software_generic/evas_engine.c
+++ b/src/modules/evas/engines/software_generic/evas_engine.c
@@ -4659,8 +4659,7 @@ eng_gfx_filter_process(void *data EINA_UNUSED, Evas_Filter_Command *cmd)
4659 4659
4660static Evas_Func func = 4660static Evas_Func func =
4661{ 4661{
4662 NULL, // eng_info 4662 NULL, // eng_info_setup
4663 NULL, // eng_info_free
4664 NULL, // eng_setup 4663 NULL, // eng_setup
4665 NULL, // eng_update 4664 NULL, // eng_update
4666 NULL, // eng_output_free 4665 NULL, // eng_output_free
@@ -4852,8 +4851,9 @@ static Evas_Func func =
4852 eng_ector_new, 4851 eng_ector_new,
4853 eng_ector_free, 4852 eng_ector_free,
4854 eng_gfx_filter_supports, 4853 eng_gfx_filter_supports,
4855 eng_gfx_filter_process 4854 eng_gfx_filter_process,
4856 /* FUTURE software generic calls go here */ 4855 /* FUTURE software generic calls go here */
4856 0 // sizeof (Info)
4857}; 4857};
4858 4858
4859 4859
diff --git a/src/modules/evas/engines/software_x11/evas_engine.c b/src/modules/evas/engines/software_x11/evas_engine.c
index 03d6cea..fadb68b 100644
--- a/src/modules/evas/engines/software_x11/evas_engine.c
+++ b/src/modules/evas/engines/software_x11/evas_engine.c
@@ -231,32 +231,18 @@ _symbols(void)
231} 231}
232 232
233/* engine api this module provides */ 233/* engine api this module provides */
234static void *
235eng_output_info(void)
236{
237 Evas_Engine_Info_Software_X11 *info;
238
239 if (!(info = calloc(1, sizeof(Evas_Engine_Info_Software_X11))))
240 return NULL;
241
242 info->magic.magic = rand();
243 info->info.debug = 0;
244 info->info.alloc_grayscale = 0;
245 info->info.alloc_colors_max = 216;
246 info->func.best_visual_get = _best_visual_get;
247 info->func.best_colormap_get = _best_colormap_get;
248 info->func.best_depth_get = _best_depth_get;
249 info->render_mode = EVAS_RENDER_MODE_BLOCKING;
250 return info;
251}
252
253static void 234static void
254eng_output_info_free(void *info) 235eng_output_info_setup(void *info)
255{ 236{
256 Evas_Engine_Info_Software_X11 *in; 237 Evas_Engine_Info_Software_X11 *einfo = info;
257 238
258 in = (Evas_Engine_Info_Software_X11 *)info; 239 einfo->info.debug = 0;
259 free(in); 240 einfo->info.alloc_grayscale = 0;
241 einfo->info.alloc_colors_max = 216;
242 einfo->func.best_visual_get = _best_visual_get;
243 einfo->func.best_colormap_get = _best_colormap_get;
244 einfo->func.best_depth_get = _best_depth_get;
245 einfo->render_mode = EVAS_RENDER_MODE_BLOCKING;
260} 246}
261 247
262static void * 248static void *
@@ -590,8 +576,7 @@ module_open(Evas_Module *em)
590 576
591 /* now to override methods */ 577 /* now to override methods */
592#define ORD(f) EVAS_API_OVERRIDE(f, &func, eng_) 578#define ORD(f) EVAS_API_OVERRIDE(f, &func, eng_)
593 ORD(output_info); 579 ORD(output_info_setup);
594 ORD(output_info_free);
595 ORD(output_setup); 580 ORD(output_setup);
596 ORD(output_update); 581 ORD(output_update);
597 ORD(canvas_alpha_get); 582 ORD(canvas_alpha_get);
@@ -601,6 +586,8 @@ module_open(Evas_Module *em)
601 ORD(image_native_set); 586 ORD(image_native_set);
602 ORD(image_native_get); 587 ORD(image_native_get);
603 588
589 func.info_size = sizeof (Evas_Engine_Info_Software_X11);
590
604 _symbols(); 591 _symbols();
605 /* now advertise out own api */ 592 /* now advertise out own api */
606 em->functions = (void *)(&func); 593 em->functions = (void *)(&func);
diff --git a/src/modules/evas/engines/wayland_egl/evas_engine.c b/src/modules/evas/engines/wayland_egl/evas_engine.c
index 4fa6a44..16ad004 100644
--- a/src/modules/evas/engines/wayland_egl/evas_engine.c
+++ b/src/modules/evas/engines/wayland_egl/evas_engine.c
@@ -502,28 +502,12 @@ static const EVGL_Interface evgl_funcs =
502}; 502};
503 503
504/* engine functions */ 504/* engine functions */
505static void *
506eng_output_info(void)
507{
508 Evas_Engine_Info_Wayland *info;
509
510 /* try to allocate space for our engine info */
511 if (!(info = calloc(1, sizeof(Evas_Engine_Info_Wayland))))
512 return NULL;
513
514 info->magic.magic = rand();
515 info->render_mode = EVAS_RENDER_MODE_BLOCKING;
516
517 return info;
518}
519
520static void 505static void
521eng_output_info_free(Evas *evas EINA_UNUSED, void *info) 506eng_output_info_setup(void *info)
522{ 507{
523 Evas_Engine_Info_Wayland *inf; 508 Evas_Engine_Info_Wayland *info = info;
524 509
525 if ((inf = (Evas_Engine_Info_Wayland *)info)) 510 info->render_mode = EVAS_RENDER_MODE_BLOCKING;
526 free(inf);
527} 511}
528 512
529static Render_Engine_Swap_Mode 513static Render_Engine_Swap_Mode
@@ -1430,8 +1414,7 @@ module_open(Evas_Module *em)
1430 1414
1431#define ORD(f) EVAS_API_OVERRIDE(f, &func, eng_) 1415#define ORD(f) EVAS_API_OVERRIDE(f, &func, eng_)
1432 1416
1433 ORD(output_info); 1417 ORD(output_info_setup);
1434 ORD(output_info_free);
1435 ORD(output_setup); 1418 ORD(output_setup);
1436 ORD(output_update); 1419 ORD(output_update);
1437 ORD(canvas_alpha_get); 1420 ORD(canvas_alpha_get);
@@ -1443,6 +1426,8 @@ module_open(Evas_Module *em)
1443 ORD(image_native_init); 1426 ORD(image_native_init);
1444 ORD(image_native_shutdown); 1427 ORD(image_native_shutdown);
1445 1428
1429 func.info_size = sizeof (Evas_Engine_Info_Wayland);
1430
1446 symbols(); 1431 symbols();
1447 1432
1448 /* advertise out which functions we support */ 1433 /* advertise out which functions we support */
diff --git a/src/modules/evas/engines/wayland_shm/evas_engine.c b/src/modules/evas/engines/wayland_shm/evas_engine.c
index 61bd701..d5bdb6b4 100644
--- a/src/modules/evas/engines/wayland_shm/evas_engine.c
+++ b/src/modules/evas/engines/wayland_shm/evas_engine.c
@@ -102,35 +102,14 @@ _symbols(void)
102} 102}
103 103
104/* ENGINE API FUNCTIONS WE PROVIDE */ 104/* ENGINE API FUNCTIONS WE PROVIDE */
105static void *
106eng_output_info(void)
107{
108 Evas_Engine_Info_Wayland *einfo;
109
110 LOGFN(__FILE__, __LINE__, __FUNCTION__);
111
112 /* try to allocate space for new engine info */
113 if (!(einfo = calloc(1, sizeof(Evas_Engine_Info_Wayland))))
114 return NULL;
115
116 /* fill in engine info */
117 einfo->magic.magic = rand();
118 einfo->render_mode = EVAS_RENDER_MODE_BLOCKING;
119
120 /* return allocated engine info */
121 return einfo;
122}
123
124static void 105static void
125eng_output_info_free(void *info) 106eng_output_info_setup(void *info)
126{ 107{
127 Evas_Engine_Info_Wayland *einfo; 108 Evas_Engine_Info_Wayland *einfo = info;
128 109
129 LOGFN(__FILE__, __LINE__, __FUNCTION__); 110 LOGFN(__FILE__, __LINE__, __FUNCTION__);
130 111
131 /* try to free previously allocated engine info */ 112 einfo->render_mode = EVAS_RENDER_MODE_BLOCKING;
132 if ((einfo = (Evas_Engine_Info_Wayland *)info))
133 free(einfo);
134} 113}
135 114
136static void * 115static void *
@@ -360,8 +339,7 @@ module_open(Evas_Module *em)
360 339
361 /* override engine specific functions */ 340 /* override engine specific functions */
362#define ORD(f) EVAS_API_OVERRIDE(f, &func, eng_) 341#define ORD(f) EVAS_API_OVERRIDE(f, &func, eng_)
363 ORD(output_info); 342 ORD(output_info_setup);
364 ORD(output_info_free);
365 ORD(output_setup); 343 ORD(output_setup);
366 ORD(output_update); 344 ORD(output_update);
367 ORD(output_free); 345 ORD(output_free);
@@ -371,6 +349,8 @@ module_open(Evas_Module *em)
371 ORD(image_native_init); 349 ORD(image_native_init);
372 ORD(image_native_shutdown); 350 ORD(image_native_shutdown);
373 351
352 func.info_size = sizeof (Evas_Engine_Info_Wayland);
353
374 _symbols(); 354 _symbols();
375 /* advertise our own engine functions */ 355 /* advertise our own engine functions */
376 em->functions = (void *)(&func); 356 em->functions = (void *)(&func);