summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2017-08-25 10:49:53 -0700
committerCedric BAIL <cedric@osg.samsung.com>2017-08-25 10:49:53 -0700
commit28397e7206322f2d31234d4ef77a588f7c0ba5e7 (patch)
tree2a80d4fe3ab8da3920d944f12beb672614ca1eb4 /src
parent76a7198e0d31192ecc6a97fbb1b136b156fbf672 (diff)
evas: differentiate engine from output.
Diffstat (limited to 'src')
-rw-r--r--src/lib/evas/canvas/evas_main.c6
-rw-r--r--src/lib/evas/canvas/evas_object_main.c8
-rw-r--r--src/lib/evas/canvas/evas_render.c26
-rw-r--r--src/lib/evas/include/evas_inline.x8
-rw-r--r--src/lib/evas/include/evas_private.h12
-rw-r--r--src/modules/evas/engines/buffer/evas_engine.c8
-rw-r--r--src/modules/evas/engines/drm/evas_engine.c10
-rw-r--r--src/modules/evas/engines/eglfs/evas_engine.c8
-rw-r--r--src/modules/evas/engines/fb/evas_engine.c8
-rw-r--r--src/modules/evas/engines/gl_cocoa/evas_engine.c4
-rw-r--r--src/modules/evas/engines/gl_drm/evas_engine.c8
-rw-r--r--src/modules/evas/engines/gl_generic/Evas_Engine_GL_Generic.h5
-rw-r--r--src/modules/evas/engines/gl_sdl/evas_engine.c8
-rw-r--r--src/modules/evas/engines/gl_x11/evas_engine.c8
-rw-r--r--src/modules/evas/engines/software_ddraw/evas_engine.c8
-rw-r--r--src/modules/evas/engines/software_gdi/evas_engine.c8
-rw-r--r--src/modules/evas/engines/software_generic/Evas_Engine_Software_Generic.h21
-rw-r--r--src/modules/evas/engines/software_generic/evas_engine.c41
-rw-r--r--src/modules/evas/engines/software_x11/evas_engine.c18
-rw-r--r--src/modules/evas/engines/wayland_egl/evas_engine.c8
-rw-r--r--src/modules/evas/engines/wayland_shm/evas_engine.c8
21 files changed, 146 insertions, 93 deletions
diff --git a/src/lib/evas/canvas/evas_main.c b/src/lib/evas/canvas/evas_main.c
index f72f0d7..043133a 100644
--- a/src/lib/evas/canvas/evas_main.c
+++ b/src/lib/evas/canvas/evas_main.c
@@ -378,7 +378,9 @@ next_zombie:
378 evas_event_callback_all_del(eo_e); 378 evas_event_callback_all_del(eo_e);
379 evas_event_callback_cleanup(eo_e); 379 evas_event_callback_cleanup(eo_e);
380 380
381 /* cleanup engine backend */
381 EINA_LIST_FREE(e->outputs, evo) efl_canvas_output_del(evo); 382 EINA_LIST_FREE(e->outputs, evo) efl_canvas_output_del(evo);
383 e->engine.func->engine_free(e->backend);
382 384
383 if (e->common_init) 385 if (e->common_init)
384 { 386 {
@@ -1037,6 +1039,10 @@ evas_output_method_set(Evas *eo_e, int render_method)
1037 if (e->engine.module) evas_module_unref(e->engine.module); 1039 if (e->engine.module) evas_module_unref(e->engine.module);
1038 e->engine.module = em; 1040 e->engine.module = em;
1039 evas_module_ref(em); 1041 evas_module_ref(em);
1042
1043 /* Initialize the engine first */
1044 e->backend = e->engine.func->engine_new();
1045
1040 /* get the engine info struct */ 1046 /* get the engine info struct */
1041 if (e->engine.func->info_size) 1047 if (e->engine.func->info_size)
1042 { 1048 {
diff --git a/src/lib/evas/canvas/evas_object_main.c b/src/lib/evas/canvas/evas_object_main.c
index a237da4..ea824ac 100644
--- a/src/lib/evas/canvas/evas_object_main.c
+++ b/src/lib/evas/canvas/evas_object_main.c
@@ -738,7 +738,7 @@ evas_object_render_pre_effect_updates(Eina_Array *rects, Evas_Object *eo_obj, in
738 obj->cur->cache.clip.w, 738 obj->cur->cache.clip.w,
739 obj->cur->cache.clip.h); 739 obj->cur->cache.clip.h);
740 if ((w > 0) && (h > 0)) 740 if ((w > 0) && (h > 0))
741 obj->layer->evas->engine.func->output_redraws_rect_add(ENC, ENDT, 741 obj->layer->evas->engine.func->output_redraws_rect_add(ENC,
742 x + e->framespace.x, 742 x + e->framespace.x,
743 y + e->framespace.y, 743 y + e->framespace.y,
744 w, h); 744 w, h);
@@ -753,7 +753,7 @@ evas_object_render_pre_effect_updates(Eina_Array *rects, Evas_Object *eo_obj, in
753 obj->prev->cache.clip.w, 753 obj->prev->cache.clip.w,
754 obj->prev->cache.clip.h); 754 obj->prev->cache.clip.h);
755 if ((w > 0) && (h > 0)) 755 if ((w > 0) && (h > 0))
756 obj->layer->evas->engine.func->output_redraws_rect_add(ENC, ENDT, 756 obj->layer->evas->engine.func->output_redraws_rect_add(ENC,
757 x + e->framespace.x, 757 x + e->framespace.x,
758 y + e->framespace.y, 758 y + e->framespace.y,
759 w, h); 759 w, h);
@@ -776,7 +776,7 @@ evas_object_render_pre_effect_updates(Eina_Array *rects, Evas_Object *eo_obj, in
776 obj->cur->cache.clip.w, 776 obj->cur->cache.clip.w,
777 obj->cur->cache.clip.h); 777 obj->cur->cache.clip.h);
778 if ((w > 0) && (h > 0)) 778 if ((w > 0) && (h > 0))
779 obj->layer->evas->engine.func->output_redraws_rect_add(ENC, ENDT, 779 obj->layer->evas->engine.func->output_redraws_rect_add(ENC,
780 x + e->framespace.x, 780 x + e->framespace.x,
781 y + e->framespace.y, 781 y + e->framespace.y,
782 w, h); 782 w, h);
@@ -788,7 +788,7 @@ evas_object_render_pre_effect_updates(Eina_Array *rects, Evas_Object *eo_obj, in
788 obj->prev->cache.clip.w, 788 obj->prev->cache.clip.w,
789 obj->prev->cache.clip.h); 789 obj->prev->cache.clip.h);
790 if ((w > 0) && (h > 0)) 790 if ((w > 0) && (h > 0))
791 obj->layer->evas->engine.func->output_redraws_rect_add(ENC, ENDT, 791 obj->layer->evas->engine.func->output_redraws_rect_add(ENC,
792 x + e->framespace.x, 792 x + e->framespace.x,
793 y + e->framespace.y, 793 y + e->framespace.y,
794 w, h); 794 w, h);
diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c
index 4c2dca9..5d2495c 100644
--- a/src/lib/evas/canvas/evas_render.c
+++ b/src/lib/evas/canvas/evas_render.c
@@ -303,12 +303,12 @@ static void
303_evas_render_prev_cur_clip_cache_add(Evas_Public_Data *evas, Evas_Object_Protected_Data *obj) 303_evas_render_prev_cur_clip_cache_add(Evas_Public_Data *evas, Evas_Object_Protected_Data *obj)
304{ 304{
305 // FIXME: Iterate over each output 305 // FIXME: Iterate over each output
306 ENFN->output_redraws_rect_add(ENC, ENDT, 306 ENFN->output_redraws_rect_add(ENC,
307 obj->prev->cache.clip.x + evas->framespace.x, 307 obj->prev->cache.clip.x + evas->framespace.x,
308 obj->prev->cache.clip.y + evas->framespace.y, 308 obj->prev->cache.clip.y + evas->framespace.y,
309 obj->prev->cache.clip.w, 309 obj->prev->cache.clip.w,
310 obj->prev->cache.clip.h); 310 obj->prev->cache.clip.h);
311 ENFN->output_redraws_rect_add(ENC, ENDT, 311 ENFN->output_redraws_rect_add(ENC,
312 obj->cur->cache.clip.x + evas->framespace.x, 312 obj->cur->cache.clip.x + evas->framespace.x,
313 obj->cur->cache.clip.y + evas->framespace.y, 313 obj->cur->cache.clip.y + evas->framespace.y,
314 obj->cur->cache.clip.w, 314 obj->cur->cache.clip.w,
@@ -556,7 +556,7 @@ _evas_render_object_map_change_update(Evas_Public_Data *evas,
556 obj->prev->clipper->prev->cache.clip.w, 556 obj->prev->clipper->prev->cache.clip.w,
557 obj->prev->clipper->prev->cache.clip.h); 557 obj->prev->clipper->prev->cache.clip.h);
558 } 558 }
559 ENFN->output_redraws_rect_add(ENC, ENDT, x + fx, y + fy, w, h); 559 ENFN->output_redraws_rect_add(ENC, x + fx, y + fy, w, h);
560 x = obj->map->cur.map->normal_geometry.x; 560 x = obj->map->cur.map->normal_geometry.x;
561 y = obj->map->cur.map->normal_geometry.y; 561 y = obj->map->cur.map->normal_geometry.y;
562 w = obj->map->cur.map->normal_geometry.w; 562 w = obj->map->cur.map->normal_geometry.w;
@@ -569,7 +569,7 @@ _evas_render_object_map_change_update(Evas_Public_Data *evas,
569 obj->cur->clipper->cur->cache.clip.w, 569 obj->cur->clipper->cur->cache.clip.w,
570 obj->cur->clipper->cur->cache.clip.h); 570 obj->cur->clipper->cur->cache.clip.h);
571 } 571 }
572 ENFN->output_redraws_rect_add(ENC, ENDT, x + fx, y + fy, w, h); 572 ENFN->output_redraws_rect_add(ENC, x + fx, y + fy, w, h);
573 } 573 }
574 else if (hmap) 574 else if (hmap)
575 { 575 {
@@ -585,7 +585,7 @@ _evas_render_object_map_change_update(Evas_Public_Data *evas,
585 obj->prev->clipper->prev->cache.clip.w, 585 obj->prev->clipper->prev->cache.clip.w,
586 obj->prev->clipper->prev->cache.clip.h); 586 obj->prev->clipper->prev->cache.clip.h);
587 } 587 }
588 ENFN->output_redraws_rect_add(ENC, ENDT, x + fx, y + fy, w, h); 588 ENFN->output_redraws_rect_add(ENC, x + fx, y + fy, w, h);
589 x = obj->cur->cache.clip.x; 589 x = obj->cur->cache.clip.x;
590 y = obj->cur->cache.clip.y; 590 y = obj->cur->cache.clip.y;
591 w = obj->cur->cache.clip.w; 591 w = obj->cur->cache.clip.w;
@@ -598,7 +598,7 @@ _evas_render_object_map_change_update(Evas_Public_Data *evas,
598 obj->cur->clipper->cur->cache.clip.w, 598 obj->cur->clipper->cur->cache.clip.w,
599 obj->cur->clipper->cur->cache.clip.h); 599 obj->cur->clipper->cur->cache.clip.h);
600 } 600 }
601 ENFN->output_redraws_rect_add(ENC, ENDT, x + fx, y + fy, w, h); 601 ENFN->output_redraws_rect_add(ENC, x + fx, y + fy, w, h);
602 } 602 }
603} 603}
604 604
@@ -626,7 +626,7 @@ evas_render_update_del(Evas_Public_Data *evas, int x, int y, int w, int h)
626 // FIXME: handle multiple output 626 // FIXME: handle multiple output
627 if (EINA_LIKELY((evas->update_del_redirect_array == NULL))) 627 if (EINA_LIKELY((evas->update_del_redirect_array == NULL)))
628 { 628 {
629 ENFN->output_redraws_rect_del(ENC, ENDT, x, y, w, h); 629 ENFN->output_redraws_rect_del(ENC, x, y, w, h);
630 } 630 }
631 else 631 else
632 { 632 {
@@ -2853,7 +2853,7 @@ skip_obscures:
2853 { 2853 {
2854 // FIXME: Only add necessary rects (if object itself hasn't changed) 2854 // FIXME: Only add necessary rects (if object itself hasn't changed)
2855 // FIXME: handle multiple output 2855 // FIXME: handle multiple output
2856 ENFN->output_redraws_rect_add(ENC, ENDT, x, y, w, h); 2856 ENFN->output_redraws_rect_add(ENC, x, y, w, h);
2857 } 2857 }
2858 2858
2859end: 2859end:
@@ -3238,7 +3238,7 @@ evas_render_updates_internal(Evas *eo_e,
3238 eina_evlog("+render_phase3", eo_e, 0.0, NULL); 3238 eina_evlog("+render_phase3", eo_e, 0.0, NULL);
3239 EINA_LIST_FREE(e->damages, r) 3239 EINA_LIST_FREE(e->damages, r)
3240 { 3240 {
3241 ENFN->output_redraws_rect_add(ENC, ENDT, r->x, r->y, r->w, r->h); 3241 ENFN->output_redraws_rect_add(ENC, r->x, r->y, r->w, r->h);
3242 eina_rectangle_free(r); 3242 eina_rectangle_free(r);
3243 } 3243 }
3244 eina_evlog("-render_phase3", eo_e, 0.0, NULL); 3244 eina_evlog("-render_phase3", eo_e, 0.0, NULL);
@@ -3247,12 +3247,12 @@ evas_render_updates_internal(Evas *eo_e,
3247 eina_evlog("+render_phase4", eo_e, 0.0, NULL); 3247 eina_evlog("+render_phase4", eo_e, 0.0, NULL);
3248 if (e->viewport.changed) 3248 if (e->viewport.changed)
3249 { 3249 {
3250 ENFN->output_redraws_rect_add(ENC, ENDT, 0, 0, e->output.w, e->output.h); 3250 ENFN->output_redraws_rect_add(ENC, 0, 0, e->output.w, e->output.h);
3251 } 3251 }
3252 if (e->output.changed) 3252 if (e->output.changed)
3253 { 3253 {
3254 ENFN->output_resize(ENC, ENDT, e->output.w, e->output.h); 3254 ENFN->output_resize(ENC, ENDT, e->output.w, e->output.h);
3255 ENFN->output_redraws_rect_add(ENC, ENDT, 0, 0, e->output.w, e->output.h); 3255 ENFN->output_redraws_rect_add(ENC, 0, 0, e->output.w, e->output.h);
3256 } 3256 }
3257 if ((e->output.w != e->viewport.w) || (e->output.h != e->viewport.h)) 3257 if ((e->output.w != e->viewport.w) || (e->output.h != e->viewport.h))
3258 { 3258 {
@@ -3265,14 +3265,14 @@ evas_render_updates_internal(Evas *eo_e,
3265 * which covers the Whole viewport. This is because 'framespace' is 3265 * which covers the Whole viewport. This is because 'framespace' is
3266 * defined as "the space IN the viewport which is Occupied by the 3266 * defined as "the space IN the viewport which is Occupied by the
3267 * window frame" */ 3267 * window frame" */
3268 ENFN->output_redraws_rect_add(ENC, ENDT, 3268 ENFN->output_redraws_rect_add(ENC,
3269 e->viewport.x, e->viewport.y, 3269 e->viewport.x, e->viewport.y,
3270 e->viewport.w, e->viewport.h); 3270 e->viewport.w, e->viewport.h);
3271 } 3271 }
3272 3272
3273 if (redraw_all) 3273 if (redraw_all)
3274 { 3274 {
3275 ENFN->output_redraws_rect_add(ENC, ENDT, 0, 0, e->output.w, e->output.h); 3275 ENFN->output_redraws_rect_add(ENC, 0, 0, e->output.w, e->output.h);
3276 } 3276 }
3277 eina_evlog("-render_phase4", eo_e, 0.0, NULL); 3277 eina_evlog("-render_phase4", eo_e, 0.0, NULL);
3278 3278
diff --git a/src/lib/evas/include/evas_inline.x b/src/lib/evas/include/evas_inline.x
index 74eb25a..7886a0f 100644
--- a/src/lib/evas/include/evas_inline.x
+++ b/src/lib/evas/include/evas_inline.x
@@ -359,13 +359,7 @@ _evas_default_output_get(Evas_Public_Data *e)
359static inline void * 359static inline void *
360_evas_engine_context(Evas_Public_Data *e) 360_evas_engine_context(Evas_Public_Data *e)
361{ 361{
362 // Need to split between engine context 362 return e->backend;
363 // and output context, use one for now.
364 Efl_Canvas_Output *output;
365
366 if (!e->outputs) return NULL;
367 output = eina_list_data_get(e->outputs);
368 return output->output;
369} 363}
370 364
371#define _EVAS_COLOR_CLAMP(x, y) do { \ 365#define _EVAS_COLOR_CLAMP(x, y) do { \
diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h
index 1765464..b1ae9c7 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -963,6 +963,7 @@ struct _Evas_Public_Data
963 Eina_List *devices; 963 Eina_List *devices;
964 Eina_Array *cur_device; 964 Eina_Array *cur_device;
965 965
966 void *backend;
966 Eina_List *outputs; 967 Eina_List *outputs;
967 968
968 Evas_Device *default_seat; 969 Evas_Device *default_seat;
@@ -1394,14 +1395,19 @@ struct _Evas_Object_Func
1394 1395
1395struct _Evas_Func 1396struct _Evas_Func
1396{ 1397{
1398 void *(*engine_new) (void);
1399 void (*engine_free) (void *engine);
1400
1397 void (*output_info_setup) (void *info); 1401 void (*output_info_setup) (void *info);
1398 void *(*output_setup) (void *engine, void *info, unsigned int w, unsigned int h); 1402 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); 1403 int (*output_update) (void *engine, void *data, void *info, unsigned int w, unsigned int h);
1400
1401 void (*output_free) (void *engine, void *data); 1404 void (*output_free) (void *engine, void *data);
1402 void (*output_resize) (void *engine, void *data, int w, int h); 1405 void (*output_resize) (void *engine, void *data, int w, int h);
1403 void (*output_redraws_rect_add) (void *engine, void *data, int x, int y, int w, int h); 1406
1404 void (*output_redraws_rect_del) (void *engine, void *data, int x, int y, int w, int h); 1407 /* The redraws are automatically propagated on all output */
1408 void (*output_redraws_rect_add) (void *engine, int x, int y, int w, int h);
1409 void (*output_redraws_rect_del) (void *engine, int x, int y, int w, int h);
1410
1405 void (*output_redraws_clear) (void *engine, void *data); 1411 void (*output_redraws_clear) (void *engine, void *data);
1406 void *(*output_redraws_next_update_get) (void *engine, void *data, int *x, int *y, int *w, int *h, int *cx, int *cy, int *cw, int *ch); 1412 void *(*output_redraws_next_update_get) (void *engine, void *data, int *x, int *y, int *w, int *h, int *cx, int *cy, int *cw, int *ch);
1407 void (*output_redraws_next_update_push) (void *engine, void *data, void *surface, int x, int y, int w, int h, Evas_Render_Mode render_mode); 1413 void (*output_redraws_next_update_push) (void *engine, void *data, void *surface, int x, int y, int w, int h, Evas_Render_Mode render_mode);
diff --git a/src/modules/evas/engines/buffer/evas_engine.c b/src/modules/evas/engines/buffer/evas_engine.c
index 7ece6c6..68af177 100644
--- a/src/modules/evas/engines/buffer/evas_engine.c
+++ b/src/modules/evas/engines/buffer/evas_engine.c
@@ -24,7 +24,7 @@ static void eng_output_free(void *engine EINA_UNUSED, void *data);
24 24
25/* engine api this module provides */ 25/* engine api this module provides */
26static void * 26static void *
27eng_output_setup(void *engine EINA_UNUSED, void *in, unsigned int w, unsigned int h) 27eng_output_setup(void *engine, void *in, unsigned int w, unsigned int h)
28{ 28{
29 Evas_Engine_Info_Buffer *info = in; 29 Evas_Engine_Info_Buffer *info = in;
30 Outbuf *ob; 30 Outbuf *ob;
@@ -74,7 +74,7 @@ eng_output_setup(void *engine EINA_UNUSED, void *in, unsigned int w, unsigned in
74 info->info.switch_data); 74 info->info.switch_data);
75 if (!ob) goto on_error; 75 if (!ob) goto on_error;
76 76
77 if (!evas_render_engine_software_generic_init(re, ob, 77 if (!evas_render_engine_software_generic_init(engine, re, ob,
78 evas_buffer_outbuf_buf_swap_mode_get, 78 evas_buffer_outbuf_buf_swap_mode_get,
79 evas_buffer_outbuf_buf_rot_get, 79 evas_buffer_outbuf_buf_rot_get,
80 evas_buffer_outbuf_reconfigure, 80 evas_buffer_outbuf_reconfigure,
@@ -106,13 +106,13 @@ eng_output_info_setup(void *info)
106} 106}
107 107
108static void 108static void
109eng_output_free(void *engine EINA_UNUSED, void *data) 109eng_output_free(void *engine, void *data)
110{ 110{
111 Render_Engine *re; 111 Render_Engine *re;
112 112
113 if ((re = (Render_Engine *)data)) 113 if ((re = (Render_Engine *)data))
114 { 114 {
115 evas_render_engine_software_generic_clean(re); 115 evas_render_engine_software_generic_clean(engine, re);
116 free(re); 116 free(re);
117 } 117 }
118} 118}
diff --git a/src/modules/evas/engines/drm/evas_engine.c b/src/modules/evas/engines/drm/evas_engine.c
index ca05530..5cbd5e1 100644
--- a/src/modules/evas/engines/drm/evas_engine.c
+++ b/src/modules/evas/engines/drm/evas_engine.c
@@ -19,7 +19,7 @@ static Evas_Func func, pfunc;
19int _evas_engine_drm_log_dom; 19int _evas_engine_drm_log_dom;
20 20
21static void * 21static void *
22eng_output_setup(void *engine EINA_UNUSED, void *einfo, unsigned int w, unsigned int h) 22eng_output_setup(void *engine, void *einfo, unsigned int w, unsigned int h)
23{ 23{
24 Evas_Engine_Info_Drm *info = einfo; 24 Evas_Engine_Info_Drm *info = einfo;
25 Render_Engine *re; 25 Render_Engine *re;
@@ -33,7 +33,7 @@ eng_output_setup(void *engine EINA_UNUSED, void *einfo, unsigned int w, unsigned
33 33
34 re->dev = info->info.dev; 34 re->dev = info->info.dev;
35 35
36 if (!evas_render_engine_software_generic_init(&re->generic, ob, 36 if (!evas_render_engine_software_generic_init(engine, &re->generic, ob,
37 _outbuf_state_get, 37 _outbuf_state_get,
38 _outbuf_rotation_get, 38 _outbuf_rotation_get,
39 _outbuf_reconfigure, 39 _outbuf_reconfigure,
@@ -52,7 +52,7 @@ eng_output_setup(void *engine EINA_UNUSED, void *einfo, unsigned int w, unsigned
52 return re; 52 return re;
53 53
54init_err: 54init_err:
55 evas_render_engine_software_generic_clean(&re->generic); 55 evas_render_engine_software_generic_clean(engine, &re->generic);
56err: 56err:
57 free(re); 57 free(re);
58 return NULL; 58 return NULL;
@@ -82,11 +82,11 @@ eng_output_update(void *engine EINA_UNUSED, void *data, void *einfo, unsigned in
82} 82}
83 83
84static void 84static void
85eng_output_free(void *engine EINA_UNUSED, void *data) 85eng_output_free(void *engine, void *data)
86{ 86{
87 Render_Engine *re = data; 87 Render_Engine *re = data;
88 88
89 evas_render_engine_software_generic_clean(&re->generic); 89 evas_render_engine_software_generic_clean(engine, &re->generic);
90 free(re); 90 free(re);
91} 91}
92 92
diff --git a/src/modules/evas/engines/eglfs/evas_engine.c b/src/modules/evas/engines/eglfs/evas_engine.c
index e33c52b..88321d8 100644
--- a/src/modules/evas/engines/eglfs/evas_engine.c
+++ b/src/modules/evas/engines/eglfs/evas_engine.c
@@ -679,7 +679,7 @@ eng_output_info_setup(void *info)
679} 679}
680 680
681static void * 681static void *
682eng_output_setup(void *engine EINA_UNUSED, void *in, unsigned int w, unsigned int h) 682eng_output_setup(void *engine, void *in, unsigned int w, unsigned int h)
683{ 683{
684 Evas_Engine_Info_Eglfs *info = in; 684 Evas_Engine_Info_Eglfs *info = in;
685 Render_Engine *re = NULL; 685 Render_Engine *re = NULL;
@@ -701,7 +701,7 @@ eng_output_setup(void *engine EINA_UNUSED, void *in, unsigned int w, unsigned in
701 701
702 ob->evas = evas; 702 ob->evas = evas;
703 703
704 if (!evas_render_engine_gl_generic_init(&re->generic, ob, 704 if (!evas_render_engine_gl_generic_init(engine, &re->generic, ob,
705 evas_outbuf_buffer_state_get, 705 evas_outbuf_buffer_state_get,
706 evas_outbuf_rot_get, 706 evas_outbuf_rot_get,
707 evas_outbuf_reconfigure, 707 evas_outbuf_reconfigure,
@@ -796,7 +796,7 @@ eng_output_update(void *engine EINA_UNUSED, void *data, void *info, unsigned int
796} 796}
797 797
798static void 798static void
799eng_output_free(void *engine EINA_UNUSED, void *data) 799eng_output_free(void *engine, void *data)
800{ 800{
801 Render_Engine *re; 801 Render_Engine *re;
802 802
@@ -808,7 +808,7 @@ eng_output_free(void *engine EINA_UNUSED, void *data)
808 if (gl_wins == 1) glsym_evgl_engine_shutdown(re); 808 if (gl_wins == 1) glsym_evgl_engine_shutdown(re);
809 809
810 /* NB: evas_render_engine_software_generic_clean() frees ob */ 810 /* NB: evas_render_engine_software_generic_clean() frees ob */
811 evas_render_engine_software_generic_clean(&re->generic.software); 811 evas_render_engine_software_generic_clean(engine, &re->generic.software);
812 812
813 gl_wins--; 813 gl_wins--;
814 814
diff --git a/src/modules/evas/engines/fb/evas_engine.c b/src/modules/evas/engines/fb/evas_engine.c
index 635d1ae..c29e8f2 100644
--- a/src/modules/evas/engines/fb/evas_engine.c
+++ b/src/modules/evas/engines/fb/evas_engine.c
@@ -18,7 +18,7 @@ typedef Render_Output_Software_Generic Render_Engine;
18 18
19/* engine api this module provides */ 19/* engine api this module provides */
20static void * 20static void *
21eng_output_setup(void *engine EINA_UNUSED, void *in, unsigned int w, unsigned int h) 21eng_output_setup(void *engine, void *in, unsigned int w, unsigned int h)
22{ 22{
23 Evas_Engine_Info_FB *info = in; 23 Evas_Engine_Info_FB *info = in;
24 Render_Engine *re; 24 Render_Engine *re;
@@ -38,7 +38,7 @@ eng_output_setup(void *engine EINA_UNUSED, void *in, unsigned int w, unsigned in
38 info->info.refresh); 38 info->info.refresh);
39 if (!ob) goto on_error; 39 if (!ob) goto on_error;
40 40
41 if (!evas_render_engine_software_generic_init(re, ob, NULL, 41 if (!evas_render_engine_software_generic_init(engine, re, ob, NULL,
42 evas_fb_outbuf_fb_get_rot, 42 evas_fb_outbuf_fb_get_rot,
43 evas_fb_outbuf_fb_reconfigure, 43 evas_fb_outbuf_fb_reconfigure,
44 NULL, 44 NULL,
@@ -74,7 +74,7 @@ eng_output_info_setup(void *info)
74} 74}
75 75
76static void 76static void
77eng_output_free(void *engine EINA_UNUSED, void *data) 77eng_output_free(void *engine, void *data)
78{ 78{
79 Render_Engine *re; 79 Render_Engine *re;
80 80
@@ -82,7 +82,7 @@ eng_output_free(void *engine EINA_UNUSED, void *data)
82 if (re) 82 if (re)
83 { 83 {
84 _outbufs = eina_list_remove(_outbufs, re->ob); 84 _outbufs = eina_list_remove(_outbufs, re->ob);
85 evas_render_engine_software_generic_clean(re); 85 evas_render_engine_software_generic_clean(engine, re);
86 free(re); 86 free(re);
87 } 87 }
88} 88}
diff --git a/src/modules/evas/engines/gl_cocoa/evas_engine.c b/src/modules/evas/engines/gl_cocoa/evas_engine.c
index 92fcb31..6143017 100644
--- a/src/modules/evas/engines/gl_cocoa/evas_engine.c
+++ b/src/modules/evas/engines/gl_cocoa/evas_engine.c
@@ -126,7 +126,7 @@ static const EVGL_Interface evgl_funcs =
126}; 126};
127 127
128static void * 128static void *
129eng_output_setup(void *engine EINA_UNUSED, void *in, unsigned int w, unsigned int h) 129eng_output_setup(void *engine, void *in, unsigned int w, unsigned int h)
130{ 130{
131 Evas_Engine_Info_GL_Cocoa *const info = in; 131 Evas_Engine_Info_GL_Cocoa *const info = in;
132 Render_Engine *re; 132 Render_Engine *re;
@@ -157,7 +157,7 @@ eng_output_setup(void *engine EINA_UNUSED, void *in, unsigned int w, unsigned in
157 157
158 info->view = ob->ns_gl_view; 158 info->view = ob->ns_gl_view;
159 159
160 chk = evas_render_engine_gl_generic_init(&re->generic, ob, 160 chk = evas_render_engine_gl_generic_init(engine, &re->generic, ob,
161 evas_outbuf_buffer_state_get, 161 evas_outbuf_buffer_state_get,
162 evas_outbuf_rot_get, 162 evas_outbuf_rot_get,
163 evas_outbuf_reconfigure, 163 evas_outbuf_reconfigure,
diff --git a/src/modules/evas/engines/gl_drm/evas_engine.c b/src/modules/evas/engines/gl_drm/evas_engine.c
index ce5358f..1993a98 100644
--- a/src/modules/evas/engines/gl_drm/evas_engine.c
+++ b/src/modules/evas/engines/gl_drm/evas_engine.c
@@ -900,7 +900,7 @@ eng_output_info_setup(void *info)
900} 900}
901 901
902static void * 902static void *
903eng_output_setup(void *engine EINA_UNUSED, void *in, unsigned int w, unsigned int h) 903eng_output_setup(void *engine, void *in, unsigned int w, unsigned int h)
904{ 904{
905 Evas_Engine_Info_GL_Drm *info = in; 905 Evas_Engine_Info_GL_Drm *info = in;
906 Render_Engine *re = NULL; 906 Render_Engine *re = NULL;
@@ -933,7 +933,7 @@ eng_output_setup(void *engine EINA_UNUSED, void *in, unsigned int w, unsigned in
933 return NULL; 933 return NULL;
934 } 934 }
935 935
936 if (!evas_render_engine_gl_generic_init(&re->generic, ob, 936 if (!evas_render_engine_gl_generic_init(engine, &re->generic, ob,
937 evas_outbuf_buffer_state_get, 937 evas_outbuf_buffer_state_get,
938 evas_outbuf_rot_get, 938 evas_outbuf_rot_get,
939 evas_outbuf_reconfigure, 939 evas_outbuf_reconfigure,
@@ -1028,7 +1028,7 @@ eng_output_update(void *engine EINA_UNUSED, void *data, void *in, unsigned int w
1028} 1028}
1029 1029
1030static void 1030static void
1031eng_output_free(void *engine EINA_UNUSED, void *data) 1031eng_output_free(void *engine, void *data)
1032{ 1032{
1033 Render_Engine *re; 1033 Render_Engine *re;
1034 1034
@@ -1043,7 +1043,7 @@ eng_output_free(void *engine EINA_UNUSED, void *data)
1043 1043
1044 info = eng_get_ob(re)->info; 1044 info = eng_get_ob(re)->info;
1045 /* NB: evas_render_engine_software_generic_clean() frees ob */ 1045 /* NB: evas_render_engine_software_generic_clean() frees ob */
1046 evas_render_engine_software_generic_clean(&re->generic.software); 1046 evas_render_engine_software_generic_clean(engine, &re->generic.software);
1047 1047
1048 eng_gbm_shutdown(info); 1048 eng_gbm_shutdown(info);
1049 gl_wins--; 1049 gl_wins--;
diff --git a/src/modules/evas/engines/gl_generic/Evas_Engine_GL_Generic.h b/src/modules/evas/engines/gl_generic/Evas_Engine_GL_Generic.h
index 89bcbf6..7fdcea5 100644
--- a/src/modules/evas/engines/gl_generic/Evas_Engine_GL_Generic.h
+++ b/src/modules/evas/engines/gl_generic/Evas_Engine_GL_Generic.h
@@ -41,7 +41,8 @@ struct _Render_Output_GL_Generic
41}; 41};
42 42
43static inline Eina_Bool 43static inline Eina_Bool
44evas_render_engine_gl_generic_init(Render_Output_GL_Generic *re, 44evas_render_engine_gl_generic_init(Render_Engine_Software_Generic *engine,
45 Render_Output_GL_Generic *re,
45 Outbuf *ob, 46 Outbuf *ob,
46 Outbuf_Swap_Mode_Get outbuf_swap_mode_get, 47 Outbuf_Swap_Mode_Get outbuf_swap_mode_get,
47 Outbuf_Get_Rot outbuf_get_rot, 48 Outbuf_Get_Rot outbuf_get_rot,
@@ -63,7 +64,7 @@ evas_render_engine_gl_generic_init(Render_Output_GL_Generic *re,
63 const EVGL_Interface *evgl_funcs, 64 const EVGL_Interface *evgl_funcs,
64 int w, int h) 65 int w, int h)
65{ 66{
66 if (!evas_render_engine_software_generic_init(&re->software, ob, 67 if (!evas_render_engine_software_generic_init(engine, &re->software, ob,
67 outbuf_swap_mode_get, 68 outbuf_swap_mode_get,
68 outbuf_get_rot, 69 outbuf_get_rot,
69 outbuf_reconfigure, 70 outbuf_reconfigure,
diff --git a/src/modules/evas/engines/gl_sdl/evas_engine.c b/src/modules/evas/engines/gl_sdl/evas_engine.c
index bec1189..847ecc6 100644
--- a/src/modules/evas/engines/gl_sdl/evas_engine.c
+++ b/src/modules/evas/engines/gl_sdl/evas_engine.c
@@ -267,7 +267,7 @@ static const EVGL_Interface evgl_funcs =
267}; 267};
268 268
269static void * 269static void *
270eng_output_setup(void *engine EINA_UNUSED, void *in, unsigned int w, unsigned int h) 270eng_output_setup(void *engine, void *in, unsigned int w, unsigned int h)
271{ 271{
272 Render_Engine *re = NULL; 272 Render_Engine *re = NULL;
273 Outbuf *ob = NULL; 273 Outbuf *ob = NULL;
@@ -282,7 +282,7 @@ eng_output_setup(void *engine EINA_UNUSED, void *in, unsigned int w, unsigned in
282 re = calloc(1, sizeof (Render_Engine)); 282 re = calloc(1, sizeof (Render_Engine));
283 if (!re) goto on_error; 283 if (!re) goto on_error;
284 284
285 if (!evas_render_engine_gl_generic_init(&re->generic, ob, NULL, 285 if (!evas_render_engine_gl_generic_init(engine, &re->generic, ob, NULL,
286 _outbuf_get_rot, 286 _outbuf_get_rot,
287 _outbuf_reconfigure, 287 _outbuf_reconfigure,
288 _outbuf_region_first_rect, 288 _outbuf_region_first_rect,
@@ -313,11 +313,11 @@ eng_output_setup(void *engine EINA_UNUSED, void *in, unsigned int w, unsigned in
313} 313}
314 314
315static void 315static void
316eng_output_free(void *engine EINA_UNUSED, void *data) 316eng_output_free(void *engine, void *data)
317{ 317{
318 Render_Engine *re = data; 318 Render_Engine *re = data;
319 319
320 evas_render_engine_software_generic_clean(&re->generic.software); 320 evas_render_engine_software_generic_clean(engine, &re->generic.software);
321} 321}
322 322
323static void 323static void
diff --git a/src/modules/evas/engines/gl_x11/evas_engine.c b/src/modules/evas/engines/gl_x11/evas_engine.c
index cb3ca43..c885353 100644
--- a/src/modules/evas/engines/gl_x11/evas_engine.c
+++ b/src/modules/evas/engines/gl_x11/evas_engine.c
@@ -1576,7 +1576,7 @@ _re_winfree(Render_Engine *re)
1576} 1576}
1577 1577
1578static void * 1578static void *
1579eng_output_setup(void *engine EINA_UNUSED, void *in, unsigned int w, unsigned int h) 1579eng_output_setup(void *engine, void *in, unsigned int w, unsigned int h)
1580{ 1580{
1581 Evas_Engine_Info_GL_X11 *info = in; 1581 Evas_Engine_Info_GL_X11 *info = in;
1582 Render_Engine *re = NULL; 1582 Render_Engine *re = NULL;
@@ -1639,7 +1639,7 @@ eng_output_setup(void *engine EINA_UNUSED, void *in, unsigned int w, unsigned in
1639 info->msaa_bits); 1639 info->msaa_bits);
1640 if (!ob) goto on_error; 1640 if (!ob) goto on_error;
1641 1641
1642 if (!evas_render_engine_gl_generic_init(&re->generic, ob, 1642 if (!evas_render_engine_gl_generic_init(engine, &re->generic, ob,
1643 eng_outbuf_swap_mode, 1643 eng_outbuf_swap_mode,
1644 eng_outbuf_get_rot, 1644 eng_outbuf_get_rot,
1645 eng_outbuf_reconfigure, 1645 eng_outbuf_reconfigure,
@@ -1751,7 +1751,7 @@ eng_output_update(void *engine EINA_UNUSED, void *data, void *in, unsigned int w
1751} 1751}
1752 1752
1753static void 1753static void
1754eng_output_free(void *engine EINA_UNUSED, void *data) 1754eng_output_free(void *engine, void *data)
1755{ 1755{
1756 Render_Engine *re; 1756 Render_Engine *re;
1757 1757
@@ -1780,7 +1780,7 @@ eng_output_free(void *engine EINA_UNUSED, void *data)
1780 1780
1781 if (gl_wins == 1) glsym_evgl_engine_shutdown(re); 1781 if (gl_wins == 1) glsym_evgl_engine_shutdown(re);
1782 1782
1783 evas_render_engine_software_generic_clean(&re->generic.software); 1783 evas_render_engine_software_generic_clean(engine, &re->generic.software);
1784 1784
1785#ifndef GL_GLES 1785#ifndef GL_GLES
1786 if (glsym_glXReleaseBuffersMESA) 1786 if (glsym_glXReleaseBuffersMESA)
diff --git a/src/modules/evas/engines/software_ddraw/evas_engine.c b/src/modules/evas/engines/software_ddraw/evas_engine.c
index a935922..f8882e8 100644
--- a/src/modules/evas/engines/software_ddraw/evas_engine.c
+++ b/src/modules/evas/engines/software_ddraw/evas_engine.c
@@ -21,7 +21,7 @@ int _evas_log_dom_module = -1;
21/* engine api this module provides */ 21/* engine api this module provides */
22 22
23static void * 23static void *
24eng_output_setup(void *engine EINA_UNUSED, void *in, unsigned int w, unsigned int h) 24eng_output_setup(void *engine, void *in, unsigned int w, unsigned int h)
25{ 25{
26 Evas_Engine_Info_Software_DDraw *info = in; 26 Evas_Engine_Info_Software_DDraw *info = in;
27 Render_Engine *re; 27 Render_Engine *re;
@@ -40,7 +40,7 @@ eng_output_setup(void *engine EINA_UNUSED, void *in, unsigned int w, unsigned in
40 info->info.fullscreen); 40 info->info.fullscreen);
41 if (!ob) goto on_error; 41 if (!ob) goto on_error;
42 42
43 if (!evas_render_engine_software_generic_init(&re->generic, ob, NULL, 43 if (!evas_render_engine_software_generic_init(engine, &re->generic, ob, NULL,
44 evas_software_ddraw_outbuf_rot_get, 44 evas_software_ddraw_outbuf_rot_get,
45 evas_software_ddraw_outbuf_reconfigure, 45 evas_software_ddraw_outbuf_reconfigure,
46 NULL, 46 NULL,
@@ -72,14 +72,14 @@ eng_output_info_setup(void *info)
72} 72}
73 73
74static void 74static void
75eng_output_free(void *engine EINA_UNUSED, void *data) 75eng_output_free(void *engine, void *data)
76{ 76{
77 Render_Engine *re; 77 Render_Engine *re;
78 78
79 if (!data) return; 79 if (!data) return;
80 80
81 re = (Render_Engine *)data; 81 re = (Render_Engine *)data;
82 evas_render_engine_software_generic_clean(&re->generic); 82 evas_render_engine_software_generic_clean(engine, &re->generic);
83 free(re); 83 free(re);
84} 84}
85 85
diff --git a/src/modules/evas/engines/software_gdi/evas_engine.c b/src/modules/evas/engines/software_gdi/evas_engine.c
index 462a379..10562d3 100644
--- a/src/modules/evas/engines/software_gdi/evas_engine.c
+++ b/src/modules/evas/engines/software_gdi/evas_engine.c
@@ -17,7 +17,7 @@ struct _Render_Engine
17 17
18/* engine api this module provides */ 18/* engine api this module provides */
19static void * 19static void *
20eng_output_setup(void *engine EINA_UNUSED, void *in, unsigned int w, unsigned int h) 20eng_output_setup(void *engine, void *in, unsigned int w, unsigned int h)
21{ 21{
22 Evas_Engine_Info_Software_Gdi *info = in; 22 Evas_Engine_Info_Software_Gdi *info = in;
23 Render_Engine *re; 23 Render_Engine *re;
@@ -44,7 +44,7 @@ eng_output_setup(void *engine EINA_UNUSED, void *in, unsigned int w, unsigned in
44 0, 0); 44 0, 0);
45 if (!ob) goto on_error; 45 if (!ob) goto on_error;
46 46
47 if (!evas_render_engine_software_generic_init(&re->generic, ob, NULL, 47 if (!evas_render_engine_software_generic_init(engine, &re->generic, ob, NULL,
48 evas_software_gdi_outbuf_rot_get, 48 evas_software_gdi_outbuf_rot_get,
49 evas_software_gdi_outbuf_reconfigure, 49 evas_software_gdi_outbuf_reconfigure,
50 NULL, 50 NULL,
@@ -97,14 +97,14 @@ eng_output_update(void *engine EINA_UNUSED, void *data, void *in, unsigned int w
97} 97}
98 98
99static void 99static void
100eng_output_free(void *engine EINA_UNUSED, void *data) 100eng_output_free(void *engine, void *data)
101{ 101{
102 Render_Engine *re; 102 Render_Engine *re;
103 103
104 if (!data) return; 104 if (!data) return;
105 105
106 re = (Render_Engine *)data; 106 re = (Render_Engine *)data;
107 evas_render_engine_software_generic_clean(&re->generic); 107 evas_render_engine_software_generic_clean(engine, &re->generic);
108 free(re); 108 free(re);
109} 109}
110 110
diff --git a/src/modules/evas/engines/software_generic/Evas_Engine_Software_Generic.h b/src/modules/evas/engines/software_generic/Evas_Engine_Software_Generic.h
index d563b56..48ab061 100644
--- a/src/modules/evas/engines/software_generic/Evas_Engine_Software_Generic.h
+++ b/src/modules/evas/engines/software_generic/Evas_Engine_Software_Generic.h
@@ -32,6 +32,7 @@ typedef enum
32 MERGE_SMART = 4 32 MERGE_SMART = 4
33} Render_Output_Merge_Mode; 33} Render_Output_Merge_Mode;
34 34
35typedef struct _Render_Engine_Software_Generic Render_Engine_Software_Generic;
35typedef struct _Render_Output_Software_Generic Render_Output_Software_Generic; 36typedef struct _Render_Output_Software_Generic Render_Output_Software_Generic;
36typedef struct _Outbuf Outbuf; 37typedef struct _Outbuf Outbuf;
37 38
@@ -79,8 +80,19 @@ struct _Render_Output_Software_Generic
79 unsigned char tile_strict : 1; 80 unsigned char tile_strict : 1;
80}; 81};
81 82
83struct _Render_Engine_Software_Generic
84{
85 Eina_List *outputs;
86
87 struct {
88 int w, h;
89 Eina_Bool strict;
90 } tile;
91};
92
82static inline Eina_Bool 93static inline Eina_Bool
83evas_render_engine_software_generic_init(Render_Output_Software_Generic *re, 94evas_render_engine_software_generic_init(Render_Engine_Software_Generic *engine,
95 Render_Output_Software_Generic *re,
84 Outbuf *ob, 96 Outbuf *ob,
85 Outbuf_Swap_Mode_Get outbuf_swap_mode_get, 97 Outbuf_Swap_Mode_Get outbuf_swap_mode_get,
86 Outbuf_Get_Rot outbuf_get_rot, 98 Outbuf_Get_Rot outbuf_get_rot,
@@ -131,11 +143,14 @@ evas_render_engine_software_generic_init(Render_Output_Software_Generic *re,
131 /* in preliminary tests 16x16 gave highest framerates */ 143 /* in preliminary tests 16x16 gave highest framerates */
132 evas_common_tilebuf_set_tile_size(re->tb, TILESIZE, TILESIZE); 144 evas_common_tilebuf_set_tile_size(re->tb, TILESIZE, TILESIZE);
133 145
146 engine->outputs = eina_list_append(engine->outputs, re);
147
134 return EINA_TRUE; 148 return EINA_TRUE;
135} 149}
136 150
137static inline void 151static inline void
138evas_render_engine_software_generic_clean(Render_Output_Software_Generic *re) 152evas_render_engine_software_generic_clean(Render_Engine_Software_Generic *engine,
153 Render_Output_Software_Generic *re)
139{ 154{
140 if (re->tb) evas_common_tilebuf_free(re->tb); 155 if (re->tb) evas_common_tilebuf_free(re->tb);
141 if (re->ob) re->outbuf_free(re->ob); 156 if (re->ob) re->outbuf_free(re->ob);
@@ -146,6 +161,8 @@ evas_render_engine_software_generic_clean(Render_Output_Software_Generic *re)
146 if (re->rects_prev[2]) evas_common_tilebuf_free_render_rects(re->rects_prev[2]); 161 if (re->rects_prev[2]) evas_common_tilebuf_free_render_rects(re->rects_prev[2]);
147 if (re->rects_prev[3]) evas_common_tilebuf_free_render_rects(re->rects_prev[3]); 162 if (re->rects_prev[3]) evas_common_tilebuf_free_render_rects(re->rects_prev[3]);
148 163
164 engine->outputs = eina_list_remove(engine->outputs, re);
165
149 memset(re, 0, sizeof (Render_Output_Software_Generic)); 166 memset(re, 0, sizeof (Render_Output_Software_Generic));
150} 167}
151 168
diff --git a/src/modules/evas/engines/software_generic/evas_engine.c b/src/modules/evas/engines/software_generic/evas_engine.c
index 3ea6c71..af80a9b 100644
--- a/src/modules/evas/engines/software_generic/evas_engine.c
+++ b/src/modules/evas/engines/software_generic/evas_engine.c
@@ -3897,6 +3897,29 @@ eng_gl_rotation_angle_get(void *data EINA_UNUSED)
3897 initialized by evas_render_engine_software_generic_init(). 3897 initialized by evas_render_engine_software_generic_init().
3898 */ 3898 */
3899 3899
3900static void *
3901eng_engine_new(void)
3902{
3903 Render_Engine_Software_Generic *engine;
3904
3905 engine = calloc(1, sizeof (Render_Engine_Software_Generic));
3906 if (!engine) return NULL;
3907
3908 return engine;
3909}
3910
3911static void
3912eng_engine_free(void *engine)
3913{
3914 Render_Engine_Software_Generic *e = engine;
3915 Render_Output_Software_Generic *output;
3916
3917 EINA_LIST_FREE(e->outputs, output)
3918 ERR("Output %p not properly cleaned before engine destruction.", output);
3919
3920 free(e);
3921}
3922
3900static void 3923static void
3901eng_output_resize(void *engine EINA_UNUSED, void *data, int w, int h) 3924eng_output_resize(void *engine EINA_UNUSED, void *data, int w, int h)
3902{ 3925{
@@ -3917,21 +3940,25 @@ eng_output_resize(void *engine EINA_UNUSED, void *data, int w, int h)
3917} 3940}
3918 3941
3919static void 3942static void
3920eng_output_redraws_rect_add(void *engine EINA_UNUSED, void *data, int x, int y, int w, int h) 3943eng_output_redraws_rect_add(void *engine, int x, int y, int w, int h)
3921{ 3944{
3945 Render_Engine_Software_Generic *backend = engine;
3922 Render_Output_Software_Generic *re; 3946 Render_Output_Software_Generic *re;
3947 Eina_List *l;
3923 3948
3924 re = (Render_Output_Software_Generic *)data; 3949 EINA_LIST_FOREACH(backend->outputs, l, re)
3925 evas_common_tilebuf_add_redraw(re->tb, x, y, w, h); 3950 evas_common_tilebuf_add_redraw(re->tb, x, y, w, h);
3926} 3951}
3927 3952
3928static void 3953static void
3929eng_output_redraws_rect_del(void *engine EINA_UNUSED, void *data, int x, int y, int w, int h) 3954eng_output_redraws_rect_del(void *engine, int x, int y, int w, int h)
3930{ 3955{
3956 Render_Engine_Software_Generic *backend = engine;
3931 Render_Output_Software_Generic *re; 3957 Render_Output_Software_Generic *re;
3958 Eina_List *l;
3932 3959
3933 re = (Render_Output_Software_Generic *)data; 3960 EINA_LIST_FOREACH(backend->outputs, l, re)
3934 evas_common_tilebuf_del_redraw(re->tb, x, y, w, h); 3961 evas_common_tilebuf_del_redraw(re->tb, x, y, w, h);
3935} 3962}
3936 3963
3937static void 3964static void
@@ -4659,6 +4686,8 @@ eng_gfx_filter_process(void *data EINA_UNUSED, Evas_Filter_Command *cmd)
4659 4686
4660static Evas_Func func = 4687static Evas_Func func =
4661{ 4688{
4689 eng_engine_new,
4690 eng_engine_free,
4662 NULL, // eng_info_setup 4691 NULL, // eng_info_setup
4663 NULL, // eng_setup 4692 NULL, // eng_setup
4664 NULL, // eng_update 4693 NULL, // eng_update
diff --git a/src/modules/evas/engines/software_x11/evas_engine.c b/src/modules/evas/engines/software_x11/evas_engine.c
index c1cab73..49f3683 100644
--- a/src/modules/evas/engines/software_x11/evas_engine.c
+++ b/src/modules/evas/engines/software_x11/evas_engine.c
@@ -64,7 +64,7 @@ _output_egl_shutdown(Render_Engine *re)
64} 64}
65 65
66static void * 66static void *
67_output_xlib_setup(int w, int h, int rot, Display *disp, Drawable draw, 67_output_xlib_setup(void *engine, int w, int h, int rot, Display *disp, Drawable draw,
68 Visual *vis, Colormap cmap, int depth, int debug, 68 Visual *vis, Colormap cmap, int depth, int debug,
69 int grayscale, int max_colors, Pixmap mask, 69 int grayscale, int max_colors, Pixmap mask,
70 int shape_dither, int destination_alpha) 70 int shape_dither, int destination_alpha)
@@ -96,7 +96,7 @@ _output_xlib_setup(int w, int h, int rot, Display *disp, Drawable draw,
96// re->ob->onebuf = 1; 96// re->ob->onebuf = 1;
97 97
98 evas_software_xlib_outbuf_debug_set(ob, debug); 98 evas_software_xlib_outbuf_debug_set(ob, debug);
99 if (!evas_render_engine_software_generic_init(&re->generic, ob, NULL, 99 if (!evas_render_engine_software_generic_init(engine, &re->generic, ob, NULL,
100 evas_software_xlib_outbuf_get_rot, 100 evas_software_xlib_outbuf_get_rot,
101 evas_software_xlib_outbuf_reconfigure, 101 evas_software_xlib_outbuf_reconfigure,
102 NULL, 102 NULL,
@@ -122,7 +122,7 @@ on_error:
122} 122}
123 123
124static void * 124static void *
125_output_swapbuf_setup(int w, int h, int rot, Display *disp, Drawable draw, 125_output_swapbuf_setup(void *engine, int w, int h, int rot, Display *disp, Drawable draw,
126 Visual *vis, Colormap cmap, int depth, 126 Visual *vis, Colormap cmap, int depth,
127 int debug EINA_UNUSED, 127 int debug EINA_UNUSED,
128 int grayscale, int max_colors, Pixmap mask, 128 int grayscale, int max_colors, Pixmap mask,
@@ -144,7 +144,7 @@ _output_swapbuf_setup(int w, int h, int rot, Display *disp, Drawable draw,
144 destination_alpha); 144 destination_alpha);
145 if (!ob) goto on_error; 145 if (!ob) goto on_error;
146 146
147 if (!evas_render_engine_software_generic_init(&re->generic, ob, 147 if (!evas_render_engine_software_generic_init(engine, &re->generic, ob,
148 evas_software_xlib_swapbuf_buffer_state_get, 148 evas_software_xlib_swapbuf_buffer_state_get,
149 evas_software_xlib_swapbuf_get_rot, 149 evas_software_xlib_swapbuf_get_rot,
150 evas_software_xlib_swapbuf_reconfigure, 150 evas_software_xlib_swapbuf_reconfigure,
@@ -231,7 +231,7 @@ eng_output_info_setup(void *info)
231} 231}
232 232
233static void * 233static void *
234eng_output_setup(void *engine EINA_UNUSED, void *in, unsigned int w, unsigned int h) 234eng_output_setup(void *engine, void *in, unsigned int w, unsigned int h)
235{ 235{
236 Evas_Engine_Info_Software_X11 *info = in; 236 Evas_Engine_Info_Software_X11 *info = in;
237 Render_Engine *re = NULL; 237 Render_Engine *re = NULL;
@@ -252,7 +252,7 @@ eng_output_setup(void *engine EINA_UNUSED, void *in, unsigned int w, unsigned in
252 } 252 }
253 253
254 if (try_swapbuf) 254 if (try_swapbuf)
255 re = _output_swapbuf_setup(w, h, 255 re = _output_swapbuf_setup(engine, w, h,
256 info->info.rotation, info->info.connection, 256 info->info.rotation, info->info.connection,
257 info->info.drawable, info->info.visual, 257 info->info.drawable, info->info.visual,
258 info->info.colormap, 258 info->info.colormap,
@@ -264,7 +264,7 @@ eng_output_setup(void *engine EINA_UNUSED, void *in, unsigned int w, unsigned in
264 if (re) re->outbuf_alpha_get = evas_software_xlib_swapbuf_alpha_get; 264 if (re) re->outbuf_alpha_get = evas_software_xlib_swapbuf_alpha_get;
265 else 265 else
266 { 266 {
267 re = _output_xlib_setup(w, h, 267 re = _output_xlib_setup(engine, w, h,
268 info->info.rotation, info->info.connection, 268 info->info.rotation, info->info.connection,
269 info->info.drawable, info->info.visual, 269 info->info.drawable, info->info.visual,
270 info->info.colormap, 270 info->info.colormap,
@@ -341,14 +341,14 @@ eng_output_update(void *engine EINA_UNUSED, void *data, void *in, unsigned int w
341} 341}
342 342
343static void 343static void
344eng_output_free(void *engine EINA_UNUSED, void *data) 344eng_output_free(void *engine, void *data)
345{ 345{
346 Render_Engine *re; 346 Render_Engine *re;
347 347
348 if ((re = (Render_Engine *)data)) 348 if ((re = (Render_Engine *)data))
349 { 349 {
350 _outbufs = eina_list_remove(_outbufs, re->generic.ob); 350 _outbufs = eina_list_remove(_outbufs, re->generic.ob);
351 evas_render_engine_software_generic_clean(&re->generic); 351 evas_render_engine_software_generic_clean(engine, &re->generic);
352 _output_egl_shutdown(re); 352 _output_egl_shutdown(re);
353 free(re); 353 free(re);
354 } 354 }
diff --git a/src/modules/evas/engines/wayland_egl/evas_engine.c b/src/modules/evas/engines/wayland_egl/evas_engine.c
index 0630daf..be50952 100644
--- a/src/modules/evas/engines/wayland_egl/evas_engine.c
+++ b/src/modules/evas/engines/wayland_egl/evas_engine.c
@@ -546,7 +546,7 @@ _eng_swap_mode_get(void)
546} 546}
547 547
548static void * 548static void *
549eng_output_setup(void *engine EINA_UNUSED, void *info, unsigned int w, unsigned int h) 549eng_output_setup(void *engine, void *info, unsigned int w, unsigned int h)
550{ 550{
551 Evas_Engine_Info_Wayland *inf = info; 551 Evas_Engine_Info_Wayland *inf = info;
552 Render_Engine *re; 552 Render_Engine *re;
@@ -576,7 +576,7 @@ eng_output_setup(void *engine EINA_UNUSED, void *info, unsigned int w, unsigned
576 ob = eng_window_new(inf, w, h, swap_mode); 576 ob = eng_window_new(inf, w, h, swap_mode);
577 if (!ob) goto ob_err; 577 if (!ob) goto ob_err;
578 578
579 if (!evas_render_engine_gl_generic_init(&re->generic, ob, 579 if (!evas_render_engine_gl_generic_init(engine, &re->generic, ob,
580 eng_outbuf_swap_mode_get, 580 eng_outbuf_swap_mode_get,
581 eng_outbuf_rotation_get, 581 eng_outbuf_rotation_get,
582 eng_outbuf_reconfigure, 582 eng_outbuf_reconfigure,
@@ -719,7 +719,7 @@ eng_canvas_alpha_get(void *engine)
719} 719}
720 720
721static void 721static void
722eng_output_free(void *engine EINA_UNUSED, void *data) 722eng_output_free(void *engine, void *data)
723{ 723{
724 Render_Engine *re; 724 Render_Engine *re;
725 725
@@ -729,7 +729,7 @@ eng_output_free(void *engine EINA_UNUSED, void *data)
729 729
730 if (gl_wins == 1) glsym_evgl_engine_shutdown(re); 730 if (gl_wins == 1) glsym_evgl_engine_shutdown(re);
731 731
732 evas_render_engine_software_generic_clean(&re->generic.software); 732 evas_render_engine_software_generic_clean(engine, &re->generic.software);
733 733
734 gl_wins--; 734 gl_wins--;
735 735
diff --git a/src/modules/evas/engines/wayland_shm/evas_engine.c b/src/modules/evas/engines/wayland_shm/evas_engine.c
index b2cbb75..e74cc2f 100644
--- a/src/modules/evas/engines/wayland_shm/evas_engine.c
+++ b/src/modules/evas/engines/wayland_shm/evas_engine.c
@@ -28,7 +28,7 @@ struct _Render_Engine
28}; 28};
29 29
30static void * 30static void *
31eng_output_setup(void *engine EINA_UNUSED, void *info, unsigned int w, unsigned int h) 31eng_output_setup(void *engine, void *info, unsigned int w, unsigned int h)
32{ 32{
33 Evas_Engine_Info_Wayland *einfo = info; 33 Evas_Engine_Info_Wayland *einfo = info;
34 Render_Engine *re; 34 Render_Engine *re;
@@ -42,7 +42,7 @@ eng_output_setup(void *engine EINA_UNUSED, void *info, unsigned int w, unsigned
42 ob = _evas_outbuf_setup(w, h, einfo); 42 ob = _evas_outbuf_setup(w, h, einfo);
43 if (!ob) goto err; 43 if (!ob) goto err;
44 44
45 if (!evas_render_engine_software_generic_init(&re->generic, ob, 45 if (!evas_render_engine_software_generic_init(engine, &re->generic, ob,
46 _evas_outbuf_swap_mode_get, 46 _evas_outbuf_swap_mode_get,
47 _evas_outbuf_rotation_get, 47 _evas_outbuf_rotation_get,
48 NULL, 48 NULL,
@@ -145,13 +145,13 @@ eng_output_update(void *engine, void *data, void *info, unsigned int w, unsigned
145} 145}
146 146
147static void 147static void
148eng_output_free(void *engine EINA_UNUSED, void *data) 148eng_output_free(void *engine, void *data)
149{ 149{
150 Render_Engine *re; 150 Render_Engine *re;
151 151
152 if ((re = (Render_Engine *)data)) 152 if ((re = (Render_Engine *)data))
153 { 153 {
154 evas_render_engine_software_generic_clean(&re->generic); 154 evas_render_engine_software_generic_clean(engine, &re->generic);
155 free(re); 155 free(re);
156 } 156 }
157} 157}