EOLIAN static void _evas_out_view_set(Eo *eo_e, Evas_Out_Data *eo_dat, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) { Eo *eo_parent = NULL; Evas_Public_Data *e; eo_do(eo_e, eo_parent = eo_parent_get()); e = eo_data_scope_get(eo_parent, EVAS_CANVAS_CLASS); evas_canvas_async_block(e); eo_dat->x = x; eo_dat->y = y; eo_dat->w = w; eo_dat->h = h; // XXX: tell engine about any output size etc. changes // XXX: tell evas to add damage if viewport loc/size changed }
Eina_Bool _evas_render2(Eo *eo_e, Evas_Public_Data *e) { double t; // if nothing changed at all since last render - skip this frame if (!e->changed) return EINA_FALSE; // we are still rendering while being asked to render - skip this if (e->rendering) return EINA_FALSE; // mark this canvas as a render2 canvas - not normal render e->render2 = EINA_TRUE; // check viewport size is same as output - not allowed to differ if ((e->output.w != e->viewport.w) || (e->output.h != e->viewport.h)) ERR("viewport size != output size!"); // if render threads not initted - init them - maybe move this later? _evas_render2_th_init(); printf("-------------------------------------------- %p %p\n", eo_e, e); // wait for any previous render pass to do its thing t = get_time(); evas_canvas_async_block(e); t = get_time() - t; printf("T: block wait: "); out_time(t); // we have to calculate smare objects before render so do that here t = get_time(); evas_call_smarts_calculate(eo_e); t = get_time() - t; printf("T: smart calc: "); out_time(t); // call canvas callbacks saying we are in the pre-render state _always_call(eo_e, EVAS_CALLBACK_RENDER_PRE, NULL); // bock any susbequent rneders from doing this walk eina_lock_take(&(e->lock_objects)); // gain a reference efl_ref(eo_e); // put into the "i'm rendering" pool e->rendering = EINA_TRUE; _rendering = eina_list_append(_rendering, eo_e); // call our flush pre at this point before rendering begins... _always_call(eo_e, EVAS_CALLBACK_RENDER_FLUSH_PRE, NULL); // tell main render thread to wake up and begin processing this canvas _evas_render2_th_main_msg_render(eo_e, e); return EINA_FALSE; }
EOLIAN static void _evas_out_eo_base_destructor(Eo *eo_obj, Evas_Out_Data *eo_dat) { Eo *eo_parent = NULL; Evas_Public_Data *e; eo_do(eo_obj, eo_parent = eo_parent_get()); e = eo_data_scope_get(eo_parent, EVAS_CANVAS_CLASS); evas_canvas_async_block(e); if (!e) return; // 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(eo_parent, eo_dat->info); e->outputs = eina_list_remove(e->outputs, eo_obj); eo_do_super(eo_obj, MY_CLASS, eo_destructor()); }
EOLIAN static Eo * _evas_out_eo_base_constructor(Eo *eo_obj, Evas_Out_Data *eo_dat) { Eo *eo_parent = NULL; Evas_Public_Data *e; eo_do(eo_obj, eo_parent = eo_parent_get()); e = eo_data_scope_get(eo_parent, EVAS_CANVAS_CLASS); evas_canvas_async_block(e); eo_obj = eo_do_super_ret(eo_obj, MY_CLASS, eo_obj, eo_constructor()); if (!e) return NULL; e->outputs = eina_list_append(e->outputs, eo_obj); if (e->engine.func->info) eo_dat->info = e->engine.func->info(eo_parent); // XXX: context and output are currently held in the core engine and are // allocated by engine specific internal code. this all needs a new engine // api to make it work return eo_obj; }