summaryrefslogtreecommitdiff
path: root/src/lib/evas
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/evas')
-rw-r--r--src/lib/evas/canvas/efl_canvas_proxy.c2
-rw-r--r--src/lib/evas/canvas/efl_canvas_scene3d.c20
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_scene.c2
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_texture.c68
-rw-r--r--src/lib/evas/canvas/evas_clip.c2
-rw-r--r--src/lib/evas/canvas/evas_filter_mixin.c9
-rw-r--r--src/lib/evas/canvas/evas_font_dir.c52
-rw-r--r--src/lib/evas/canvas/evas_gl.c40
-rw-r--r--src/lib/evas/canvas/evas_image_private.h4
-rw-r--r--src/lib/evas/canvas/evas_main.c89
-rw-r--r--src/lib/evas/canvas/evas_map.c10
-rw-r--r--src/lib/evas/canvas/evas_object_image.c20
-rw-r--r--src/lib/evas/canvas/evas_object_main.c21
-rw-r--r--src/lib/evas/canvas/evas_object_polygon.c8
-rw-r--r--src/lib/evas/canvas/evas_object_text.c2
-rw-r--r--src/lib/evas/canvas/evas_object_textblock.c6
-rw-r--r--src/lib/evas/canvas/evas_object_textgrid.c24
-rw-r--r--src/lib/evas/canvas/evas_object_vg.c4
-rw-r--r--src/lib/evas/canvas/evas_render.c58
-rw-r--r--src/lib/evas/filters/evas_filter.c26
-rw-r--r--src/lib/evas/filters/evas_filter_private.h10
-rw-r--r--src/lib/evas/include/evas_inline.x22
-rw-r--r--src/lib/evas/include/evas_private.h20
23 files changed, 265 insertions, 254 deletions
diff --git a/src/lib/evas/canvas/efl_canvas_proxy.c b/src/lib/evas/canvas/efl_canvas_proxy.c
index 2e5af8d..c59e47c 100644
--- a/src/lib/evas/canvas/efl_canvas_proxy.c
+++ b/src/lib/evas/canvas/efl_canvas_proxy.c
@@ -173,7 +173,7 @@ _evas_image_proxy_unset(Evas_Object *proxy, Evas_Object_Protected_Data *cur_prox
173 if (eina_list_count(proxy_source_write->proxies) == 0) 173 if (eina_list_count(proxy_source_write->proxies) == 0)
174 { 174 {
175 if (proxy_source_write->surface) 175 if (proxy_source_write->surface)
176 cur_proxy->layer->evas->engine.func->image_free(cur_proxy->layer->evas->engine.data.output, 176 cur_proxy->layer->evas->engine.func->image_free(_evas_engine_context(cur_proxy->layer->evas),
177 proxy_source_write->surface); 177 proxy_source_write->surface);
178 proxy_source_write->surface = NULL; 178 proxy_source_write->surface = NULL;
179 proxy_source_write->redraw = EINA_FALSE; 179 proxy_source_write->redraw = EINA_FALSE;
diff --git a/src/lib/evas/canvas/efl_canvas_scene3d.c b/src/lib/evas/canvas/efl_canvas_scene3d.c
index 8c9ebae..5e97c8c 100644
--- a/src/lib/evas/canvas/efl_canvas_scene3d.c
+++ b/src/lib/evas/canvas/efl_canvas_scene3d.c
@@ -56,14 +56,14 @@ _evas_image_3d_render(Evas *eo_e, Evas_Object *eo_obj,
56 56
57 if (e->engine.func->drawable_size_get) 57 if (e->engine.func->drawable_size_get)
58 { 58 {
59 e->engine.func->drawable_size_get(e->engine.data.output, 59 e->engine.func->drawable_size_get(_evas_engine_context(e),
60 pd_scene->surface, &w, &h); 60 pd_scene->surface, &w, &h);
61 } 61 }
62 if ((w != pd_scene->w) || (h != pd_scene->h)) 62 if ((w != pd_scene->w) || (h != pd_scene->h))
63 { 63 {
64 if (e->engine.func->drawable_free) 64 if (e->engine.func->drawable_free)
65 { 65 {
66 e->engine.func->drawable_free(e->engine.data.output, 66 e->engine.func->drawable_free(_evas_engine_context(e),
67 pd_scene->surface); 67 pd_scene->surface);
68 } 68 }
69 pd_scene->surface = NULL; 69 pd_scene->surface = NULL;
@@ -76,8 +76,8 @@ _evas_image_3d_render(Evas *eo_e, Evas_Object *eo_obj,
76 if (e->engine.func->drawable_new) 76 if (e->engine.func->drawable_new)
77 { 77 {
78 pd_scene->surface = 78 pd_scene->surface =
79 e->engine.func->drawable_new(e->engine.data.output, 79 e->engine.func->drawable_new(_evas_engine_context(e),
80 pd_scene->w, pd_scene->h, 1); 80 pd_scene->w, pd_scene->h, 1);
81 } 81 }
82 need_native_set = EINA_TRUE; 82 need_native_set = EINA_TRUE;
83 } 83 }
@@ -90,9 +90,9 @@ _evas_image_3d_render(Evas *eo_e, Evas_Object *eo_obj,
90 if (e->engine.func->image_drawable_set) 90 if (e->engine.func->image_drawable_set)
91 { 91 {
92 data->surface = 92 data->surface =
93 e->engine.func->image_drawable_set(e->engine.data.output, 93 e->engine.func->image_drawable_set(_evas_engine_context(e),
94 data->surface, 94 data->surface,
95 pd_scene->surface); 95 pd_scene->surface);
96 } 96 }
97 } 97 }
98 data->w = pd_scene->w; 98 data->w = pd_scene->w;
@@ -131,7 +131,7 @@ _evas_image_3d_render(Evas *eo_e, Evas_Object *eo_obj,
131 /* Phase 5 - Draw the scene. */ 131 /* Phase 5 - Draw the scene. */
132 if (e->engine.func->drawable_scene_render) 132 if (e->engine.func->drawable_scene_render)
133 { 133 {
134 e->engine.func->drawable_scene_render(e->engine.data.output, 134 e->engine.func->drawable_scene_render(_evas_engine_context(e),
135 pd_scene->surface, &scene_data); 135 pd_scene->surface, &scene_data);
136 } 136 }
137 /* Clean up temporary resources. */ 137 /* Clean up temporary resources. */
@@ -199,7 +199,7 @@ _evas_image_3d_unset(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data
199 e = obj->layer->evas; 199 e = obj->layer->evas;
200 200
201 if (data->surface) 201 if (data->surface)
202 e->engine.func->image_free(e->engine.data.output, data->surface); 202 e->engine.func->image_free(_evas_engine_context(e), data->surface);
203 203
204 data->surface = NULL; 204 data->surface = NULL;
205 data->w = 0; 205 data->w = 0;
@@ -251,7 +251,7 @@ _efl_canvas_scene3d_efl_gfx_buffer_buffer_map(Eo *eo_obj, void *_pd EINA_UNUSED,
251 251
252 if (e->engine.func->drawable_size_get) 252 if (e->engine.func->drawable_size_get)
253 { 253 {
254 e->engine.func->drawable_size_get(e->engine.data.output, 254 e->engine.func->drawable_size_get(_evas_engine_context(e),
255 pd_scene->surface, &width, &height); 255 pd_scene->surface, &width, &height);
256 } 256 }
257 257
diff --git a/src/lib/evas/canvas/evas_canvas3d_scene.c b/src/lib/evas/canvas/evas_canvas3d_scene.c
index 2ff3d07..2933fb3 100644
--- a/src/lib/evas/canvas/evas_canvas3d_scene.c
+++ b/src/lib/evas/canvas/evas_canvas3d_scene.c
@@ -669,7 +669,7 @@ _evas_canvas3d_scene_pick(const Eo *obj, Evas_Canvas3D_Scene_Data *pd, Evas_Real
669 669
670 if (e->engine.func->drawable_scene_render_to_texture) 670 if (e->engine.func->drawable_scene_render_to_texture)
671 { 671 {
672 if (e->engine.func->drawable_scene_render_to_texture(e->engine.data.output, 672 if (e->engine.func->drawable_scene_render_to_texture(_evas_engine_context(e),
673 pd->surface, &scene_data)) 673 pd->surface, &scene_data))
674 { 674 {
675 if (e->engine.func->drawable_texture_color_pick_id_get) 675 if (e->engine.func->drawable_texture_color_pick_id_get)
diff --git a/src/lib/evas/canvas/evas_canvas3d_texture.c b/src/lib/evas/canvas/evas_canvas3d_texture.c
index 1ad5e97..c1d54b7 100644
--- a/src/lib/evas/canvas/evas_canvas3d_texture.c
+++ b/src/lib/evas/canvas/evas_canvas3d_texture.c
@@ -31,7 +31,7 @@ _texture_proxy_unset(Evas_Canvas3D_Texture_Data *texture)
31 proxy_src->surface != NULL) 31 proxy_src->surface != NULL)
32 { 32 {
33 Evas_Public_Data *e = src->layer->evas; 33 Evas_Public_Data *e = src->layer->evas;
34 e->engine.func->image_free(e->engine.data.output, proxy_src->surface); 34 e->engine.func->image_free(_evas_engine_context(e), proxy_src->surface);
35 proxy_src->surface = NULL; 35 proxy_src->surface = NULL;
36 } 36 }
37 37
@@ -78,7 +78,7 @@ _texture_proxy_subrender(Evas_Canvas3D_Texture *obj)
78 if (is_image) 78 if (is_image)
79 { 79 {
80 void *image = source->func->engine_data_get(pd->source); 80 void *image = source->func->engine_data_get(pd->source);
81 e->engine.func->image_size_get(e->engine.data.output, image, &w, &h); 81 e->engine.func->image_size_get(_evas_engine_context(e), image, &w, &h);
82 } 82 }
83 else 83 else
84 { 84 {
@@ -90,7 +90,7 @@ _texture_proxy_subrender(Evas_Canvas3D_Texture *obj)
90 if ((proxy_write->surface) && 90 if ((proxy_write->surface) &&
91 ((proxy_write->w != w) || (proxy_write->h != h))) 91 ((proxy_write->w != w) || (proxy_write->h != h)))
92 { 92 {
93 e->engine.func->image_free(e->engine.data.output, proxy_write->surface); 93 e->engine.func->image_free(_evas_engine_context(e), proxy_write->surface);
94 proxy_write->surface = NULL; 94 proxy_write->surface = NULL;
95 } 95 }
96 96
@@ -99,23 +99,23 @@ _texture_proxy_subrender(Evas_Canvas3D_Texture *obj)
99 if (!proxy_write->surface) 99 if (!proxy_write->surface)
100 { 100 {
101 proxy_write->surface = e->engine.func->image_map_surface_new 101 proxy_write->surface = e->engine.func->image_map_surface_new
102 (e->engine.data.output, w, h, 1); 102 (_evas_engine_context(e), w, h, 1);
103 if (!proxy_write->surface) goto end; 103 if (!proxy_write->surface) goto end;
104 proxy_write->w = w; 104 proxy_write->w = w;
105 proxy_write->h = h; 105 proxy_write->h = h;
106 } 106 }
107 107
108 ctx = e->engine.func->context_new(e->engine.data.output); 108 ctx = e->engine.func->context_new(_evas_default_output_get(e));
109 e->engine.func->context_color_set(e->engine.data.output, ctx, 0, 0, 109 e->engine.func->context_color_set(_evas_default_output_get(e), ctx, 0, 0,
110 0, 0); 110 0, 0);
111 e->engine.func->context_render_op_set(e->engine.data.output, ctx, 111 e->engine.func->context_render_op_set(_evas_default_output_get(e), ctx,
112 EVAS_RENDER_COPY); 112 EVAS_RENDER_COPY);
113 e->engine.func->rectangle_draw(e->engine.data.output, ctx, 113 e->engine.func->rectangle_draw(_evas_default_output_get(e), ctx,
114 proxy_write->surface, 0, 0, w, h, 114 proxy_write->surface, 0, 0, w, h,
115 EINA_FALSE); 115 EINA_FALSE);
116 e->engine.func->context_free(e->engine.data.output, ctx); 116 e->engine.func->context_free(_evas_default_output_get(e), ctx);
117 117
118 ctx = e->engine.func->context_new(e->engine.data.output); 118 ctx = e->engine.func->context_new(_evas_default_output_get(e));
119 119
120 if (is_image) 120 if (is_image)
121 { 121 {
@@ -124,9 +124,9 @@ _texture_proxy_subrender(Evas_Canvas3D_Texture *obj)
124 if (image) 124 if (image)
125 { 125 {
126 int imagew, imageh; 126 int imagew, imageh;
127 e->engine.func->image_size_get(e->engine.data.output, image, 127 e->engine.func->image_size_get(_evas_engine_context(e), image,
128 &imagew, &imageh); 128 &imagew, &imageh);
129 e->engine.func->image_draw(e->engine.data.output, ctx, 129 e->engine.func->image_draw(_evas_default_output_get(e), ctx,
130 proxy_write->surface, image, 130 proxy_write->surface, image,
131 0, 0, imagew, imageh, 0, 0, w, h, 0, EINA_FALSE); 131 0, 0, imagew, imageh, 0, 0, w, h, 0, EINA_FALSE);
132 } 132 }
@@ -148,9 +148,9 @@ _texture_proxy_subrender(Evas_Canvas3D_Texture *obj)
148 &proxy_render_data, 1, EINA_FALSE); 148 &proxy_render_data, 1, EINA_FALSE);
149 } 149 }
150 150
151 e->engine.func->context_free(e->engine.data.output, ctx); 151 e->engine.func->context_free(_evas_default_output_get(e), ctx);
152 proxy_write->surface = e->engine.func->image_dirty_region 152 proxy_write->surface = e->engine.func->image_dirty_region
153 (e->engine.data.output, proxy_write->surface, 0, 0, w, h); 153 (_evas_default_output_get(e), proxy_write->surface, 0, 0, w, h);
154 } 154 }
155 end: 155 end:
156 EINA_COW_WRITE_END(evas_object_proxy_cow, source->proxy, proxy_write); 156 EINA_COW_WRITE_END(evas_object_proxy_cow, source->proxy, proxy_write);
@@ -172,7 +172,7 @@ _texture_fini(Evas_Canvas3D_Texture *obj)
172 { 172 {
173 Evas_Public_Data *e = efl_data_scope_get(evas, EVAS_CANVAS_CLASS); 173 Evas_Public_Data *e = efl_data_scope_get(evas, EVAS_CANVAS_CLASS);
174 if (e->engine.func->texture_free) 174 if (e->engine.func->texture_free)
175 e->engine.func->texture_free(e->engine.data.output, pd->engine_data); 175 e->engine.func->texture_free(_evas_engine_context(e), pd->engine_data);
176 pd->engine_data = NULL; 176 pd->engine_data = NULL;
177 } 177 }
178 178
@@ -233,7 +233,7 @@ _evas_canvas3d_texture_evas_canvas3d_object_update_notify(Eo *obj, Evas_Canvas3D
233 if (e->engine.func->texture_new) 233 if (e->engine.func->texture_new)
234 { 234 {
235 pd->engine_data = 235 pd->engine_data =
236 e->engine.func->texture_new(e->engine.data.output, pd->atlas_enable); 236 e->engine.func->texture_new(_evas_engine_context(e), pd->atlas_enable);
237 } 237 }
238 238
239 if (pd->engine_data == NULL) 239 if (pd->engine_data == NULL)
@@ -247,7 +247,7 @@ _evas_canvas3d_texture_evas_canvas3d_object_update_notify(Eo *obj, Evas_Canvas3D
247 { 247 {
248 if (e->engine.func->texture_image_set) 248 if (e->engine.func->texture_image_set)
249 { 249 {
250 e->engine.func->texture_image_set(e->engine.data.output, 250 e->engine.func->texture_image_set(_evas_engine_context(e),
251 pd->engine_data, 251 pd->engine_data,
252 src->proxy->surface); 252 src->proxy->surface);
253 } 253 }
@@ -259,7 +259,7 @@ _evas_canvas3d_texture_evas_canvas3d_object_update_notify(Eo *obj, Evas_Canvas3D
259 _texture_proxy_subrender(obj); 259 _texture_proxy_subrender(obj);
260 260
261 if (e->engine.func->texture_image_set) 261 if (e->engine.func->texture_image_set)
262 e->engine.func->texture_image_set(e->engine.data.output, 262 e->engine.func->texture_image_set(_evas_engine_context(e),
263 pd->engine_data, 263 pd->engine_data,
264 src->proxy->surface); 264 src->proxy->surface);
265 pd->proxy_rendering = EINA_FALSE; 265 pd->proxy_rendering = EINA_FALSE;
@@ -347,14 +347,14 @@ _evas_canvas3d_texture_data_set(Eo *obj, Evas_Canvas3D_Texture_Data *pd,
347 Evas_Public_Data *e = efl_data_scope_get(evas, EVAS_CANVAS_CLASS); 347 Evas_Public_Data *e = efl_data_scope_get(evas, EVAS_CANVAS_CLASS);
348 348
349 if (!pd->engine_data && e->engine.func->texture_new) 349 if (!pd->engine_data && e->engine.func->texture_new)
350 pd->engine_data = e->engine.func->texture_new(e->engine.data.output, pd->atlas_enable); 350 pd->engine_data = e->engine.func->texture_new(_evas_engine_context(e), pd->atlas_enable);
351 if (!data) 351 if (!data)
352 { 352 {
353 ERR("Failure, image data is empty"); 353 ERR("Failure, image data is empty");
354 return; 354 return;
355 } 355 }
356 356
357 image = e->engine.func->image_new_from_data(e->engine.data.output, w, h, (DATA32 *)data, EINA_TRUE, color_format); 357 image = e->engine.func->image_new_from_data(_evas_engine_context(e), w, h, (DATA32 *)data, EINA_TRUE, color_format);
358 if (!image) 358 if (!image)
359 { 359 {
360 ERR("Can't load image from data"); 360 ERR("Can't load image from data");
@@ -362,10 +362,10 @@ _evas_canvas3d_texture_data_set(Eo *obj, Evas_Canvas3D_Texture_Data *pd,
362 } 362 }
363 363
364 if (e->engine.func->texture_image_set) 364 if (e->engine.func->texture_image_set)
365 e->engine.func->texture_image_set(e->engine.data.output, 365 e->engine.func->texture_image_set(_evas_engine_context(e),
366 pd->engine_data, 366 pd->engine_data,
367 image); 367 image);
368 e->engine.func->image_free(e->engine.data.output, image); 368 e->engine.func->image_free(_evas_engine_context(e), image);
369 evas_canvas3d_object_change(obj, EVAS_CANVAS3D_STATE_TEXTURE_DATA, NULL); 369 evas_canvas3d_object_change(obj, EVAS_CANVAS3D_STATE_TEXTURE_DATA, NULL);
370} 370}
371 371
@@ -382,10 +382,10 @@ _evas_canvas3d_texture_file_set(Eo *obj, Evas_Canvas3D_Texture_Data *pd, const c
382 Evas_Public_Data *e = efl_data_scope_get(evas, EVAS_CANVAS_CLASS); 382 Evas_Public_Data *e = efl_data_scope_get(evas, EVAS_CANVAS_CLASS);
383 383
384 if (!pd->engine_data && e->engine.func->texture_new) 384 if (!pd->engine_data && e->engine.func->texture_new)
385 pd->engine_data = e->engine.func->texture_new(e->engine.data.output, pd->atlas_enable); 385 pd->engine_data = e->engine.func->texture_new(_evas_engine_context(e), pd->atlas_enable);
386 386
387 memset(&lo, 0x0, sizeof(Evas_Image_Load_Opts)); 387 memset(&lo, 0x0, sizeof(Evas_Image_Load_Opts));
388 image = e->engine.func->image_load(e->engine.data.output, 388 image = e->engine.func->image_load(_evas_engine_context(e),
389 file, key, &load_error, &lo); 389 file, key, &load_error, &lo);
390 if (!image) 390 if (!image)
391 { 391 {
@@ -394,11 +394,11 @@ _evas_canvas3d_texture_file_set(Eo *obj, Evas_Canvas3D_Texture_Data *pd, const c
394 } 394 }
395 395
396 if (e->engine.func->texture_image_set) 396 if (e->engine.func->texture_image_set)
397 e->engine.func->texture_image_set(e->engine.data.output, 397 e->engine.func->texture_image_set(_evas_engine_context(e),
398 pd->engine_data, 398 pd->engine_data,
399 image); 399 image);
400 400
401 e->engine.func->image_free(e->engine.data.output, image); 401 e->engine.func->image_free(_evas_engine_context(e), image);
402 evas_canvas3d_object_change(obj, EVAS_CANVAS3D_STATE_TEXTURE_DATA, NULL); 402 evas_canvas3d_object_change(obj, EVAS_CANVAS3D_STATE_TEXTURE_DATA, NULL);
403} 403}
404 404
@@ -438,7 +438,7 @@ _evas_canvas3d_texture_source_set(Eo *obj , Evas_Canvas3D_Texture_Data *pd, Evas
438 return; 438 return;
439 } 439 }
440 if (!pd->engine_data && e->engine.func->texture_new) 440 if (!pd->engine_data && e->engine.func->texture_new)
441 pd->engine_data = e->engine.func->texture_new(e->engine.data.output, pd->atlas_enable); 441 pd->engine_data = e->engine.func->texture_new(_evas_engine_context(e), pd->atlas_enable);
442 442
443 _texture_proxy_set(obj, source, src); 443 _texture_proxy_set(obj, source, src);
444 evas_canvas3d_object_change(obj, EVAS_CANVAS3D_STATE_TEXTURE_DATA, NULL); 444 evas_canvas3d_object_change(obj, EVAS_CANVAS3D_STATE_TEXTURE_DATA, NULL);
@@ -491,8 +491,8 @@ _evas_canvas3d_texture_color_format_get(const Eo *obj EINA_UNUSED, Evas_Canvas3D
491 { 491 {
492 void *image; 492 void *image;
493 493
494 image = e->engine.func->texture_image_get(e->engine.data.output, pd->engine_data); 494 image = e->engine.func->texture_image_get(_evas_engine_context(e), pd->engine_data);
495 format = e->engine.func->image_colorspace_get(e->engine.data.output, image); 495 format = e->engine.func->image_colorspace_get(_evas_engine_context(e), image);
496 } 496 }
497 497
498 return format; 498 return format;
@@ -506,7 +506,7 @@ _evas_canvas3d_texture_size_get(const Eo *obj, Evas_Canvas3D_Texture_Data *pd, i
506 Evas_Public_Data *e = efl_data_scope_get(evas, EVAS_CANVAS_CLASS); 506 Evas_Public_Data *e = efl_data_scope_get(evas, EVAS_CANVAS_CLASS);
507 if (e->engine.func->texture_size_get) 507 if (e->engine.func->texture_size_get)
508 { 508 {
509 e->engine.func->texture_size_get(e->engine.data.output, 509 e->engine.func->texture_size_get(_evas_engine_context(e),
510 pd->engine_data, w, h); 510 pd->engine_data, w, h);
511 } 511 }
512} 512}
@@ -519,7 +519,7 @@ _evas_canvas3d_texture_wrap_set(Eo *obj, Evas_Canvas3D_Texture_Data *pd, Evas_Ca
519 Evas_Public_Data *e = efl_data_scope_get(evas, EVAS_CANVAS_CLASS); 519 Evas_Public_Data *e = efl_data_scope_get(evas, EVAS_CANVAS_CLASS);
520 if (e->engine.func->texture_wrap_set) 520 if (e->engine.func->texture_wrap_set)
521 { 521 {
522 e->engine.func->texture_wrap_set(e->engine.data.output, 522 e->engine.func->texture_wrap_set(_evas_engine_context(e),
523 pd->engine_data, s, t); 523 pd->engine_data, s, t);
524 } 524 }
525 evas_canvas3d_object_change(obj, EVAS_CANVAS3D_STATE_TEXTURE_WRAP, NULL); 525 evas_canvas3d_object_change(obj, EVAS_CANVAS3D_STATE_TEXTURE_WRAP, NULL);
@@ -533,7 +533,7 @@ _evas_canvas3d_texture_wrap_get(Eo *obj, Evas_Canvas3D_Texture_Data *pd, Evas_Ca
533 Evas_Public_Data *e = efl_data_scope_get(evas, EVAS_CANVAS_CLASS); 533 Evas_Public_Data *e = efl_data_scope_get(evas, EVAS_CANVAS_CLASS);
534 if (e->engine.func->texture_wrap_set) 534 if (e->engine.func->texture_wrap_set)
535 { 535 {
536 e->engine.func->texture_wrap_get(e->engine.data.output, 536 e->engine.func->texture_wrap_get(_evas_engine_context(e),
537 pd->engine_data, s, t); 537 pd->engine_data, s, t);
538 } 538 }
539} 539}
@@ -546,7 +546,7 @@ _evas_canvas3d_texture_filter_set(Eo *obj, Evas_Canvas3D_Texture_Data *pd, Evas_
546 Evas_Public_Data *e = efl_data_scope_get(evas, EVAS_CANVAS_CLASS); 546 Evas_Public_Data *e = efl_data_scope_get(evas, EVAS_CANVAS_CLASS);
547 if (e->engine.func->texture_filter_set) 547 if (e->engine.func->texture_filter_set)
548 { 548 {
549 e->engine.func->texture_filter_set(e->engine.data.output, 549 e->engine.func->texture_filter_set(_evas_engine_context(e),
550 pd->engine_data, min, mag); 550 pd->engine_data, min, mag);
551 } 551 }
552 evas_canvas3d_object_change(obj, EVAS_CANVAS3D_STATE_TEXTURE_FILTER, NULL); 552 evas_canvas3d_object_change(obj, EVAS_CANVAS3D_STATE_TEXTURE_FILTER, NULL);
@@ -560,7 +560,7 @@ _evas_canvas3d_texture_filter_get(const Eo *obj EINA_UNUSED, Evas_Canvas3D_Textu
560 Evas_Public_Data *e = efl_data_scope_get(evas, EVAS_CANVAS_CLASS); 560 Evas_Public_Data *e = efl_data_scope_get(evas, EVAS_CANVAS_CLASS);
561 if (e->engine.func->texture_filter_get) 561 if (e->engine.func->texture_filter_get)
562 { 562 {
563 e->engine.func->texture_filter_get(e->engine.data.output, 563 e->engine.func->texture_filter_get(_evas_engine_context(e),
564 pd->engine_data, min, mag); 564 pd->engine_data, min, mag);
565 } 565 }
566} 566}
diff --git a/src/lib/evas/canvas/evas_clip.c b/src/lib/evas/canvas/evas_clip.c
index 3b11044..38c468b 100644
--- a/src/lib/evas/canvas/evas_clip.c
+++ b/src/lib/evas/canvas/evas_clip.c
@@ -203,7 +203,7 @@ _efl_canvas_object_clip_mask_unset(Evas_Object_Protected_Data *obj)
203 mask->is_alpha = EINA_FALSE; 203 mask->is_alpha = EINA_FALSE;
204 if (mask->surface) 204 if (mask->surface)
205 { 205 {
206 obj->layer->evas->engine.func->image_free(obj->layer->evas->engine.data.output, mask->surface); 206 obj->layer->evas->engine.func->image_free(ENC, mask->surface);
207 mask->surface = NULL; 207 mask->surface = NULL;
208 } 208 }
209 mask->w = 0; 209 mask->w = 0;
diff --git a/src/lib/evas/canvas/evas_filter_mixin.c b/src/lib/evas/canvas/evas_filter_mixin.c
index 1c5dd60..66eb496 100644
--- a/src/lib/evas/canvas/evas_filter_mixin.c
+++ b/src/lib/evas/canvas/evas_filter_mixin.c
@@ -8,9 +8,6 @@
8 8
9#define MY_CLASS EFL_CANVAS_FILTER_INTERNAL_MIXIN 9#define MY_CLASS EFL_CANVAS_FILTER_INTERNAL_MIXIN
10 10
11#define ENFN obj->layer->evas->engine.func
12#define ENDT obj->layer->evas->engine.data.output
13
14#define FCOW_BEGIN(_pd) ({ Evas_Object_Filter_Data *_fcow = eina_cow_write(evas_object_filter_cow, (const Eina_Cow_Data**)&(_pd->data)); _state_check(_fcow); _fcow; }) 11#define FCOW_BEGIN(_pd) ({ Evas_Object_Filter_Data *_fcow = eina_cow_write(evas_object_filter_cow, (const Eina_Cow_Data**)&(_pd->data)); _state_check(_fcow); _fcow; })
15#define FCOW_END(_fcow, _pd) eina_cow_done(evas_object_filter_cow, (const Eina_Cow_Data**)&(_pd->data), _fcow, EINA_TRUE) 12#define FCOW_END(_fcow, _pd) eina_cow_done(evas_object_filter_cow, (const Eina_Cow_Data**)&(_pd->data), _fcow, EINA_TRUE)
16#define FCOW_WRITE(pd, name, value) do { \ 13#define FCOW_WRITE(pd, name, value) do { \
@@ -121,7 +118,7 @@ _filter_end_sync(Evas_Filter_Context *ctx, Evas_Object_Protected_Data *obj,
121 } 118 }
122 119
123 if (previous) 120 if (previous)
124 ENFN->image_free(ENDT, previous); 121 ENFN->image_free(ENC, previous);
125 122
126 if (destroy) 123 if (destroy)
127 { 124 {
@@ -285,7 +282,7 @@ evas_filter_object_render(Eo *eo_obj, Evas_Object_Protected_Data *obj,
285 int iw, ih; 282 int iw, ih;
286 283
287 use_map = EINA_TRUE; 284 use_map = EINA_TRUE;
288 ENFN->image_size_get(ENDT, previous, &iw, &ih); 285 ENFN->image_size_get(ENC, previous, &iw, &ih);
289 evas_object_map_update(eo_obj, x, y, iw, ih, iw, ih); 286 evas_object_map_update(eo_obj, x, y, iw, ih, iw, ih);
290 } 287 }
291 288
@@ -728,7 +725,7 @@ _efl_canvas_filter_internal_efl_object_destructor(Eo *eo_obj, Evas_Filter_Data *
728 if (pd->data->output) 725 if (pd->data->output)
729 { 726 {
730 if (!pd->data->async) 727 if (!pd->data->async)
731 ENFN->image_free(ENDT, pd->data->output); 728 ENFN->image_free(ENC, pd->data->output);
732 else 729 else
733 evas_unref_queue_image_put(e, pd->data->output); 730 evas_unref_queue_image_put(e, pd->data->output);
734 } 731 }
diff --git a/src/lib/evas/canvas/evas_font_dir.c b/src/lib/evas/canvas/evas_font_dir.c
index 682f80f..1b7041c 100644
--- a/src/lib/evas/canvas/evas_font_dir.c
+++ b/src/lib/evas/canvas/evas_font_dir.c
@@ -146,7 +146,7 @@ evas_fonts_zero_free(Evas *eo_evas)
146 if (fd->fdesc) evas_font_desc_unref(fd->fdesc); 146 if (fd->fdesc) evas_font_desc_unref(fd->fdesc);
147 if (fd->source) eina_stringshare_del(fd->source); 147 if (fd->source) eina_stringshare_del(fd->source);
148 if ((evas->engine.func) && (evas->engine.func->font_free)) 148 if ((evas->engine.func) && (evas->engine.func->font_free))
149 evas->engine.func->font_free(evas->engine.data.output, fd->font); 149 evas->engine.func->font_free(_evas_engine_context(evas), fd->font);
150#ifdef HAVE_FONTCONFIG 150#ifdef HAVE_FONTCONFIG
151 if (fd->set) FcFontSetDestroy(fd->set); 151 if (fd->set) FcFontSetDestroy(fd->set);
152 if (fd->p_nm) FcPatternDestroy(fd->p_nm); 152 if (fd->p_nm) FcPatternDestroy(fd->p_nm);
@@ -172,7 +172,7 @@ evas_fonts_zero_pressure(Evas *eo_evas)
172 if (fd->fdesc) evas_font_desc_unref(fd->fdesc); 172 if (fd->fdesc) evas_font_desc_unref(fd->fdesc);
173 if (fd->source) eina_stringshare_del(fd->source); 173 if (fd->source) eina_stringshare_del(fd->source);
174 if ((evas->engine.func) && (evas->engine.func->font_free)) 174 if ((evas->engine.func) && (evas->engine.func->font_free))
175 evas->engine.func->font_free(evas->engine.data.output, fd->font); 175 evas->engine.func->font_free(_evas_engine_context(evas), fd->font);
176#ifdef HAVE_FONTCONFIG 176#ifdef HAVE_FONTCONFIG
177 if (fd->set) FcFontSetDestroy(fd->set); 177 if (fd->set) FcFontSetDestroy(fd->set);
178 if (fd->p_nm) FcPatternDestroy(fd->p_nm); 178 if (fd->p_nm) FcPatternDestroy(fd->p_nm);
@@ -213,7 +213,7 @@ evas_font_free(Evas *eo_evas, void *font)
213 213
214 if (fd->fdesc) evas_font_desc_unref(fd->fdesc); 214 if (fd->fdesc) evas_font_desc_unref(fd->fdesc);
215 if (fd->source) eina_stringshare_del(fd->source); 215 if (fd->source) eina_stringshare_del(fd->source);
216 evas->engine.func->font_free(evas->engine.data.output, fd->font); 216 evas->engine.func->font_free(_evas_engine_context(evas), fd->font);
217#ifdef HAVE_FONTCONFIG 217#ifdef HAVE_FONTCONFIG
218 if (fd->set) FcFontSetDestroy(fd->set); 218 if (fd->set) FcFontSetDestroy(fd->set);
219 if (fd->p_nm) FcPatternDestroy(fd->p_nm); 219 if (fd->p_nm) FcPatternDestroy(fd->p_nm);
@@ -240,9 +240,9 @@ _evas_load_fontconfig(Evas_Font_Set *font, Evas *eo_evas, FcFontSet *set, int si
240 FcPatternGet(set->fonts[i], FC_FILE, 0, &filename); 240 FcPatternGet(set->fonts[i], FC_FILE, 0, &filename);
241 241
242 if (font) 242 if (font)
243 evas->engine.func->font_add(evas->engine.data.output, font, (char *)filename.u.s, size, wanted_rend); 243 evas->engine.func->font_add(_evas_engine_context(evas), font, (char *)filename.u.s, size, wanted_rend);
244 else 244 else
245 font = evas->engine.func->font_load(evas->engine.data.output, (char *)filename.u.s, size, wanted_rend); 245 font = evas->engine.func->font_load(_evas_engine_context(evas), (char *)filename.u.s, size, wanted_rend);
246 } 246 }
247 247
248 return font; 248 return font;
@@ -648,7 +648,7 @@ evas_font_load(Evas *eo_evas, Evas_Font_Description *fdesc, const char *source,
648 fake_name = evas_file_path_join(source, nm); 648 fake_name = evas_file_path_join(source, nm);
649 if (fake_name) 649 if (fake_name)
650 { 650 {
651 font = evas->engine.func->font_load(evas->engine.data.output, fake_name, size, wanted_rend); 651 font = evas->engine.func->font_load(_evas_engine_context(evas), fake_name, size, wanted_rend);
652 if (!font) /* Load from fake name failed, probably not cached */ 652 if (!font) /* Load from fake name failed, probably not cached */
653 { 653 {
654 /* read original!!! */ 654 /* read original!!! */
@@ -661,7 +661,7 @@ evas_font_load(Evas *eo_evas, Evas_Font_Description *fdesc, const char *source,
661 fdata = eet_read(ef, nm, &fsize); 661 fdata = eet_read(ef, nm, &fsize);
662 if (fdata) 662 if (fdata)
663 { 663 {
664 font = evas->engine.func->font_memory_load(evas->engine.data.output, source, nm, size, fdata, fsize, wanted_rend); 664 font = evas->engine.func->font_memory_load(_evas_engine_context(evas), source, nm, size, fdata, fsize, wanted_rend);
665 free(fdata); 665 free(fdata);
666 } 666 }
667 eet_close(ef); 667 eet_close(ef);
@@ -673,7 +673,7 @@ evas_font_load(Evas *eo_evas, Evas_Font_Description *fdesc, const char *source,
673 if (!font) /* Source load failed */ 673 if (!font) /* Source load failed */
674 { 674 {
675 if (evas_file_path_is_full_path((char *)nm)) /* Try filename */ 675 if (evas_file_path_is_full_path((char *)nm)) /* Try filename */
676 font = evas->engine.func->font_load(evas->engine.data.output, (char *)nm, size, wanted_rend); 676 font = evas->engine.func->font_load(_evas_engine_context(evas), (char *)nm, size, wanted_rend);
677 else /* search font path */ 677 else /* search font path */
678 { 678 {
679 Eina_List *ll; 679 Eina_List *ll;
@@ -686,7 +686,7 @@ evas_font_load(Evas *eo_evas, Evas_Font_Description *fdesc, const char *source,
686 f_file = evas_font_dir_cache_find(dir, (char *)nm); 686 f_file = evas_font_dir_cache_find(dir, (char *)nm);
687 if (f_file) 687 if (f_file)
688 { 688 {
689 font = evas->engine.func->font_load(evas->engine.data.output, f_file, size, wanted_rend); 689 font = evas->engine.func->font_load(_evas_engine_context(evas), f_file, size, wanted_rend);
690 if (font) break; 690 if (font) break;
691 } 691 }
692 } 692 }
@@ -700,7 +700,7 @@ evas_font_load(Evas *eo_evas, Evas_Font_Description *fdesc, const char *source,
700 f_file = evas_font_dir_cache_find(dir, (char *)nm); 700 f_file = evas_font_dir_cache_find(dir, (char *)nm);
701 if (f_file) 701 if (f_file)
702 { 702 {
703 font = evas->engine.func->font_load(evas->engine.data.output, f_file, size, wanted_rend); 703 font = evas->engine.func->font_load(_evas_engine_context(evas), f_file, size, wanted_rend);
704 if (font) break; 704 if (font) break;
705 } 705 }
706 } 706 }
@@ -721,7 +721,7 @@ evas_font_load(Evas *eo_evas, Evas_Font_Description *fdesc, const char *source,
721 if (fake_name) 721 if (fake_name)
722 { 722 {
723 /* FIXME: make an engine func */ 723 /* FIXME: make an engine func */
724 if (!evas->engine.func->font_add(evas->engine.data.output, font, fake_name, size, wanted_rend)) 724 if (!evas->engine.func->font_add(_evas_engine_context(evas), font, fake_name, size, wanted_rend))
725 { 725 {
726 /* read original!!! */ 726 /* read original!!! */
727 ef = eet_open(source, EET_FILE_MODE_READ); 727 ef = eet_open(source, EET_FILE_MODE_READ);
@@ -733,7 +733,7 @@ evas_font_load(Evas *eo_evas, Evas_Font_Description *fdesc, const char *source,
733 fdata = eet_read(ef, nm, &fsize); 733 fdata = eet_read(ef, nm, &fsize);
734 if ((fdata) && (fsize > 0)) 734 if ((fdata) && (fsize > 0))
735 { 735 {
736 ok = evas->engine.func->font_memory_add(evas->engine.data.output, font, source, nm, size, fdata, fsize, wanted_rend); 736 ok = evas->engine.func->font_memory_add(_evas_engine_context(evas), font, source, nm, size, fdata, fsize, wanted_rend);
737 } 737 }
738 eet_close(ef); 738 eet_close(ef);
739 free(fdata); 739 free(fdata);
@@ -747,7 +747,7 @@ evas_font_load(Evas *eo_evas, Evas_Font_Description *fdesc, const char *source,
747 if (!ok) 747 if (!ok)
748 { 748 {
749 if (evas_file_path_is_full_path((char *)nm)) 749 if (evas_file_path_is_full_path((char *)nm))
750 evas->engine.func->font_add(evas->engine.data.output, font, (char *)nm, size, wanted_rend); 750 evas->engine.func->font_add(_evas_engine_context(evas), font, (char *)nm, size, wanted_rend);
751 else 751 else
752 { 752 {
753 Eina_List *ll; 753 Eina_List *ll;
@@ -761,7 +761,7 @@ evas_font_load(Evas *eo_evas, Evas_Font_Description *fdesc, const char *source,
761 f_file = evas_font_dir_cache_find(dir, (char *)nm); 761 f_file = evas_font_dir_cache_find(dir, (char *)nm);
762 if (f_file) 762 if (f_file)
763 { 763 {
764 fn = (RGBA_Font *)evas->engine.func->font_add(evas->engine.data.output, font, f_file, size, wanted_rend); 764 fn = (RGBA_Font *)evas->engine.func->font_add(_evas_engine_context(evas), font, f_file, size, wanted_rend);
765 if (fn) 765 if (fn)
766 break; 766 break;
767 } 767 }
@@ -776,7 +776,7 @@ evas_font_load(Evas *eo_evas, Evas_Font_Description *fdesc, const char *source,
776 f_file = evas_font_dir_cache_find(dir, (char *)nm); 776 f_file = evas_font_dir_cache_find(dir, (char *)nm);
777 if (f_file) 777 if (f_file)
778 { 778 {
779 fn = (RGBA_Font *)evas->engine.func->font_add(evas->engine.data.output, font, f_file, size, wanted_rend); 779 fn = (RGBA_Font *)evas->engine.func->font_add(_evas_engine_context(evas), font, f_file, size, wanted_rend);
780 if (fn) 780 if (fn)
781 break; 781 break;
782 } 782 }
@@ -901,7 +901,7 @@ evas_font_load(Evas *eo_evas, Evas_Font_Description *fdesc, const char *source,
901 } 901 }
902 902
903 if (font) 903 if (font)
904 evas->engine.func->font_hinting_set(evas->engine.data.output, font, 904 evas->engine.func->font_hinting_set(_evas_engine_context(evas), font,
905 evas->hinting); 905 evas->hinting);
906 return font; 906 return font;
907} 907}
@@ -910,7 +910,7 @@ void
910evas_font_load_hinting_set(Evas *eo_evas, void *font, int hinting) 910evas_font_load_hinting_set(Evas *eo_evas, void *font, int hinting)
911{ 911{
912 Evas_Public_Data *evas = efl_data_scope_get(eo_evas, EVAS_CANVAS_CLASS); 912 Evas_Public_Data *evas = efl_data_scope_get(eo_evas, EVAS_CANVAS_CLASS);
913 evas->engine.func->font_hinting_set(evas->engine.data.output, font, 913 evas->engine.func->font_hinting_set(_evas_engine_context(evas), font,
914 hinting); 914 hinting);
915} 915}
916 916
@@ -1472,9 +1472,9 @@ _evas_canvas_font_hinting_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
1472EOLIAN Eina_Bool 1472EOLIAN Eina_Bool
1473_evas_canvas_font_hinting_can_hint(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, Evas_Font_Hinting_Flags hinting) 1473_evas_canvas_font_hinting_can_hint(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, Evas_Font_Hinting_Flags hinting)
1474{ 1474{
1475 if (e->engine.func->font_hinting_can_hint && e->engine.data.output) 1475 if (e->engine.func->font_hinting_can_hint && _evas_engine_context(e))
1476 return e->engine.func->font_hinting_can_hint(e->engine.data.output, 1476 return e->engine.func->font_hinting_can_hint(_evas_engine_context(e),
1477 hinting); 1477 hinting);
1478 else return EINA_FALSE; 1478 else return EINA_FALSE;
1479} 1479}
1480 1480
@@ -1483,8 +1483,8 @@ _evas_canvas_font_cache_flush(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
1483{ 1483{
1484 evas_canvas_async_block(e); 1484 evas_canvas_async_block(e);
1485 evas_render_rendering_wait(e); 1485 evas_render_rendering_wait(e);
1486 if (e->engine.data.output) 1486 if (_evas_engine_context(e))
1487 e->engine.func->font_cache_flush(e->engine.data.output); 1487 e->engine.func->font_cache_flush(_evas_engine_context(e));
1488} 1488}
1489 1489
1490EOLIAN void 1490EOLIAN void
@@ -1493,15 +1493,15 @@ _evas_canvas_font_cache_set(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, int size)
1493 if (size < 0) size = 0; 1493 if (size < 0) size = 0;
1494 evas_canvas_async_block(e); 1494 evas_canvas_async_block(e);
1495 evas_render_rendering_wait(e); 1495 evas_render_rendering_wait(e);
1496 if (e->engine.data.output) 1496 if (_evas_engine_context(e))
1497 e->engine.func->font_cache_set(e->engine.data.output, size); 1497 e->engine.func->font_cache_set(_evas_engine_context(e), size);
1498} 1498}
1499 1499
1500EOLIAN int 1500EOLIAN int
1501_evas_canvas_font_cache_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e) 1501_evas_canvas_font_cache_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
1502{ 1502{
1503 if (e->engine.data.output) 1503 if (_evas_engine_context(e))
1504 return e->engine.func->font_cache_get(e->engine.data.output); 1504 return e->engine.func->font_cache_get(_evas_engine_context(e));
1505 return -1; 1505 return -1;
1506} 1506}
1507 1507
diff --git a/src/lib/evas/canvas/evas_gl.c b/src/lib/evas/canvas/evas_gl.c
index 0f4760c..18c438b 100644
--- a/src/lib/evas/canvas/evas_gl.c
+++ b/src/lib/evas/canvas/evas_gl.c
@@ -244,7 +244,7 @@ evas_gl_surface_create(Evas_GL *evas_gl, Evas_GL_Config *config, int width, int
244 return NULL; 244 return NULL;
245 } 245 }
246 246
247 surf->data = evas_gl->evas->engine.func->gl_surface_create(evas_gl->evas->engine.data.output, config, width, height); 247 surf->data = evas_gl->evas->engine.func->gl_surface_create(_evas_engine_context(evas_gl->evas), config, width, height);
248 248
249 if (!surf->data) 249 if (!surf->data)
250 { 250 {
@@ -301,7 +301,7 @@ evas_gl_pbuffer_surface_create(Evas_GL *evas_gl, Evas_GL_Config *cfg,
301 } 301 }
302 302
303 surf->data = evas_gl->evas->engine.func->gl_pbuffer_surface_create 303 surf->data = evas_gl->evas->engine.func->gl_pbuffer_surface_create
304 (evas_gl->evas->engine.data.output, cfg, w, h, attrib_list); 304 (_evas_engine_context(evas_gl->evas), cfg, w, h, attrib_list);
305 if (!surf->data) 305 if (!surf->data)
306 { 306 {
307 ERR("Engine failed to create a PBuffer!"); 307 ERR("Engine failed to create a PBuffer!");
@@ -333,7 +333,7 @@ evas_gl_surface_destroy(Evas_GL *evas_gl, Evas_GL_Surface *surf)
333 } 333 }
334 334
335 // Call Engine's Surface Destroy 335 // Call Engine's Surface Destroy
336 evas_gl->evas->engine.func->gl_surface_destroy(evas_gl->evas->engine.data.output, surf->data); 336 evas_gl->evas->engine.func->gl_surface_destroy(_evas_engine_context(evas_gl->evas), surf->data);
337 337
338 // Remove it from the list 338 // Remove it from the list
339 LKL(evas_gl->lck); 339 LKL(evas_gl->lck);
@@ -362,7 +362,7 @@ evas_gl_engine_data_get(void *evgl)
362 if (!evasgl) return NULL; 362 if (!evasgl) return NULL;
363 if (!evasgl->evas) return NULL; 363 if (!evasgl->evas) return NULL;
364 364
365 return evasgl->evas->engine.data.output; 365 return _evas_engine_context(evasgl->evas);
366} 366}
367 367
368EAPI Evas_GL_Context * 368EAPI Evas_GL_Context *
@@ -396,8 +396,8 @@ evas_gl_context_version_create(Evas_GL *evas_gl, Evas_GL_Context *share_ctx,
396 // Call engine->gl_create_context 396 // Call engine->gl_create_context
397 ctx->version = version; 397 ctx->version = version;
398 ctx->data = evas_gl->evas->engine.func->gl_context_create 398 ctx->data = evas_gl->evas->engine.func->gl_context_create
399 (evas_gl->evas->engine.data.output, share_ctx ? share_ctx->data : NULL, 399 (_evas_engine_context(evas_gl->evas), share_ctx ? share_ctx->data : NULL,
400 version, &evas_gl_native_context_get, &evas_gl_engine_data_get); 400 version, &evas_gl_native_context_get, &evas_gl_engine_data_get);
401 401
402 // Set a few variables 402 // Set a few variables
403 if (!ctx->data) 403 if (!ctx->data)
@@ -437,7 +437,7 @@ evas_gl_context_destroy(Evas_GL *evas_gl, Evas_GL_Context *ctx)
437 } 437 }
438 438
439 // Call Engine's destroy 439 // Call Engine's destroy
440 evas_gl->evas->engine.func->gl_context_destroy(evas_gl->evas->engine.data.output, ctx->data); 440 evas_gl->evas->engine.func->gl_context_destroy(_evas_engine_context(evas_gl->evas), ctx->data);
441 441
442 // Remove it from the list 442 // Remove it from the list
443 LKL(evas_gl->lck); 443 LKL(evas_gl->lck);
@@ -459,11 +459,11 @@ evas_gl_make_current(Evas_GL *evas_gl, Evas_GL_Surface *surf, Evas_GL_Context *c
459 MAGIC_CHECK_END(); 459 MAGIC_CHECK_END();
460 460
461 if ((surf) && (ctx)) 461 if ((surf) && (ctx))
462 ret = (Eina_Bool)evas_gl->evas->engine.func->gl_make_current(evas_gl->evas->engine.data.output, surf->data, ctx->data); 462 ret = (Eina_Bool)evas_gl->evas->engine.func->gl_make_current(_evas_engine_context(evas_gl->evas), surf->data, ctx->data);
463 else if ((!surf) && (!ctx)) 463 else if ((!surf) && (!ctx))
464 ret = (Eina_Bool)evas_gl->evas->engine.func->gl_make_current(evas_gl->evas->engine.data.output, NULL, NULL); 464 ret = (Eina_Bool)evas_gl->evas->engine.func->gl_make_current(_evas_engine_context(evas_gl->evas), NULL, NULL);
465 else if ((!surf) && (ctx)) // surfaceless make current 465 else if ((!surf) && (ctx)) // surfaceless make current
466 ret = (Eina_Bool)evas_gl->evas->engine.func->gl_make_current(evas_gl->evas->engine.data.output, NULL, ctx->data); 466 ret = (Eina_Bool)evas_gl->evas->engine.func->gl_make_current(_evas_engine_context(evas_gl->evas), NULL, ctx->data);
467 else 467 else
468 { 468 {
469 ERR("Bad match between surface: %p and context: %p", surf, ctx); 469 ERR("Bad match between surface: %p and context: %p", surf, ctx);
@@ -496,7 +496,7 @@ evas_gl_current_context_get(Evas_GL *evas_gl)
496 return NULL; 496 return NULL;
497 } 497 }
498 498
499 internal_ctx = evas_gl->evas->engine.func->gl_current_context_get(evas_gl->evas->engine.data.output); 499 internal_ctx = evas_gl->evas->engine.func->gl_current_context_get(_evas_engine_context(evas_gl->evas));
500 if (!internal_ctx) 500 if (!internal_ctx)
501 return NULL; 501 return NULL;
502 502
@@ -534,7 +534,7 @@ evas_gl_current_surface_get(Evas_GL *evas_gl)
534 return NULL; 534 return NULL;
535 } 535 }
536 536
537 internal_sfc = evas_gl->evas->engine.func->gl_current_surface_get(evas_gl->evas->engine.data.output); 537 internal_sfc = evas_gl->evas->engine.func->gl_current_surface_get(_evas_engine_context(evas_gl->evas));
538 if (!internal_sfc) 538 if (!internal_sfc)
539 return NULL; 539 return NULL;
540 540
@@ -580,7 +580,7 @@ evas_gl_string_query(Evas_GL *evas_gl, int name)
580 return ""; 580 return "";
581 MAGIC_CHECK_END(); 581 MAGIC_CHECK_END();
582 582
583 return evas_gl->evas->engine.func->gl_string_query(evas_gl->evas->engine.data.output, name); 583 return evas_gl->evas->engine.func->gl_string_query(_evas_engine_context(evas_gl->evas), name);
584} 584}
585 585
586EAPI Evas_GL_Func 586EAPI Evas_GL_Func
@@ -590,7 +590,7 @@ evas_gl_proc_address_get(Evas_GL *evas_gl, const char *name)
590 return NULL; 590 return NULL;
591 MAGIC_CHECK_END(); 591 MAGIC_CHECK_END();
592 592
593 return (Evas_GL_Func)evas_gl->evas->engine.func->gl_proc_address_get(evas_gl->evas->engine.data.output, name); 593 return (Evas_GL_Func)evas_gl->evas->engine.func->gl_proc_address_get(_evas_engine_context(evas_gl->evas), name);
594} 594}
595 595
596EAPI Eina_Bool 596EAPI Eina_Bool
@@ -614,7 +614,7 @@ evas_gl_native_surface_get(Evas_GL *evas_gl, Evas_GL_Surface *surf, Evas_Native_
614 return EINA_FALSE; 614 return EINA_FALSE;
615 } 615 }
616 616
617 return (Eina_Bool)evas_gl->evas->engine.func->gl_native_surface_get(evas_gl->evas->engine.data.output, surf->data, ns); 617 return (Eina_Bool)evas_gl->evas->engine.func->gl_native_surface_get(_evas_engine_context(evas_gl->evas), surf->data, ns);
618} 618}
619 619
620 620
@@ -625,7 +625,7 @@ evas_gl_api_get(Evas_GL *evas_gl)
625 return NULL; 625 return NULL;
626 MAGIC_CHECK_END(); 626 MAGIC_CHECK_END();
627 627
628 return (Evas_GL_API*)evas_gl->evas->engine.func->gl_api_get(evas_gl->evas->engine.data.output, EVAS_GL_GLES_2_X); 628 return (Evas_GL_API*)evas_gl->evas->engine.func->gl_api_get(_evas_engine_context(evas_gl->evas), EVAS_GL_GLES_2_X);
629} 629}
630 630
631EAPI Evas_GL_API * 631EAPI Evas_GL_API *
@@ -641,7 +641,7 @@ evas_gl_context_api_get(Evas_GL *evas_gl, Evas_GL_Context *ctx)
641 return NULL; 641 return NULL;
642 } 642 }
643 643
644 return (Evas_GL_API*)evas_gl->evas->engine.func->gl_api_get(evas_gl->evas->engine.data.output, ctx->version); 644 return (Evas_GL_API*)evas_gl->evas->engine.func->gl_api_get(_evas_engine_context(evas_gl->evas), ctx->version);
645} 645}
646 646
647EAPI int 647EAPI int
@@ -654,7 +654,7 @@ evas_gl_rotation_get(Evas_GL *evas_gl)
654 if (!evas_gl->evas->engine.func->gl_rotation_angle_get) 654 if (!evas_gl->evas->engine.func->gl_rotation_angle_get)
655 return 0; 655 return 0;
656 656
657 return evas_gl->evas->engine.func->gl_rotation_angle_get(evas_gl->evas->engine.data.output); 657 return evas_gl->evas->engine.func->gl_rotation_angle_get(_evas_engine_context(evas_gl->evas));
658} 658}
659 659
660EAPI int 660EAPI int
@@ -672,7 +672,7 @@ evas_gl_error_get(Evas_GL *evas_gl)
672 if (!evas_gl->evas->engine.func->gl_error_get) 672 if (!evas_gl->evas->engine.func->gl_error_get)
673 err = EVAS_GL_NOT_INITIALIZED; 673 err = EVAS_GL_NOT_INITIALIZED;
674 else 674 else
675 err = evas_gl->evas->engine.func->gl_error_get(evas_gl->evas->engine.data.output); 675 err = evas_gl->evas->engine.func->gl_error_get(_evas_engine_context(evas_gl->evas));
676 676
677end: 677end:
678 /* Call to evas_gl_error_get() should set error to EVAS_GL_SUCCESS */ 678 /* Call to evas_gl_error_get() should set error to EVAS_GL_SUCCESS */
@@ -703,5 +703,5 @@ evas_gl_surface_query(Evas_GL *evas_gl, Evas_GL_Surface *surface, int attribute,
703 } 703 }
704 704
705 return evas_gl->evas->engine.func->gl_surface_query 705 return evas_gl->evas->engine.func->gl_surface_query
706 (evas_gl->evas->engine.data.output, surface->data, attribute, value); 706 (_evas_engine_context(evas_gl->evas), surface->data, attribute, value);
707} 707}
diff --git a/src/lib/evas/canvas/evas_image_private.h b/src/lib/evas/canvas/evas_image_private.h
index 48e6e8b..77b837d 100644
--- a/src/lib/evas/canvas/evas_image_private.h
+++ b/src/lib/evas/canvas/evas_image_private.h
@@ -213,10 +213,6 @@ void *_evas_image_data_convert_internal(Evas_Image_Data *o, void *data, Evas_Col
213void _evas_image_unload(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Eina_Bool dirty); 213void _evas_image_unload(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Eina_Bool dirty);
214void _evas_image_load(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Evas_Image_Data *o); 214void _evas_image_load(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Evas_Image_Data *o);
215 215
216/* save typing */
217#define ENFN obj->layer->evas->engine.func
218#define ENDT obj->layer->evas->engine.data.output
219
220# define EINA_COW_IMAGE_STATE_WRITE_BEGIN(Obj, Write) \ 216# define EINA_COW_IMAGE_STATE_WRITE_BEGIN(Obj, Write) \
221 EINA_COW_WRITE_BEGIN(evas_object_image_state_cow, Obj->cur, Evas_Object_Image_State, Write) 217 EINA_COW_WRITE_BEGIN(evas_object_image_state_cow, Obj->cur, Evas_Object_Image_State, Write)
222 218
diff --git a/src/lib/evas/canvas/evas_main.c b/src/lib/evas/canvas/evas_main.c
index 1323a89..6af60da 100644
--- a/src/lib/evas/canvas/evas_main.c
+++ b/src/lib/evas/canvas/evas_main.c
@@ -350,13 +350,6 @@ _evas_canvas_efl_object_destructor(Eo *eo_e, Evas_Public_Data *e)
350 350
351 EINA_LIST_FREE(e->outputs, evo) efl_canvas_output_del(evo); 351 EINA_LIST_FREE(e->outputs, evo) efl_canvas_output_del(evo);
352 352
353 if (e->engine.func)
354 {
355 e->engine.func->ector_destroy(e->engine.data.output,
356 e->engine.ector);
357 e->engine.func->output_free(e->engine.data.output);
358 e->engine.func->info_free(eo_e, e->engine.info);
359 }
360 if (e->common_init) 353 if (e->common_init)
361 { 354 {
362 e->common_init = 0; 355 e->common_init = 0;
@@ -419,58 +412,35 @@ _evas_canvas_efl_object_destructor(Eo *eo_e, Evas_Public_Data *e)
419 efl_destructor(efl_super(eo_e, MY_CLASS)); 412 efl_destructor(efl_super(eo_e, MY_CLASS));
420} 413}
421 414
415// It is now expected that the first output in the list is the default one
416// manipulated by this set of legacy API
417
422EAPI Evas_Engine_Info * 418EAPI Evas_Engine_Info *
423evas_engine_info_get(const Evas *obj) 419evas_engine_info_get(const Evas *obj)
424{ 420{
425 const Evas_Public_Data *e = efl_data_scope_get(obj, EVAS_CANVAS_CLASS); 421 const Evas_Public_Data *e = efl_data_scope_get(obj, EVAS_CANVAS_CLASS);
426 Evas_Engine_Info *info; 422 Efl_Canvas_Output *output;
427
428 if (!e->engine.info) return NULL;
429 423
430 info = e->engine.info; 424 output = eina_list_data_get(e->outputs);
431 ((Evas_Public_Data *)e)->engine.info_magic = info->magic; 425 if (!output)
426 {
427 output = efl_canvas_output_add((Evas*) obj);
428 }
429 if (!output) return NULL;
432 430
433 return info; 431 return efl_canvas_output_engine_info_get(output);
434} 432}
435 433
436EAPI Eina_Bool 434EAPI Eina_Bool
437evas_engine_info_set(Evas *obj, Evas_Engine_Info *info) 435evas_engine_info_set(Evas *obj, Evas_Engine_Info *info)
438{ 436{
439 Evas_Public_Data *e = efl_data_scope_get(obj, EVAS_CANVAS_CLASS); 437 Evas_Public_Data *e = efl_data_scope_get(obj, EVAS_CANVAS_CLASS);
438 Efl_Canvas_Output *output;
440 439
440 output = eina_list_data_get(e->outputs);
441 if (!output) return EINA_FALSE;
441 if (!info) return EINA_FALSE; 442 if (!info) return EINA_FALSE;
442 if (info != e->engine.info) return EINA_FALSE; 443 return efl_canvas_output_engine_info_set(output, info);
443 if (info->magic != e->engine.info_magic) return EINA_FALSE;
444
445 evas_canvas_async_block(e);
446
447 if (e->engine.data.output)
448 {
449 if (e->engine.func->update)
450 {
451 e->engine.func->update(e->engine.data.output, info, e->output.w, e->output.h);
452 }
453 else
454 {
455 // For engine who do not provide an update function
456 e->engine.func->output_free(e->engine.data.output);
457
458 goto setup;
459 }
460 }
461 else
462 {
463 if (!e->common_init)
464 {
465 e->common_init = 1;
466 evas_common_init();
467 }
468
469 setup:
470 e->engine.data.output = e->engine.func->setup(info, e->output.w, e->output.h);
471 }
472
473 return !!e->engine.data.output;
474} 444}
475 445
476EOLIAN static Evas_Coord 446EOLIAN static Evas_Coord
@@ -831,11 +801,19 @@ _evas_canvas_efl_loop_user_loop_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e EI
831} 801}
832 802
833Ector_Surface * 803Ector_Surface *
834evas_ector_get(Evas_Public_Data *e) 804evas_ector_get(Evas_Public_Data *e, void *output)
835{ 805{
836 if (!e->engine.ector) 806 Efl_Canvas_Output *r;
837 e->engine.ector = e->engine.func->ector_create(e->engine.data.output); 807 Eina_List *l;
838 return e->engine.ector; 808
809 EINA_LIST_FOREACH(e->outputs, l, r)
810 if (r->output == output)
811 {
812 if (!r->ector)
813 r->ector = e->engine.func->ector_create(_evas_engine_context(e), output);
814 return r->ector;
815 }
816 return NULL;
839} 817}
840 818
841EAPI void 819EAPI void
@@ -868,11 +846,11 @@ _image_data_unset(Evas_Object_Protected_Data *obj, Eina_List **list)
868 obj->layer->evas->engine.func->ector_free(data->engine_data)) 846 obj->layer->evas->engine.func->ector_free(data->engine_data))
869 else CHECK(EFL_CANVAS_POLYGON_CLASS, Efl_Canvas_Polygon_Data, 847 else CHECK(EFL_CANVAS_POLYGON_CLASS, Efl_Canvas_Polygon_Data,
870 data->engine_data = 848 data->engine_data =
871 obj->layer->evas->engine.func->polygon_points_clear(obj->layer->evas->engine.data.output, 849 obj->layer->evas->engine.func->polygon_points_clear(ENC,
872 data->engine_data)) 850 data->engine_data))
873 else CHECK(EVAS_CANVAS3D_TEXTURE_CLASS, Evas_Canvas3D_Texture_Data, 851 else CHECK(EVAS_CANVAS3D_TEXTURE_CLASS, Evas_Canvas3D_Texture_Data,
874 if (obj->layer->evas->engine.func->texture_free) 852 if (obj->layer->evas->engine.func->texture_free)
875 obj->layer->evas->engine.func->texture_free(obj->layer->evas->engine.data.output, data->engine_data)) 853 obj->layer->evas->engine.func->texture_free(ENC, data->engine_data))
876 else return; 854 else return;
877#undef CHECK 855#undef CHECK
878 evas_object_ref(obj->object); 856 evas_object_ref(obj->object);
@@ -1015,7 +993,14 @@ evas_output_method_set(Evas *eo_e, int render_method)
1015 e->engine.module = em; 993 e->engine.module = em;
1016 evas_module_ref(em); 994 evas_module_ref(em);
1017 /* get the engine info struct */ 995 /* get the engine info struct */
1018 if (e->engine.func->info) e->engine.info = e->engine.func->info(eo_e); 996 if (e->engine.func->info)
997 {
998 Efl_Canvas_Output *output;
999 Eina_List *l;
1000
1001 EINA_LIST_FOREACH(e->outputs, l, output)
1002 output->info = e->engine.func->info(eo_e);
1003 }
1019 1004
1020 // Wayland already handles seats. 1005 // Wayland already handles seats.
1021 if (em->definition && (eina_streq(em->definition->name, "wayland_shm") || 1006 if (em->definition && (eina_streq(em->definition->name, "wayland_shm") ||
diff --git a/src/lib/evas/canvas/evas_map.c b/src/lib/evas/canvas/evas_map.c
index 7f8e794..4160452 100644
--- a/src/lib/evas/canvas/evas_map.c
+++ b/src/lib/evas/canvas/evas_map.c
@@ -205,7 +205,7 @@ _evas_map_free(Evas_Object *eo_obj, Evas_Map *m)
205 Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); 205 Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
206 if ((obj) && (obj->map->spans)) 206 if ((obj) && (obj->map->spans))
207 { 207 {
208 obj->layer->evas->engine.func->image_map_clean(obj->layer->evas->engine.data.output, obj->map->spans); 208 obj->layer->evas->engine.func->image_map_clean(ENC, obj->map->spans);
209 EINA_COW_WRITE_BEGIN(evas_object_map_cow, obj->map, Evas_Object_Map_Data, map_write) 209 EINA_COW_WRITE_BEGIN(evas_object_map_cow, obj->map, Evas_Object_Map_Data, map_write)
210 { 210 {
211 free(map_write->spans); 211 free(map_write->spans);
@@ -490,9 +490,7 @@ _map_map_enable_set(Eo *eo_obj, Evas_Object_Protected_Data *obj,
490 { 490 {
491 EINA_COW_WRITE_BEGIN(evas_object_map_cow, obj->map, Evas_Object_Map_Data, map_write) 491 EINA_COW_WRITE_BEGIN(evas_object_map_cow, obj->map, Evas_Object_Map_Data, map_write)
492 { 492 {
493 obj->layer->evas->engine.func->image_free 493 obj->layer->evas->engine.func->image_free(ENC, map_write->surface);
494 (obj->layer->evas->engine.data.output,
495 map_write->surface);
496 map_write->surface = NULL; 494 map_write->surface = NULL;
497 } 495 }
498 EINA_COW_WRITE_END(evas_object_map_cow, obj->map, map_write); 496 EINA_COW_WRITE_END(evas_object_map_cow, obj->map, map_write);
@@ -581,9 +579,7 @@ evas_object_map_set(Evas_Object *eo_obj, const Evas_Map *map)
581 { 579 {
582 EINA_COW_WRITE_BEGIN(evas_object_map_cow, obj->map, Evas_Object_Map_Data, map_write) 580 EINA_COW_WRITE_BEGIN(evas_object_map_cow, obj->map, Evas_Object_Map_Data, map_write)
583 { 581 {
584 obj->layer->evas->engine.func->image_free 582 obj->layer->evas->engine.func->image_free(ENC, map_write->surface);
585 (obj->layer->evas->engine.data.output,
586 map_write->surface);
587 map_write->surface = NULL; 583 map_write->surface = NULL;
588 } 584 }
589 EINA_COW_WRITE_END(evas_object_map_cow, obj->map, map_write); 585 EINA_COW_WRITE_END(evas_object_map_cow, obj->map, map_write);
diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c
index 0dcb779..0065740 100644
--- a/src/lib/evas/canvas/evas_object_image.c
+++ b/src/lib/evas/canvas/evas_object_image.c
@@ -1123,8 +1123,8 @@ _evas_canvas_image_cache_flush(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
1123{ 1123{
1124 evas_canvas_async_block(e); 1124 evas_canvas_async_block(e);
1125 evas_render_rendering_wait(e); 1125 evas_render_rendering_wait(e);
1126 if (e->engine.data.output) 1126 if (_evas_engine_context(e))
1127 e->engine.func->image_cache_flush(e->engine.data.output); 1127 e->engine.func->image_cache_flush(_evas_engine_context(e));
1128} 1128}
1129 1129
1130EOLIAN void 1130EOLIAN void
@@ -1178,15 +1178,15 @@ _evas_canvas_image_cache_set(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, int size
1178 if (size < 0) size = 0; 1178 if (size < 0) size = 0;
1179 evas_canvas_async_block(e); 1179 evas_canvas_async_block(e);
1180 evas_render_rendering_wait(e); 1180 evas_render_rendering_wait(e);
1181 if (e->engine.data.output) 1181 if (_evas_engine_context(e))
1182 e->engine.func->image_cache_set(e->engine.data.output, size); 1182 e->engine.func->image_cache_set(_evas_engine_context(e), size);
1183} 1183}
1184 1184
1185EOLIAN int 1185EOLIAN int
1186_evas_canvas_image_cache_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e) 1186_evas_canvas_image_cache_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
1187{ 1187{
1188 if (e->engine.data.output) 1188 if (_evas_engine_context(e))
1189 return e->engine.func->image_cache_get(e->engine.data.output); 1189 return e->engine.func->image_cache_get(_evas_engine_context(e));
1190 return -1; 1190 return -1;
1191} 1191}
1192 1192
@@ -1198,7 +1198,7 @@ _evas_canvas_image_max_size_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, int *
1198 if (maxw) *maxw = 0xffff; 1198 if (maxw) *maxw = 0xffff;
1199 if (maxh) *maxh = 0xffff; 1199 if (maxh) *maxh = 0xffff;
1200 if (!e->engine.func->image_max_size_get) return EINA_FALSE; 1200 if (!e->engine.func->image_max_size_get) return EINA_FALSE;
1201 e->engine.func->image_max_size_get(e->engine.data.output, &w, &h); 1201 e->engine.func->image_max_size_get(_evas_engine_context(e), &w, &h);
1202 if (maxw) *maxw = w; 1202 if (maxw) *maxw = w;
1203 if (maxh) *maxh = h; 1203 if (maxh) *maxh = h;
1204 return EINA_TRUE; 1204 return EINA_TRUE;
@@ -2493,7 +2493,7 @@ evas_object_image_render_pre(Evas_Object *eo_obj,
2493 { 2493 {
2494 Evas_Coord idw, idh, idx, idy; 2494 Evas_Coord idw, idh, idx, idy;
2495 int x, y, w, h; 2495 int x, y, w, h;
2496 e->engine.func->image_dirty_region(e->engine.data.output, o->engine_data, rr->x, rr->y, rr->w, rr->h); 2496 e->engine.func->image_dirty_region(ENDT, o->engine_data, rr->x, rr->y, rr->w, rr->h);
2497 2497
2498 idx = evas_object_image_figure_x_fill(eo_obj, obj, o->cur->fill.x, o->cur->fill.w, &idw); 2498 idx = evas_object_image_figure_x_fill(eo_obj, obj, o->cur->fill.x, o->cur->fill.w, &idw);
2499 idy = evas_object_image_figure_y_fill(eo_obj, obj, o->cur->fill.y, o->cur->fill.h, &idh); 2499 idy = evas_object_image_figure_y_fill(eo_obj, obj, o->cur->fill.y, o->cur->fill.h, &idh);
@@ -2613,7 +2613,7 @@ evas_object_image_render_pre(Evas_Object *eo_obj,
2613 { 2613 {
2614 Eina_Rectangle r; 2614 Eina_Rectangle r;
2615 2615
2616 e->engine.func->image_dirty_region(e->engine.data.output, o->engine_data, rr->x, rr->y, rr->w, rr->h); 2616 e->engine.func->image_dirty_region(ENDT, o->engine_data, rr->x, rr->y, rr->w, rr->h);
2617 r.x = rr->x; 2617 r.x = rr->x;
2618 r.y = rr->y; 2618 r.y = rr->y;
2619 r.w = rr->w; 2619 r.w = rr->w;
@@ -2639,7 +2639,7 @@ evas_object_image_render_pre(Evas_Object *eo_obj,
2639 eina_rectangle_free(r); 2639 eina_rectangle_free(r);
2640 } 2640 }
2641 EINA_COW_PIXEL_WRITE_END(o, pixi_write); 2641 EINA_COW_PIXEL_WRITE_END(o, pixi_write);
2642 e->engine.func->image_dirty_region(e->engine.data.output, o->engine_data, 0, 0, o->cur->image.w, o->cur->image.h); 2642 e->engine.func->image_dirty_region(ENDT, o->engine_data, 0, 0, o->cur->image.w, o->cur->image.h);
2643 2643
2644 evas_object_render_pre_prev_cur_add(&e->clip_changes, eo_obj, 2644 evas_object_render_pre_prev_cur_add(&e->clip_changes, eo_obj,
2645 obj); 2645 obj);
diff --git a/src/lib/evas/canvas/evas_object_main.c b/src/lib/evas/canvas/evas_object_main.c
index c6b4af8..734bee6 100644
--- a/src/lib/evas/canvas/evas_object_main.c
+++ b/src/lib/evas/canvas/evas_object_main.c
@@ -402,9 +402,7 @@ evas_object_free(Evas_Object *eo_obj, Eina_Bool clean_layer)
402 { 402 {
403 if (obj->layer) 403 if (obj->layer)
404 { 404 {
405 obj->layer->evas->engine.func->image_free 405 obj->layer->evas->engine.func->image_free(ENC, obj->map->surface);
406 (obj->layer->evas->engine.data.output,
407 obj->map->surface);
408 } 406 }
409 EINA_COW_WRITE_BEGIN(evas_object_map_cow, obj->map, Evas_Object_Map_Data, map_write) 407 EINA_COW_WRITE_BEGIN(evas_object_map_cow, obj->map, Evas_Object_Map_Data, map_write)
410 map_write->surface = NULL; 408 map_write->surface = NULL;
@@ -421,8 +419,7 @@ evas_object_free(Evas_Object *eo_obj, Eina_Bool clean_layer)
421 { 419 {
422 if (obj->layer) 420 if (obj->layer)
423 { 421 {
424 obj->layer->evas->engine.func->image_free 422 obj->layer->evas->engine.func->image_free(ENC, mask->surface);
425 (obj->layer->evas->engine.data.output, mask->surface);
426 mask->surface = NULL; 423 mask->surface = NULL;
427 } 424 }
428 } 425 }
@@ -533,8 +530,7 @@ evas_object_content_change(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
533 EINA_COW_WRITE_BEGIN(evas_object_map_cow, 530 EINA_COW_WRITE_BEGIN(evas_object_map_cow,
534 obj->map, Evas_Object_Map_Data, map_write) 531 obj->map, Evas_Object_Map_Data, map_write)
535 { 532 {
536 obj->layer->evas->engine.func->image_free 533 obj->layer->evas->engine.func->image_free(ENC, map_write->surface);
537 (obj->layer->evas->engine.data.output, map_write->surface);
538 map_write->surface = NULL; 534 map_write->surface = NULL;
539 } 535 }
540 EINA_COW_WRITE_END(evas_object_map_cow, obj->map, map_write); 536 EINA_COW_WRITE_END(evas_object_map_cow, obj->map, map_write);
@@ -699,7 +695,7 @@ evas_object_render_pre_effect_updates(Eina_Array *rects, Evas_Object *eo_obj, in
699 obj->cur->cache.clip.w, 695 obj->cur->cache.clip.w,
700 obj->cur->cache.clip.h); 696 obj->cur->cache.clip.h);
701 if ((w > 0) && (h > 0)) 697 if ((w > 0) && (h > 0))
702 obj->layer->evas->engine.func->output_redraws_rect_add(e->engine.data.output, 698 obj->layer->evas->engine.func->output_redraws_rect_add(ENDT,
703 x + e->framespace.x, 699 x + e->framespace.x,
704 y + e->framespace.y, 700 y + e->framespace.y,
705 w, h); 701 w, h);
@@ -714,7 +710,7 @@ evas_object_render_pre_effect_updates(Eina_Array *rects, Evas_Object *eo_obj, in
714 obj->prev->cache.clip.w, 710 obj->prev->cache.clip.w,
715 obj->prev->cache.clip.h); 711 obj->prev->cache.clip.h);
716 if ((w > 0) && (h > 0)) 712 if ((w > 0) && (h > 0))
717 obj->layer->evas->engine.func->output_redraws_rect_add(e->engine.data.output, 713 obj->layer->evas->engine.func->output_redraws_rect_add(ENDT,
718 x + e->framespace.x, 714 x + e->framespace.x,
719 y + e->framespace.y, 715 y + e->framespace.y,
720 w, h); 716 w, h);
@@ -737,7 +733,7 @@ evas_object_render_pre_effect_updates(Eina_Array *rects, Evas_Object *eo_obj, in
737 obj->cur->cache.clip.w, 733 obj->cur->cache.clip.w,
738 obj->cur->cache.clip.h); 734 obj->cur->cache.clip.h);
739 if ((w > 0) && (h > 0)) 735 if ((w > 0) && (h > 0))
740 obj->layer->evas->engine.func->output_redraws_rect_add(e->engine.data.output, 736 obj->layer->evas->engine.func->output_redraws_rect_add(ENDT,
741 x + e->framespace.x, 737 x + e->framespace.x,
742 y + e->framespace.y, 738 y + e->framespace.y,
743 w, h); 739 w, h);
@@ -749,7 +745,7 @@ evas_object_render_pre_effect_updates(Eina_Array *rects, Evas_Object *eo_obj, in
749 obj->prev->cache.clip.w, 745 obj->prev->cache.clip.w,
750 obj->prev->cache.clip.h); 746 obj->prev->cache.clip.h);
751 if ((w > 0) && (h > 0)) 747 if ((w > 0) && (h > 0))
752 obj->layer->evas->engine.func->output_redraws_rect_add(e->engine.data.output, 748 obj->layer->evas->engine.func->output_redraws_rect_add(ENDT,
753 x + e->framespace.x, 749 x + e->framespace.x,
754 y + e->framespace.y, 750 y + e->framespace.y,
755 w, h); 751 w, h);
@@ -1711,8 +1707,7 @@ _hide(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
1711 mask->w = mask->h = 0; 1707 mask->w = mask->h = 0;
1712 if (mask->surface) 1708 if (mask->surface)
1713 { 1709 {
1714 obj->layer->evas->engine.func->image_free 1710 obj->layer->evas->engine.func->image_free(ENC, mask->surface);
1715 (obj->layer->evas->engine.data.output, mask->surface);
1716 mask->surface = NULL; 1711 mask->surface = NULL;
1717 } 1712 }
1718 EINA_COW_WRITE_END(evas_object_mask_cow, obj->mask, mask); 1713 EINA_COW_WRITE_END(evas_object_mask_cow, obj->mask, mask);
diff --git a/src/lib/evas/canvas/evas_object_polygon.c b/src/lib/evas/canvas/evas_object_polygon.c
index 9707712..b819fdf 100644
--- a/src/lib/evas/canvas/evas_object_polygon.c
+++ b/src/lib/evas/canvas/evas_object_polygon.c
@@ -262,8 +262,7 @@ evas_object_polygon_free(Evas_Object *eo_obj EINA_UNUSED,
262 { 262 {
263 free(list_data); 263 free(list_data);
264 } 264 }
265 o->engine_data = obj->layer->evas->engine.func->polygon_points_clear(obj->layer->evas->engine.data.output, 265 o->engine_data = obj->layer->evas->engine.func->polygon_points_clear(ENC, o->engine_data);
266 o->engine_data);
267} 266}
268 267
269static void 268static void
@@ -289,13 +288,12 @@ evas_object_polygon_render(Evas_Object *eo_obj EINA_UNUSED,
289 obj->cur->render_op); 288 obj->cur->render_op);
290 if (o->changed) 289 if (o->changed)
291 { 290 {
292 o->engine_data = obj->layer->evas->engine.func->polygon_points_clear(obj->layer->evas->engine.data.output, 291 o->engine_data = obj->layer->evas->engine.func->polygon_points_clear(ENC, o->engine_data);
293 o->engine_data);
294 EINA_LIST_FOREACH(o->points, l, p) 292 EINA_LIST_FOREACH(o->points, l, p)
295 { 293 {
296 //px = evas_coord_world_x_to_screen(obj->layer->evas, p->x); 294 //px = evas_coord_world_x_to_screen(obj->layer->evas, p->x);
297 //py = evas_coord_world_y_to_screen(obj->layer->evas, p->y); 295 //py = evas_coord_world_y_to_screen(obj->layer->evas, p->y);
298 o->engine_data = obj->layer->evas->engine.func->polygon_point_add(obj->layer->evas->engine.data.output, 296 o->engine_data = obj->layer->evas->engine.func->polygon_point_add(ENC,
299 o->engine_data, 297 o->engine_data,
300 p->x, p->y); 298 p->x, p->y);
301 } 299 }
diff --git a/src/lib/evas/canvas/evas_object_text.c b/src/lib/evas/canvas/evas_object_text.c
index 083e894..aa9b14d 100644
--- a/src/lib/evas/canvas/evas_object_text.c
+++ b/src/lib/evas/canvas/evas_object_text.c
@@ -16,8 +16,6 @@
16#endif 16#endif
17 17
18/* save typing */ 18/* save typing */
19#define ENFN obj->layer->evas->engine.func
20#define ENDT obj->layer->evas->engine.data.output
21#define COL_OBJECT(obj, sub) ARGB_JOIN(obj->sub->color.a, obj->sub->color.r, obj->sub->color.g, obj->sub->color.b) 19#define COL_OBJECT(obj, sub) ARGB_JOIN(obj->sub->color.a, obj->sub->color.r, obj->sub->color.g, obj->sub->color.b)
22#define COL_JOIN(o, sub, color) ARGB_JOIN(o->sub.color.a, o->sub.color.r, o->sub.color.g, o->sub.color.b) 20#define COL_JOIN(o, sub, color) ARGB_JOIN(o->sub.color.a, o->sub.color.r, o->sub.color.g, o->sub.color.b)
23 21
diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c
index 2285e15..0555008 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -81,10 +81,6 @@
81#include "evas_filter.h" 81#include "evas_filter.h"
82#include "efl_canvas_filter_internal.eo.h" 82#include "efl_canvas_filter_internal.eo.h"
83 83
84/* save typing */
85#define ENFN obj->layer->evas->engine.func
86#define ENDT obj->layer->evas->engine.data.output
87
88/* private magic number for textblock objects */ 84/* private magic number for textblock objects */
89static const char o_type[] = "textblock"; 85static const char o_type[] = "textblock";
90 86
@@ -974,7 +970,7 @@ _image_safe_unref(Evas_Public_Data *e, void *image, Eina_Bool async)
974 if (async) 970 if (async)
975 evas_unref_queue_image_put(e, image); 971 evas_unref_queue_image_put(e, image);
976 else 972 else
977 e->engine.func->image_free(e->engine.data.output, image); 973 e->engine.func->image_free(_evas_engine_context(e), image);
978} 974}
979 975
980/** 976/**
diff --git a/src/lib/evas/canvas/evas_object_textgrid.c b/src/lib/evas/canvas/evas_object_textgrid.c
index 597070a..730df32 100644
--- a/src/lib/evas/canvas/evas_object_textgrid.c
+++ b/src/lib/evas/canvas/evas_object_textgrid.c
@@ -5,10 +5,6 @@
5 5
6#define MY_CLASS_NAME "Evas_Textgrid" 6#define MY_CLASS_NAME "Evas_Textgrid"
7 7
8/* save typing */
9#define ENFN obj->layer->evas->engine.func
10#define ENDT obj->layer->evas->engine.data.output
11
12/* private magic number for text objects */ 8/* private magic number for text objects */
13static const char o_type[] = "textgrid"; 9static const char o_type[] = "textgrid";
14 10
@@ -1021,17 +1017,17 @@ _alternate_font_weight_slant(Evas_Object_Protected_Data *obj,
1021 int advance, vadvance, ascent; 1017 int advance, vadvance, ascent;
1022 1018
1023 script = evas_common_language_script_type_get(W, 1); 1019 script = evas_common_language_script_type_get(W, 1);
1024 ENFN->font_run_end_get(ENDT, font, &script_fi, &cur_fi, 1020 ENFN->font_run_end_get(ENC, font, &script_fi, &cur_fi,
1025 script, W, 1); 1021 script, W, 1);
1026 memset(&text_props, 0, sizeof(Evas_Text_Props)); 1022 memset(&text_props, 0, sizeof(Evas_Text_Props));
1027 evas_common_text_props_script_set(&text_props, script); 1023 evas_common_text_props_script_set(&text_props, script);
1028 ENFN->font_text_props_info_create(ENDT, script_fi, W, &text_props, 1024 ENFN->font_text_props_info_create(ENC, script_fi, W, &text_props,
1029 NULL, 0, 1, 1025 NULL, 0, 1,
1030 EVAS_TEXT_PROPS_MODE_NONE, 1026 EVAS_TEXT_PROPS_MODE_NONE,
1031 fdesc->lang); 1027 fdesc->lang);
1032 advance = ENFN->font_h_advance_get(ENDT, font, &text_props); 1028 advance = ENFN->font_h_advance_get(ENC, font, &text_props);
1033 vadvance = ENFN->font_v_advance_get(ENDT, font, &text_props); 1029 vadvance = ENFN->font_v_advance_get(ENC, font, &text_props);
1034 ascent = ENFN->font_ascent_get(ENDT, font); 1030 ascent = ENFN->font_ascent_get(ENC, font);
1035 DBG("on font '%s', with alternate weight/slant %s, " 1031 DBG("on font '%s', with alternate weight/slant %s, "
1036 "width: %d vs %d, height: %d vs %d, ascent: %d vs %d", 1032 "width: %d vs %d, height: %d vs %d, ascent: %d vs %d",
1037 fdesc->name, kind, 1033 fdesc->name, kind,
@@ -1127,19 +1123,19 @@ _evas_textgrid_efl_text_properties_font_set(Eo *eo_obj,
1127 int advance, vadvance; 1123 int advance, vadvance;
1128 1124
1129 script = evas_common_language_script_type_get(W, 1); 1125 script = evas_common_language_script_type_get(W, 1);
1130 ENFN->font_run_end_get(ENDT, o->font_normal, &script_fi, &cur_fi, 1126 ENFN->font_run_end_get(ENC, o->font_normal, &script_fi, &cur_fi,
1131 script, W, 1); 1127 script, W, 1);
1132 memset(&text_props, 0, sizeof(Evas_Text_Props)); 1128 memset(&text_props, 0, sizeof(Evas_Text_Props));
1133 evas_common_text_props_script_set(&text_props, script); 1129 evas_common_text_props_script_set(&text_props, script);
1134 ENFN->font_text_props_info_create(ENDT, script_fi, W, &text_props, 1130 ENFN->font_text_props_info_create(ENC, script_fi, W, &text_props,
1135 NULL, 0, 1, 1131 NULL, 0, 1,
1136 EVAS_TEXT_PROPS_MODE_NONE, 1132 EVAS_TEXT_PROPS_MODE_NONE,
1137 fdesc->lang); 1133 fdesc->lang);
1138 advance = ENFN->font_h_advance_get(ENDT, o->font_normal, &text_props); 1134 advance = ENFN->font_h_advance_get(ENC, o->font_normal, &text_props);
1139 vadvance = ENFN->font_v_advance_get(ENDT, o->font_normal, &text_props); 1135 vadvance = ENFN->font_v_advance_get(ENC, o->font_normal, &text_props);
1140 o->cur.char_width = advance; 1136 o->cur.char_width = advance;
1141 o->cur.char_height = vadvance; 1137 o->cur.char_height = vadvance;
1142 o->ascent = ENFN->font_ascent_get(ENDT, o->font_normal); 1138 o->ascent = ENFN->font_ascent_get(ENC, o->font_normal);
1143 evas_common_text_props_content_unref(&text_props); 1139 evas_common_text_props_content_unref(&text_props);
1144 } 1140 }
1145 else 1141 else
diff --git a/src/lib/evas/canvas/evas_object_vg.c b/src/lib/evas/canvas/evas_object_vg.c
index 57d1587..7de216c 100644
--- a/src/lib/evas/canvas/evas_object_vg.c
+++ b/src/lib/evas/canvas/evas_object_vg.c
@@ -181,7 +181,7 @@ evas_object_vg_render(Evas_Object *eo_obj EINA_UNUSED,
181 int x, int y, Eina_Bool do_async) 181 int x, int y, Eina_Bool do_async)
182{ 182{
183 Evas_VG_Data *vd = type_private_data; 183 Evas_VG_Data *vd = type_private_data;
184 Ector_Surface *ector = evas_ector_get(obj->layer->evas); 184 Ector_Surface *ector = evas_ector_get(obj->layer->evas, output);
185 // FIXME: Set context (that should affect Ector_Surface) and 185 // FIXME: Set context (that should affect Ector_Surface) and
186 // then call Ector_Renderer render from bottom to top. Get the 186 // then call Ector_Renderer render from bottom to top. Get the
187 // Ector_Surface that match the output from Evas engine API. 187 // Ector_Surface that match the output from Evas engine API.
@@ -251,7 +251,7 @@ evas_object_vg_render_pre(Evas_Object *eo_obj,
251 } 251 }
252 252
253 // FIXME: handle damage only on changed renderer. 253 // FIXME: handle damage only on changed renderer.
254 s = evas_ector_get(obj->layer->evas); 254 s = evas_ector_get(obj->layer->evas, _evas_default_output_get(obj->layer->evas));
255 if (vd->root && s) 255 if (vd->root && s)
256 _evas_vg_render_pre(vd->root, s, NULL); 256 _evas_vg_render_pre(vd->root, s, NULL);
257 257
diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c
index eb4f8f6..7aac4f6 100644
--- a/src/lib/evas/canvas/evas_render.c
+++ b/src/lib/evas/canvas/evas_render.c
@@ -96,8 +96,12 @@ rend_dbg(const char *txt)
96#define OBJS_ARRAY_FLUSH(array) eina_array_flush(array) 96#define OBJS_ARRAY_FLUSH(array) eina_array_flush(array)
97 97
98/* save typing */ 98/* save typing */
99#undef ENFN
100#undef ENDT
101#undef ENC
99#define ENFN evas->engine.func 102#define ENFN evas->engine.func
100#define ENDT evas->engine.data.output 103#define ENDT _evas_default_output_get(evas)
104#define ENC _evas_engine_context(evas)
101 105
102typedef struct _Render_Updates Render_Updates; 106typedef struct _Render_Updates Render_Updates;
103typedef struct _Cutout_Margin Cutout_Margin; 107typedef struct _Cutout_Margin Cutout_Margin;
@@ -1876,7 +1880,7 @@ evas_render_mapped(Evas_Public_Data *evas, Evas_Object *eo_obj,
1876 RD(level, " new surf: %ix%i\n", sw, sh); 1880 RD(level, " new surf: %ix%i\n", sw, sh);
1877 EINA_COW_WRITE_BEGIN(evas_object_map_cow, obj->map, Evas_Object_Map_Data, map_write) 1881 EINA_COW_WRITE_BEGIN(evas_object_map_cow, obj->map, Evas_Object_Map_Data, map_write)
1878 { 1882 {
1879 ENFN->image_free(ENDT, map_write->surface); 1883 ENFN->image_free(ENC, map_write->surface);
1880 map_write->surface = NULL; 1884 map_write->surface = NULL;
1881 } 1885 }
1882 EINA_COW_WRITE_END(evas_object_map_cow, obj->map, map_write); 1886 EINA_COW_WRITE_END(evas_object_map_cow, obj->map, map_write);
@@ -1890,7 +1894,7 @@ evas_render_mapped(Evas_Public_Data *evas, Evas_Object *eo_obj,
1890 map_write->surface_h = sh; 1894 map_write->surface_h = sh;
1891 1895
1892 map_write->surface = ENFN->image_map_surface_new 1896 map_write->surface = ENFN->image_map_surface_new
1893 (ENDT, map_write->surface_w, 1897 (ENC, map_write->surface_w,
1894 map_write->surface_h, 1898 map_write->surface_h,
1895 map_write->cur.map->alpha); 1899 map_write->cur.map->alpha);
1896 } 1900 }
@@ -2328,7 +2332,7 @@ evas_render_proxy_subrender(Evas *eo_e, Evas_Object *eo_source, Evas_Object *eo_
2328 ((proxy_write->w != w) || (proxy_write->h != h))) 2332 ((proxy_write->w != w) || (proxy_write->h != h)))
2329 { 2333 {
2330 RD(level, " free surface: %p\n", proxy_write->surface); 2334 RD(level, " free surface: %p\n", proxy_write->surface);
2331 ENFN->image_free(ENDT, proxy_write->surface); 2335 ENFN->image_free(ENC, proxy_write->surface);
2332 proxy_write->surface = NULL; 2336 proxy_write->surface = NULL;
2333 } 2337 }
2334 2338
@@ -2337,7 +2341,7 @@ evas_render_proxy_subrender(Evas *eo_e, Evas_Object *eo_source, Evas_Object *eo_
2337 if (!proxy_write->surface) 2341 if (!proxy_write->surface)
2338 { 2342 {
2339 if ((w < 1) || (h < 1)) goto end; 2343 if ((w < 1) || (h < 1)) goto end;
2340 proxy_write->surface = ENFN->image_map_surface_new(ENDT, w, h, 1); 2344 proxy_write->surface = ENFN->image_map_surface_new(ENC, w, h, 1);
2341 RD(level, " created surface: %p %dx%d\n", proxy_write->surface, w, h); 2345 RD(level, " created surface: %p %dx%d\n", proxy_write->surface, w, h);
2342 if (!proxy_write->surface) goto end; 2346 if (!proxy_write->surface) goto end;
2343 proxy_write->w = w; 2347 proxy_write->w = w;
@@ -2509,7 +2513,7 @@ evas_render_mask_subrender(Evas_Public_Data *evas,
2509 * (we don't know how to render objects to alpha) */ 2513 * (we don't know how to render objects to alpha) */
2510 if (mdata->surface && ((w != mdata->w) || (h != mdata->h) || mdata->is_alpha || mdata->is_scaled)) 2514 if (mdata->surface && ((w != mdata->w) || (h != mdata->h) || mdata->is_alpha || mdata->is_scaled))
2511 { 2515 {
2512 ENFN->image_free(ENDT, mdata->surface); 2516 ENFN->image_free(ENC, mdata->surface);
2513 mdata->surface = NULL; 2517 mdata->surface = NULL;
2514 } 2518 }
2515 2519
@@ -2517,7 +2521,7 @@ evas_render_mask_subrender(Evas_Public_Data *evas,
2517 if (!mdata->surface) 2521 if (!mdata->surface)
2518 { 2522 {
2519 eina_evlog("+mask_surface_new", mask->object, 0.0, NULL); 2523 eina_evlog("+mask_surface_new", mask->object, 0.0, NULL);
2520 mdata->surface = ENFN->image_map_surface_new(ENDT, w, h, EINA_TRUE); 2524 mdata->surface = ENFN->image_map_surface_new(ENC, w, h, EINA_TRUE);
2521 eina_evlog("-mask_surface_new", mask->object, 0.0, NULL); 2525 eina_evlog("-mask_surface_new", mask->object, 0.0, NULL);
2522 if (!mdata->surface) goto end; 2526 if (!mdata->surface) goto end;
2523 mdata->is_alpha = EINA_FALSE; 2527 mdata->is_alpha = EINA_FALSE;
@@ -2582,7 +2586,7 @@ evas_render_mask_subrender(Evas_Public_Data *evas,
2582 2586
2583 eina_evlog("+mask_new_cpy_data", mask->object, 0.0, NULL); 2587 eina_evlog("+mask_new_cpy_data", mask->object, 0.0, NULL);
2584 alpha_surface = ENFN->image_new_from_copied_data 2588 alpha_surface = ENFN->image_new_from_copied_data
2585 (ENDT, w, h, NULL, EINA_TRUE, EVAS_COLORSPACE_GRY8); 2589 (ENC, w, h, NULL, EINA_TRUE, EVAS_COLORSPACE_GRY8);
2586 eina_evlog("-mask_new_cpy_data", mask->object, 0.0, NULL); 2590 eina_evlog("-mask_new_cpy_data", mask->object, 0.0, NULL);
2587 if (!alpha_surface) goto end; 2591 if (!alpha_surface) goto end;
2588 2592
@@ -2596,7 +2600,7 @@ evas_render_mask_subrender(Evas_Public_Data *evas,
2596 eina_evlog("-mask_cpy_data", mask->object, 0.0, NULL); 2600 eina_evlog("-mask_cpy_data", mask->object, 0.0, NULL);
2597 2601
2598 /* Now we can drop the original surface */ 2602 /* Now we can drop the original surface */
2599 ENFN->image_free(ENDT, mdata->surface); 2603 ENFN->image_free(ENC, mdata->surface);
2600 mdata->surface = alpha_surface; 2604 mdata->surface = alpha_surface;
2601 mdata->is_alpha = EINA_TRUE; 2605 mdata->is_alpha = EINA_TRUE;
2602 } 2606 }
@@ -3828,8 +3832,14 @@ _evas_canvas_render_idle_flush(Eo *eo_e, Evas_Public_Data *evas)
3828 3832
3829 evas_fonts_zero_pressure(eo_e); 3833 evas_fonts_zero_pressure(eo_e);
3830 3834
3831 if (ENFN && ENFN->output_idle_flush && ENDT) 3835 if (ENFN && ENFN->output_idle_flush)
3832 ENFN->output_idle_flush(ENDT); 3836 {
3837 Efl_Canvas_Output *output;
3838 Eina_List *l;
3839
3840 EINA_LIST_FOREACH(evas->outputs, l, output)
3841 ENFN->output_idle_flush(output->output);
3842 }
3833 3843
3834 eina_inarray_flush(&evas->active_objects); 3844 eina_inarray_flush(&evas->active_objects);
3835 OBJS_ARRAY_FLUSH(&evas->render_objects); 3845 OBJS_ARRAY_FLUSH(&evas->render_objects);
@@ -3865,7 +3875,7 @@ _evas_render_dump_map_surfaces(Evas_Object *eo_obj)
3865 if ((obj->map->cur.map) && obj->map->surface) 3875 if ((obj->map->cur.map) && obj->map->surface)
3866 { 3876 {
3867 Evas_Public_Data *evas = obj->layer->evas; 3877 Evas_Public_Data *evas = obj->layer->evas;
3868 ENFN->image_free(ENDT, obj->map->surface); 3878 ENFN->image_free(ENC, obj->map->surface);
3869 EINA_COW_WRITE_BEGIN(evas_object_map_cow, obj->map, Evas_Object_Map_Data, map_write) 3879 EINA_COW_WRITE_BEGIN(evas_object_map_cow, obj->map, Evas_Object_Map_Data, map_write)
3870 map_write->surface = NULL; 3880 map_write->surface = NULL;
3871 EINA_COW_WRITE_END(evas_object_map_cow, obj->map, map_write); 3881 EINA_COW_WRITE_END(evas_object_map_cow, obj->map, map_write);
@@ -3904,7 +3914,7 @@ _evas_canvas_render_dump(Eo *eo_e, Evas_Public_Data *evas)
3904 { 3914 {
3905 EINA_COW_WRITE_BEGIN(evas_object_proxy_cow, obj->proxy, Evas_Object_Proxy_Data, proxy_write) 3915 EINA_COW_WRITE_BEGIN(evas_object_proxy_cow, obj->proxy, Evas_Object_Proxy_Data, proxy_write)
3906 { 3916 {
3907 ENFN->image_free(ENDT, proxy_write->surface); 3917 ENFN->image_free(ENC, proxy_write->surface);
3908 proxy_write->surface = NULL; 3918 proxy_write->surface = NULL;
3909 } 3919 }
3910 EINA_COW_WRITE_END(evas_object_proxy_cow, obj->proxy, proxy_write); 3920 EINA_COW_WRITE_END(evas_object_proxy_cow, obj->proxy, proxy_write);
@@ -3913,7 +3923,7 @@ _evas_canvas_render_dump(Eo *eo_e, Evas_Public_Data *evas)
3913 { 3923 {
3914 EINA_COW_WRITE_BEGIN(evas_object_mask_cow, obj->mask, Evas_Object_Mask_Data, mdata) 3924 EINA_COW_WRITE_BEGIN(evas_object_mask_cow, obj->mask, Evas_Object_Mask_Data, mdata)
3915 { 3925 {
3916 ENFN->image_free(ENDT, mdata->surface); 3926 ENFN->image_free(ENC, mdata->surface);
3917 mdata->surface = NULL; 3927 mdata->surface = NULL;
3918 } 3928 }
3919 EINA_COW_WRITE_END(evas_object_mask_cow, obj->mask, mdata); 3929 EINA_COW_WRITE_END(evas_object_mask_cow, obj->mask, mdata);
@@ -3925,8 +3935,14 @@ _evas_canvas_render_dump(Eo *eo_e, Evas_Public_Data *evas)
3925 lay->walking_objects--; 3935 lay->walking_objects--;
3926 _evas_layer_flush_removes(lay); 3936 _evas_layer_flush_removes(lay);
3927 } 3937 }
3928 if (ENFN && ENFN->output_dump && ENDT) 3938 if (ENFN && ENFN->output_dump)
3929 ENFN->output_dump(ENDT); 3939 {
3940 Efl_Canvas_Output *output;
3941 Eina_List *l;
3942
3943 EINA_LIST_FOREACH(evas->outputs, l, output)
3944 ENFN->output_dump(output);
3945 }
3930 3946
3931#define GC_ALL(Cow) \ 3947#define GC_ALL(Cow) \
3932 if (Cow) while (eina_cow_gc(Cow)) 3948 if (Cow) while (eina_cow_gc(Cow))
@@ -3938,8 +3954,14 @@ _evas_canvas_render_dump(Eo *eo_e, Evas_Public_Data *evas)
3938 3954
3939 evas_fonts_zero_pressure(eo_e); 3955 evas_fonts_zero_pressure(eo_e);
3940 3956
3941 if (ENFN && ENFN->output_idle_flush && ENDT) 3957 if (ENFN && ENFN->output_idle_flush)
3942 ENFN->output_idle_flush(ENDT); 3958 {
3959 Efl_Canvas_Output *output;
3960 Eina_List *l;
3961
3962 EINA_LIST_FOREACH(evas->outputs, l, output)
3963 ENFN->output_idle_flush(output);
3964 }
3943 3965
3944 eina_inarray_flush(&evas->active_objects); 3966 eina_inarray_flush(&evas->active_objects);
3945 OBJS_ARRAY_FLUSH(&evas->render_objects); 3967 OBJS_ARRAY_FLUSH(&evas->render_objects);
diff --git a/src/lib/evas/filters/evas_filter.c b/src/lib/evas/filters/evas_filter.c
index 08ad0b7..b482740 100644
--- a/src/lib/evas/filters/evas_filter.c
+++ b/src/lib/evas/filters/evas_filter.c
@@ -89,8 +89,8 @@ evas_filter_context_clear(Evas_Filter_Context *ctx, Eina_Bool keep_buffers)
89 89
90 if (!ctx) return; 90 if (!ctx) return;
91 91
92 if (ctx->target.surface) ENFN->image_free(ENDT, ctx->target.surface); 92 if (ctx->target.surface) ENFN->image_free(ENC, ctx->target.surface);
93 if (ctx->target.mask) ENFN->image_free(ENDT, ctx->target.mask); 93 if (ctx->target.mask) ENFN->image_free(ENC, ctx->target.mask);
94 ctx->target.surface = NULL; 94 ctx->target.surface = NULL;
95 ctx->target.mask = NULL; 95 ctx->target.mask = NULL;
96 96
@@ -163,7 +163,7 @@ evas_filter_context_proxy_render_all(Evas_Filter_Context *ctx, Eo *eo_obj,
163 } 163 }
164 } 164 }
165 XDBG("Source #%d '%s' has dimensions %dx%d", fb->id, fb->source_name, fb->w, fb->h); 165 XDBG("Source #%d '%s' has dimensions %dx%d", fb->id, fb->source_name, fb->w, fb->h);
166 if (!fb->buffer) fb->buffer = ENFN->ector_buffer_wrap(ENDT, obj->layer->evas->evas, source->proxy->surface); 166 if (!fb->buffer) fb->buffer = ENFN->ector_buffer_wrap(ENC, obj->layer->evas->evas, source->proxy->surface);
167 fb->alpha_only = EINA_FALSE; 167 fb->alpha_only = EINA_FALSE;
168 } 168 }
169} 169}
@@ -268,7 +268,7 @@ _ector_buffer_create(Evas_Filter_Buffer const *fb, Eina_Bool render, Eina_Bool d
268 if (draw) flags |= ECTOR_BUFFER_FLAG_DRAWABLE; 268 if (draw) flags |= ECTOR_BUFFER_FLAG_DRAWABLE;
269 if (fb->alpha_only) cspace = EFL_GFX_COLORSPACE_GRY8; 269 if (fb->alpha_only) cspace = EFL_GFX_COLORSPACE_GRY8;
270 270
271 return fb->ENFN->ector_buffer_new(fb->ENDT, fb->ctx->evas->evas, 271 return fb->ENFN->ector_buffer_new(FB_ENC, fb->ctx->evas->evas,
272 fb->w, fb->h, cspace, flags); 272 fb->w, fb->h, cspace, flags);
273} 273}
274 274
@@ -576,7 +576,7 @@ evas_filter_buffer_backing_set(Evas_Filter_Context *ctx, int bufid,
576 576
577 if (fb->is_render) goto end; 577 if (fb->is_render) goto end;
578 578
579 buffer = ENFN->ector_buffer_wrap(ENDT, ctx->evas->evas, engine_buffer); 579 buffer = ENFN->ector_buffer_wrap(ENC, ctx->evas->evas, engine_buffer);
580 ret = EINA_TRUE; 580 ret = EINA_TRUE;
581 581
582end: 582end:
@@ -860,7 +860,7 @@ _blur_support_gl(Evas_Filter_Context *ctx, Evas_Filter_Buffer *in, Evas_Filter_B
860 cmd.blur.type = EVAS_FILTER_BLUR_GAUSSIAN; 860 cmd.blur.type = EVAS_FILTER_BLUR_GAUSSIAN;
861 cmd.blur.dx = 5; 861 cmd.blur.dx = 5;
862 862
863 return cmd.ENFN->gfx_filter_supports(cmd.ENDT, &cmd) == EVAS_FILTER_SUPPORT_GL; 863 return cmd.ENFN->gfx_filter_supports(_evas_engine_context(cmd.ctx->evas), &cmd) == EVAS_FILTER_SUPPORT_GL;
864} 864}
865 865
866Evas_Filter_Command * 866Evas_Filter_Command *
@@ -1542,7 +1542,7 @@ evas_filter_target_set(Evas_Filter_Context *ctx, void *draw_context,
1542 1542
1543 EINA_SAFETY_ON_NULL_RETURN_VAL(ctx, EINA_FALSE); 1543 EINA_SAFETY_ON_NULL_RETURN_VAL(ctx, EINA_FALSE);
1544 1544
1545 ctx->target.surface = ENFN->image_ref(ENDT, surface); 1545 ctx->target.surface = ENFN->image_ref(ENC, surface);
1546 ctx->target.x = x; 1546 ctx->target.x = x;
1547 ctx->target.y = y; 1547 ctx->target.y = y;
1548 ctx->target.clip_use = ENFN->context_clip_get 1548 ctx->target.clip_use = ENFN->context_clip_get
@@ -1568,7 +1568,7 @@ evas_filter_target_set(Evas_Filter_Context *ctx, void *draw_context,
1568 ENFN->context_clip_image_get 1568 ENFN->context_clip_image_get
1569 (ENDT, draw_context, &mask, &ctx->target.mask_x, &ctx->target.mask_y); 1569 (ENDT, draw_context, &mask, &ctx->target.mask_x, &ctx->target.mask_y);
1570 if (ctx->target.mask) 1570 if (ctx->target.mask)
1571 ctx->evas->engine.func->image_free(ctx->evas->engine.data.output, ctx->target.mask); 1571 ctx->evas->engine.func->image_free(_evas_engine_context(ctx->evas), ctx->target.mask);
1572 ctx->target.mask = mask; // FIXME: why no ref??? 1572 ctx->target.mask = mask; // FIXME: why no ref???
1573 1573
1574 return EINA_TRUE; 1574 return EINA_TRUE;
@@ -1630,13 +1630,13 @@ _filter_target_render(Evas_Filter_Context *ctx)
1630 ENFN->context_free(ENDT, drawctx); 1630 ENFN->context_free(ENDT, drawctx);
1631 evas_ector_buffer_engine_image_release(src->buffer, image); 1631 evas_ector_buffer_engine_image_release(src->buffer, image);
1632 1632
1633 ENFN->image_free(ENDT, surface); 1633 ENFN->image_free(ENC, surface);
1634 ctx->target.surface = NULL; 1634 ctx->target.surface = NULL;
1635 1635
1636 return EINA_TRUE; 1636 return EINA_TRUE;
1637 1637
1638fail: 1638fail:
1639 ENFN->image_free(ENDT, surface); 1639 ENFN->image_free(ENC, surface);
1640 ctx->target.surface = NULL; 1640 ctx->target.surface = NULL;
1641 1641
1642 ERR("Failed to render filter to target canvas!"); 1642 ERR("Failed to render filter to target canvas!");
@@ -1661,7 +1661,7 @@ evas_filter_font_draw(Evas_Filter_Context *ctx, void *draw_context, int bufid,
1661 EINA_SAFETY_ON_NULL_RETURN_VAL(surface, EINA_FALSE); 1661 EINA_SAFETY_ON_NULL_RETURN_VAL(surface, EINA_FALSE);
1662 1662
1663 // Copied from evas_font_draw_async_check 1663 // Copied from evas_font_draw_async_check
1664 async_unref = ENFN->font_draw(ENDT, draw_context, surface, 1664 async_unref = ENFN->font_draw(ENC, draw_context, surface,
1665 font, x, y, fb->w, fb->h, fb->w, fb->h, 1665 font, x, y, fb->w, fb->h, fb->w, fb->h,
1666 text_props, do_async); 1666 text_props, do_async);
1667 if (do_async && async_unref) 1667 if (do_async && async_unref)
@@ -1782,14 +1782,14 @@ _filter_command_run(Evas_Filter_Command *cmd)
1782 return EINA_FALSE; 1782 return EINA_FALSE;
1783 } 1783 }
1784 1784
1785 support = cmd->ENFN->gfx_filter_supports(cmd->ENDT, cmd); 1785 support = cmd->ENFN->gfx_filter_supports(CMD_ENC, cmd);
1786 if (support == EVAS_FILTER_SUPPORT_NONE) 1786 if (support == EVAS_FILTER_SUPPORT_NONE)
1787 { 1787 {
1788 ERR("No function to process this filter (mode %d)", cmd->mode); 1788 ERR("No function to process this filter (mode %d)", cmd->mode);
1789 return EINA_FALSE; 1789 return EINA_FALSE;
1790 } 1790 }
1791 1791
1792 return cmd->ENFN->gfx_filter_process(cmd->ENDT, cmd); 1792 return cmd->ENFN->gfx_filter_process(CMD_ENC, cmd);
1793} 1793}
1794 1794
1795static Eina_Bool 1795static Eina_Bool
diff --git a/src/lib/evas/filters/evas_filter_private.h b/src/lib/evas/filters/evas_filter_private.h
index 8ced3d8..f6faea3 100644
--- a/src/lib/evas/filters/evas_filter_private.h
+++ b/src/lib/evas/filters/evas_filter_private.h
@@ -75,8 +75,16 @@ extern int _evas_filter_log_dom;
75#endif 75#endif
76 76
77// Helpers 77// Helpers
78#undef ENFN
79#undef ENDT
80#undef ENC
78#define ENFN ctx->evas->engine.func 81#define ENFN ctx->evas->engine.func
79#define ENDT ctx->evas->engine.data.output 82#define ENDT _evas_default_output_get(ctx->evas)
83#define ENC _evas_engine_context(ctx->evas)
84
85#define CMD_ENDT _evas_default_output_get(cmd->ctx->evas)
86#define CMD_ENC _evas_engine_context(cmd->ctx->evas)
87#define FB_ENC _evas_engine_context(fb->ctx->evas)
80 88
81#define BUFFERS_LOCK() do { if (cmd->input) cmd->input->locked = 1; if (cmd->output) cmd->output->locked = 1; if (cmd->mask) cmd->mask->locked = 1; } while (0) 89#define BUFFERS_LOCK() do { if (cmd->input) cmd->input->locked = 1; if (cmd->output) cmd->output->locked = 1; if (cmd->mask) cmd->mask->locked = 1; } while (0)
82#define BUFFERS_UNLOCK() do { if (cmd->input) cmd->input->locked = 0; if (cmd->output) cmd->output->locked = 0; if (cmd->mask) cmd->mask->locked = 0; } while (0) 90#define BUFFERS_UNLOCK() do { if (cmd->input) cmd->input->locked = 0; if (cmd->output) cmd->output->locked = 0; if (cmd->mask) cmd->mask->locked = 0; } while (0)
diff --git a/src/lib/evas/include/evas_inline.x b/src/lib/evas/include/evas_inline.x
index 37cf44d..d2b6a70 100644
--- a/src/lib/evas/include/evas_inline.x
+++ b/src/lib/evas/include/evas_inline.x
@@ -339,6 +339,28 @@ _evas_eina_rectangle_inside(const Eina_Rectangle *big, const Eina_Rectangle *sma
339 return EINA_FALSE; 339 return EINA_FALSE;
340} 340}
341 341
342// Temporary until we have multi output support
343static inline void *
344_evas_default_output_get(Evas_Public_Data *e)
345{
346 Efl_Canvas_Output *output;
347
348 output = eina_list_data_get(e->outputs);
349 return output->output;
350}
351
352static inline void *
353_evas_engine_context(Evas_Public_Data *e)
354{
355 // Need to split between engine context
356 // and output context, use one for now.
357 Efl_Canvas_Output *output;
358
359 if (!e->outputs) return NULL;
360 output = eina_list_data_get(e->outputs);
361 return output->output;
362}
363
342#define _EVAS_COLOR_CLAMP(x, y) do { \ 364#define _EVAS_COLOR_CLAMP(x, y) do { \
343 if (x > y) { x = y; bad = 1; } \ 365 if (x > y) { x = y; bad = 1; } \
344 if (x < 0) { x = 0; bad = 1; } } while (0) 366 if (x < 0) { x = 0; bad = 1; } } while (0)
diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h
index 92e149e..3c7ec16 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -46,6 +46,11 @@
46# endif 46# endif
47#endif /* ! _WIN32 */ 47#endif /* ! _WIN32 */
48 48
49/* save typing */
50#define ENFN obj->layer->evas->engine.func
51#define ENDT _evas_default_output_get(obj->layer->evas)
52#define ENC _evas_engine_context(obj->layer->evas)
53
49#include "canvas/evas_text.eo.h" 54#include "canvas/evas_text.eo.h"
50#include "canvas/evas_textgrid.eo.h" 55#include "canvas/evas_textgrid.eo.h"
51#include "canvas/evas_line.eo.h" 56#include "canvas/evas_line.eo.h"
@@ -873,13 +878,6 @@ struct _Evas_Public_Data
873 struct { 878 struct {
874 Evas_Module *module; 879 Evas_Module *module;
875 Evas_Func *func; 880 Evas_Func *func;
876 Ector_Surface *ector;
877 struct {
878 void *output;
879 } data;
880
881 void *info;
882 int info_magic;
883 } engine; 881 } engine;
884 882
885 struct { 883 struct {
@@ -1291,8 +1289,12 @@ struct _Efl_Canvas_Output
1291{ 1289{
1292 Eo *canvas; 1290 Eo *canvas;
1293 1291
1292 Ector_Surface *ector;
1293
1294 void *info, *output; 1294 void *info, *output;
1295 Evas_Coord x, y, w, h; 1295 Evas_Coord x, y, w, h;
1296
1297 int info_magic;
1296}; 1298};
1297 1299
1298struct _Evas_Object_Func 1300struct _Evas_Object_Func
@@ -1558,7 +1560,7 @@ struct _Evas_Func
1558 void (*texture_image_set) (void *data, void *texture, void *image); 1560 void (*texture_image_set) (void *data, void *texture, void *image);
1559 void *(*texture_image_get) (void *data, void *texture); 1561 void *(*texture_image_get) (void *data, void *texture);
1560 1562
1561 Ector_Surface *(*ector_create) (void *data); 1563 Ector_Surface *(*ector_create) (void *engine, void *output);
1562 void (*ector_destroy) (void *data, Ector_Surface *surface); 1564 void (*ector_destroy) (void *data, Ector_Surface *surface);
1563 Ector_Buffer *(*ector_buffer_wrap) (void *data, Evas *e, void *engine_image); 1565 Ector_Buffer *(*ector_buffer_wrap) (void *data, Evas *e, void *engine_image);
1564 Ector_Buffer *(*ector_buffer_new) (void *data, Evas *e, int width, int height, Efl_Gfx_Colorspace cspace, Ector_Buffer_Flag flags); 1566 Ector_Buffer *(*ector_buffer_new) (void *data, Evas *e, int width, int height, Efl_Gfx_Colorspace cspace, Ector_Buffer_Flag flags);
@@ -1890,7 +1892,7 @@ void evas_filter_init(void);
1890void evas_filter_shutdown(void); 1892void evas_filter_shutdown(void);
1891 1893
1892/* Ector */ 1894/* Ector */
1893Ector_Surface *evas_ector_get(Evas_Public_Data *evas); 1895Ector_Surface *evas_ector_get(Evas_Public_Data *evas, void *output);
1894 1896
1895/* Temporary save/load functions */ 1897/* Temporary save/load functions */
1896void evas_common_load_model_from_file(Evas_Canvas3D_Mesh *model, const char *file); 1898void evas_common_load_model_from_file(Evas_Canvas3D_Mesh *model, const char *file);