fps debug - slim code a bit and order events so they do go up and right

This commit is contained in:
Carsten Haitzler 2021-05-16 18:36:30 +01:00
parent e6b544a7ef
commit 96e7e42fbb
2 changed files with 54 additions and 66 deletions

View File

@ -427,11 +427,11 @@ e_comp_frame_event_add(int info[4], double t)
E_API void
e_comp_client_frame_add(Evas_Object *obj EINA_UNUSED)
{
int info[4] = { 0, 0, 0, 0 };
double t = ecore_time_get();
info[0] = E_COMP_FRAME_EVENT_CLIENT_DAMAGE;
e_comp_frame_event_add(info, t);
if (conf->fps_show)
{
int info[4] = { E_COMP_FRAME_EVENT_CLIENT_DAMAGE, 0, 0, 0 };
e_comp_frame_event_add(info, ecore_time_get());
}
}
static inline void
@ -604,13 +604,13 @@ e_comp_fps_update(void)
else if (info0 == E_COMP_FRAME_EVENT_RENDER_BEGIN)
_e_comp_fps_draw_point(pix, pixstride, pixw, 3, 0xffff4433, px);
else if (info0 == E_COMP_FRAME_EVENT_IDLE_ENTER)
_e_comp_fps_draw_point(pix, pixstride, pixw, 4, 0xff994499, px);
else if (info0 == E_COMP_FRAME_EVENT_IDLE_EXIT)
_e_comp_fps_draw_point(pix, pixstride, pixw, 5, 0xffff88ff, px);
_e_comp_fps_draw_point(pix, pixstride, pixw, 4, 0xffff88ff, px);
else if (info0 == E_COMP_FRAME_EVENT_HANDLE_DAMAGE)
_e_comp_fps_draw_point(pix, pixstride, pixw, 6, 0xff44ff22, px);
_e_comp_fps_draw_point(pix, pixstride, pixw, 5, 0xff44ff22, px);
else if (info0 == E_COMP_FRAME_EVENT_CLIENT_DAMAGE)
_e_comp_fps_draw_point(pix, pixstride, pixw, 7, 0xff4466ff, px);
_e_comp_fps_draw_point(pix, pixstride, pixw, 6, 0xff4466ff, px);
else if (info0 == E_COMP_FRAME_EVENT_IDLE_EXIT)
_e_comp_fps_draw_point(pix, pixstride, pixw, 7, 0xff994499, px);
}
for (t = 0.0; t < 10.0; t += (1.0 / 60.0))
{
@ -662,37 +662,10 @@ _e_comp_cb_update(void)
_e_comp_fps_update();
if (conf->fps_show)
{
double t = ecore_loop_time_get();
int info[4] = { 0, 0, 0, 0 };
info[0] = E_COMP_FRAME_EVENT_HANDLE_DAMAGE;
e_comp_frame_event_add(info, t);
int info[4] = { E_COMP_FRAME_EVENT_HANDLE_DAMAGE, 0, 0, 0 };
e_comp_frame_event_add(info, ecore_loop_time_get());
e_comp_fps_update();
}
/*
if (doframeinfo == -1)
{
doframeinfo = 0;
if (getenv("DFI")) doframeinfo = 1;
}
if (doframeinfo)
{
static double t0 = 0.0;
double td, t;
t = ecore_time_get();
td = t - t0;
if (td > 0.0)
{
int fps, i;
fps = 1.0 / td;
for (i = 0; i < fps; i+= 2) putchar('=');
printf(" : %3.3f", 1.0 / td);
}
t0 = t;
}
*/
nocomp:
ec = _e_comp_fullscreen_check();
if (ec)

View File

@ -72,37 +72,45 @@ _e_comp_canvas_render_post_job(void *data EINA_UNUSED)
static void
_e_comp_canvas_render_track_pre(void *data EINA_UNUSED, Evas *e EINA_UNUSED, void *event_info EINA_UNUSED)
{
int info[4] = { 0, 0, 0, 0 };
info[0] = E_COMP_FRAME_EVENT_RENDER_BEGIN;
e_comp_frame_event_add(info, ecore_time_get());
E_Comp_Config *conf = e_comp_config_get();
if (conf->fps_show)
{
int info[4] = { E_COMP_FRAME_EVENT_RENDER_BEGIN, 0, 0, 0 };
e_comp_frame_event_add(info, ecore_time_get());
}
}
static void
_e_comp_canvas_render_track_post(void *data EINA_UNUSED, Evas *e EINA_UNUSED, void *event_info EINA_UNUSED)
{
int info[4] = { 0, 0, 0, 0 };
info[0] = E_COMP_FRAME_EVENT_RENDER_END;
e_comp_frame_event_add(info, ecore_time_get());
E_Comp_Config *conf = e_comp_config_get();
if (conf->fps_show)
{
int info[4] = { E_COMP_FRAME_EVENT_RENDER_END, 0, 0, 0 };
e_comp_frame_event_add(info, ecore_time_get());
}
}
static void
_e_comp_canvas_render_track_flush_pre(void *data EINA_UNUSED, Evas *e EINA_UNUSED, void *event_info EINA_UNUSED)
{
int info[4] = { 0, 0, 0, 0 };
info[0] = E_COMP_FRAME_EVENT_RENDER2_BEGIN;
e_comp_frame_event_add(info, ecore_time_get());
E_Comp_Config *conf = e_comp_config_get();
if (conf->fps_show)
{
int info[4] = { E_COMP_FRAME_EVENT_RENDER2_BEGIN, 0, 0, 0 };
e_comp_frame_event_add(info, ecore_time_get());
}
}
static void
_e_comp_canvas_render_track_flush_post(void *data EINA_UNUSED, Evas *e EINA_UNUSED, void *event_info EINA_UNUSED)
{
int info[4] = { 0, 0, 0, 0 };
info[0] = E_COMP_FRAME_EVENT_RENDER2_END;
e_comp_frame_event_add(info, ecore_time_get());
E_Comp_Config *conf = e_comp_config_get();
if (conf->fps_show)
{
int info[4] = { E_COMP_FRAME_EVENT_RENDER2_END, 0, 0, 0 };
e_comp_frame_event_add(info, ecore_time_get());
}
}
static void
@ -455,14 +463,15 @@ _e_comp_canvas_cb_zone_sort(const void *data1, const void *data2)
static void
_e_comp_canvas_prerender(void *data EINA_UNUSED, Evas *e EINA_UNUSED, void *event_info EINA_UNUSED)
{
int info[4] = { 0, 0, 0, 0 };
double t = ecore_time_get();
E_Comp_Cb cb;
Eina_List *l;
E_Comp_Config *conf = e_comp_config_get();
info[0] = E_COMP_FRAME_EVENT_RENDER_BEGIN;
e_comp_frame_event_add(info, t);
if (conf->fps_show)
{
int info[4] = { E_COMP_FRAME_EVENT_RENDER_BEGIN, 0, 0, 0 };
e_comp_frame_event_add(info, ecore_time_get());
}
e_comp->rendering = EINA_TRUE;
@ -479,18 +488,24 @@ _e_comp_canvas_prerender(void *data EINA_UNUSED, Evas *e EINA_UNUSED, void *even
static Eina_Bool
_e_comp_canvas_cb_idle_enterer(void *data EINA_UNUSED)
{
int info[4] = { 0, 0, 0, 0 };
info[0] = E_COMP_FRAME_EVENT_IDLE_ENTER;
e_comp_frame_event_add(info, ecore_time_get());
E_Comp_Config *conf = e_comp_config_get();
if (conf->fps_show)
{
int info[4] = { E_COMP_FRAME_EVENT_IDLE_ENTER, 0, 0, 0 };
e_comp_frame_event_add(info, ecore_time_get());
}
return EINA_TRUE;
}
static Eina_Bool
_e_comp_canvas_cb_idle_exiter(void *data EINA_UNUSED)
{
int info[4] = { 0, 0, 0, 0 };
info[0] = E_COMP_FRAME_EVENT_IDLE_EXIT;
e_comp_frame_event_add(info, ecore_time_get());
E_Comp_Config *conf = e_comp_config_get();
if (conf->fps_show)
{
int info[4] = { E_COMP_FRAME_EVENT_IDLE_EXIT, 0, 0, 0 };
e_comp_frame_event_add(info, ecore_time_get());
}
return EINA_TRUE;
}
@ -521,7 +536,7 @@ e_comp_canvas_init(int w, int h)
if (!inited)
{
inited = 1;
ecore_idle_enterer_add(_e_comp_canvas_cb_idle_enterer, NULL);
ecore_idle_enterer_before_add(_e_comp_canvas_cb_idle_enterer, NULL);
ecore_idle_exiter_add(_e_comp_canvas_cb_idle_exiter, NULL);
}
evas_event_callback_add(e_comp->evas, EVAS_CALLBACK_RENDER_PRE, _e_comp_canvas_render_track_pre, NULL);