feature: E_FIRST_FRAME env variable
requested by cedric for profiling, works just like similar elm variable
This commit is contained in:
parent
4b5127ad47
commit
98f1a9f036
|
@ -308,6 +308,9 @@ extern EAPI Eina_Bool e_nopause;
|
||||||
extern EAPI Eina_Bool e_precache_end;
|
extern EAPI Eina_Bool e_precache_end;
|
||||||
extern EAPI Eina_Bool x_fatal;
|
extern EAPI Eina_Bool x_fatal;
|
||||||
|
|
||||||
|
extern EINTERN const char *e_first_frame;
|
||||||
|
extern EINTERN double e_first_frame_start_time;
|
||||||
|
|
||||||
EAPI void e_alert_composite_win(Ecore_X_Window root, Ecore_X_Window win);
|
EAPI void e_alert_composite_win(Ecore_X_Window root, Ecore_X_Window win);
|
||||||
|
|
||||||
//#define SMARTERR(args...) abort()
|
//#define SMARTERR(args...) abort()
|
||||||
|
|
|
@ -11,6 +11,24 @@ _e_comp_canvas_event_compositor_resize_free(void *data EINA_UNUSED, void *event)
|
||||||
|
|
||||||
///////////////////////////////////
|
///////////////////////////////////
|
||||||
|
|
||||||
|
static void
|
||||||
|
_e_comp_canvas_cb_first_frame(void *data, Evas *e, void *event_info EINA_UNUSED)
|
||||||
|
{
|
||||||
|
E_Comp *c = data;
|
||||||
|
double now = ecore_time_get();
|
||||||
|
|
||||||
|
switch (e_first_frame[0])
|
||||||
|
{
|
||||||
|
case 'A': abort();
|
||||||
|
case 'E':
|
||||||
|
case 'D': exit(-1);
|
||||||
|
case 'T': fprintf(stderr, "Startup time: '%f' - '%f' = '%f'\n", now, e_first_frame_start_time, now - e_first_frame_start_time);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
evas_event_callback_del_full(e, EVAS_CALLBACK_RENDER_POST, _e_comp_canvas_cb_first_frame, c);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_e_comp_canvas_render_post(void *data, Evas *e EINA_UNUSED, void *event_info EINA_UNUSED)
|
_e_comp_canvas_render_post(void *data, Evas *e EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||||
{
|
{
|
||||||
|
@ -85,6 +103,9 @@ e_comp_canvas_init(E_Comp *c)
|
||||||
unsigned int layer;
|
unsigned int layer;
|
||||||
|
|
||||||
c->evas = ecore_evas_get(c->ee);
|
c->evas = ecore_evas_get(c->ee);
|
||||||
|
|
||||||
|
if (e_first_frame)
|
||||||
|
evas_event_callback_add(c->evas, EVAS_CALLBACK_RENDER_POST, _e_comp_canvas_cb_first_frame, c);
|
||||||
ecore_evas_data_set(c->ee, "comp", c);
|
ecore_evas_data_set(c->ee, "comp", c);
|
||||||
o = evas_object_rectangle_add(c->evas);
|
o = evas_object_rectangle_add(c->evas);
|
||||||
c->bg_blank_object = o;
|
c->bg_blank_object = o;
|
||||||
|
|
|
@ -111,6 +111,8 @@ EAPI Eina_Bool starting = EINA_TRUE;
|
||||||
EAPI Eina_Bool stopping = EINA_FALSE;
|
EAPI Eina_Bool stopping = EINA_FALSE;
|
||||||
EAPI Eina_Bool restart = EINA_FALSE;
|
EAPI Eina_Bool restart = EINA_FALSE;
|
||||||
EAPI Eina_Bool e_nopause = EINA_FALSE;
|
EAPI Eina_Bool e_nopause = EINA_FALSE;
|
||||||
|
EINTERN const char *e_first_frame = NULL;
|
||||||
|
EINTERN double e_first_frame_start_time = -1;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_xdg_data_dirs_augment(void)
|
_xdg_data_dirs_augment(void)
|
||||||
|
@ -168,7 +170,6 @@ main(int argc, char **argv)
|
||||||
#ifdef TS_DO
|
#ifdef TS_DO
|
||||||
t0 = t1 = t2 = ecore_time_unix_get();
|
t0 = t1 = t2 = ecore_time_unix_get();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
TS("Begin Startup");
|
TS("Begin Startup");
|
||||||
|
|
||||||
/* trap deadly bug signals and allow some form of sane recovery */
|
/* trap deadly bug signals and allow some form of sane recovery */
|
||||||
|
@ -288,6 +289,12 @@ main(int argc, char **argv)
|
||||||
TS("Ecore Init Done");
|
TS("Ecore Init Done");
|
||||||
_e_main_shutdown_push(ecore_shutdown);
|
_e_main_shutdown_push(ecore_shutdown);
|
||||||
|
|
||||||
|
e_first_frame = getenv("E_FIRST_FRAME");
|
||||||
|
if (e_first_frame && (!e_first_frame[0]))
|
||||||
|
e_first_frame = NULL;
|
||||||
|
else
|
||||||
|
e_first_frame_start_time = ecore_time_get();
|
||||||
|
|
||||||
TS("EIO Init");
|
TS("EIO Init");
|
||||||
if (!eio_init())
|
if (!eio_init())
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue