evas: do not use default output or any other during render pre.

This commit is contained in:
Cedric BAIL 2017-08-25 10:52:10 -07:00
parent 68b846c1f4
commit a0c58276c3
6 changed files with 14 additions and 22 deletions

View File

@ -378,6 +378,8 @@ next_zombie:
evas_event_callback_all_del(eo_e);
evas_event_callback_cleanup(eo_e);
/* Ector surface may require an existing output to finish its job */
e->engine.func->ector_destroy(_evas_engine_context(e), e->ector);
/* cleanup engine backend */
EINA_LIST_FREE(e->outputs, evo) efl_canvas_output_del(evo);
e->engine.func->engine_free(e->backend);
@ -842,19 +844,11 @@ _evas_canvas_efl_loop_user_loop_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e EI
}
Ector_Surface *
evas_ector_get(Evas_Public_Data *e, void *output)
evas_ector_get(Evas_Public_Data *e)
{
Efl_Canvas_Output *r;
Eina_List *l;
EINA_LIST_FOREACH(e->outputs, l, r)
if (r->output == output)
{
if (!r->ector)
r->ector = e->engine.func->ector_create(_evas_engine_context(e), output);
return r->ector;
}
return NULL;
if (!e->ector)
e->ector = e->engine.func->ector_create(_evas_engine_context(e));
return e->ector;
}
EAPI Evas_BiDi_Direction

View File

@ -178,7 +178,7 @@ evas_object_vg_render(Evas_Object *eo_obj EINA_UNUSED,
int x, int y, Eina_Bool do_async)
{
Evas_VG_Data *vd = type_private_data;
Ector_Surface *ector = evas_ector_get(obj->layer->evas, output);
Ector_Surface *ector = evas_ector_get(obj->layer->evas);
// FIXME: Set context (that should affect Ector_Surface) and
// then call Ector_Renderer render from bottom to top. Get the
// Ector_Surface that match the output from Evas engine API.
@ -248,7 +248,7 @@ evas_object_vg_render_pre(Evas_Object *eo_obj,
}
// FIXME: handle damage only on changed renderer.
s = evas_ector_get(obj->layer->evas, _evas_default_output_get(obj->layer->evas));
s = evas_ector_get(obj->layer->evas);
if (vd->root && s)
_evas_vg_render_pre(vd->root, s, NULL);

View File

@ -74,8 +74,6 @@ efl_canvas_output_del(Efl_Canvas_Output *output)
if (e->engine.func)
{
e->engine.func->ector_destroy(_evas_engine_context(e),
output->ector);
e->engine.func->output_free(_evas_engine_context(e),
output->output);
free(output->info);

View File

@ -964,6 +964,7 @@ struct _Evas_Public_Data
Eina_Array *cur_device;
void *backend;
Ector_Surface *ector;
Eina_List *outputs;
Evas_Device *default_seat;
@ -1333,8 +1334,6 @@ struct _Efl_Canvas_Output
{
Eo *canvas;
Ector_Surface *ector;
Evas_Engine_Info *info;
void *output;
@ -1611,7 +1610,7 @@ struct _Evas_Func
void (*texture_image_set) (void *engine, void *texture, void *image);
void *(*texture_image_get) (void *engine, void *texture);
Ector_Surface *(*ector_create) (void *engine, void *output);
Ector_Surface *(*ector_create) (void *engine);
void (*ector_destroy) (void *engine, Ector_Surface *surface);
Ector_Buffer *(*ector_buffer_wrap) (void *engine, Evas *e, void *engine_image);
Ector_Buffer *(*ector_buffer_new) (void *engine, Evas *e, int width, int height, Efl_Gfx_Colorspace cspace, Ector_Buffer_Flag flags);
@ -1951,7 +1950,7 @@ void _efl_gfx_map_shutdown(void);
void _efl_gfx_map_update(Eo *eo_obj);
/* Ector */
Ector_Surface *evas_ector_get(Evas_Public_Data *evas, void *output);
Ector_Surface *evas_ector_get(Evas_Public_Data *evas);
/* Temporary save/load functions */
void evas_common_load_model_from_file(Evas_Canvas3D_Mesh *model, const char *file);

View File

@ -2377,7 +2377,7 @@ static Eina_Bool use_cairo = EINA_FALSE;
static Eina_Bool use_gl = EINA_FALSE;
static Ector_Surface *
eng_ector_create(void *engine EINA_UNUSED, void *output EINA_UNUSED)
eng_ector_create(void *engine EINA_UNUSED)
{
Ector_Surface *ector;
const char *ector_backend;

View File

@ -4316,10 +4316,11 @@ eng_output_idle_flush(void *engine EINA_UNUSED, void *data)
static Eina_Bool use_cairo;
static Ector_Surface *
eng_ector_create(void *engine EINA_UNUSED, void *output EINA_UNUSED)
eng_ector_create(void *engine EINA_UNUSED)
{
Ector_Surface *ector;
const char *ector_backend;
ector_backend = getenv("ECTOR_BACKEND");
efl_domain_current_push(EFL_ID_DOMAIN_SHARED);
if (ector_backend && !strcasecmp(ector_backend, "default"))