aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/evas/canvas/evas_out.c
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2017-04-24 14:53:52 -0700
committerCedric BAIL <cedric@osg.samsung.com>2017-04-24 15:10:48 -0700
commitbc43eeba009467154ecbb2394fdbc7a08940f592 (patch)
tree5ee133de6a542da061e3150df0e317484ddc1263 /src/lib/evas/canvas/evas_out.c
parentevas: evas_render actually need to access that structure. (diff)
downloadefl-bc43eeba009467154ecbb2394fdbc7a08940f592.tar.gz
evas: start setting up output independently of the engine.
Diffstat (limited to 'src/lib/evas/canvas/evas_out.c')
-rw-r--r--src/lib/evas/canvas/evas_out.c52
1 files changed, 46 insertions, 6 deletions
diff --git a/src/lib/evas/canvas/evas_out.c b/src/lib/evas/canvas/evas_out.c
index 50e9cb0ff4..9a147d6553 100644
--- a/src/lib/evas/canvas/evas_out.c
+++ b/src/lib/evas/canvas/evas_out.c
@@ -36,6 +36,13 @@ efl_canvas_output_add(Evas *canvas)
// Track this output in Evas
e->outputs = eina_list_append(e->outputs, r);
+ // The engine is already initialized, use it
+ // right away to setup the info structure
+ if (e->engine.func->info)
+ {
+ r->info = e->engine.func->info(canvas);
+ }
+
return r;
}
@@ -49,10 +56,13 @@ efl_canvas_output_del(Efl_Canvas_Output *output)
e = _efl_canvas_output_async_block(output);
if (!e) goto on_error;
- // XXX: need to free output and context one they get allocated one day
- // e->engine.func->context_free(eo_dat->output, eo_dat->context);
- // e->engine.func->output_free(eo_dat->output);
- e->engine.func->info_free(output->canvas, output->info);
+ if (e->engine.func)
+ {
+ e->engine.func->ector_destroy(output->output,
+ output->ector);
+ e->engine.func->output_free(output->output);
+ e->engine.func->info_free(output->canvas, output->info);
+ }
e->outputs = eina_list_remove(e->outputs, output);
efl_wref_del(output->canvas, &output->canvas);
@@ -98,15 +108,45 @@ efl_canvas_output_engine_info_set(Efl_Canvas_Output *output,
e = _efl_canvas_output_async_block(output);
if (!e) return EINA_FALSE;
if (output->info != info) return EINA_FALSE;
+ if (info->magic != output->info_magic) return EINA_FALSE;
- // XXX: handle setting of engine info here
+ if (output->output)
+ {
+ if (e->engine.func->update)
+ {
+ e->engine.func->update(output->output, info, e->output.w, e->output.h);
+ }
+ else
+ {
+ // For engine who do not provide an update function
+ e->engine.func->output_free(output->output);
+
+ goto setup;
+ }
+ }
+ else
+ {
+ if (!e->common_init)
+ {
+ e->common_init = 1;
+ evas_common_init();
+ }
+
+ setup:
+ output->output = e->engine.func->setup(info, e->output.w, e->output.h);
+ }
- return EINA_TRUE;
+ return !!output->output;
}
EAPI Evas_Engine_Info*
efl_canvas_output_engine_info_get(Efl_Canvas_Output *output)
{
+ Evas_Engine_Info *info = output->info;
+
+ if (!info) return NULL;
+
+ output->info_magic = info->magic;
return output->info;
}