From f0bca469a9359cce46905dd0bc9bf32ea4bb7126 Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Fri, 28 Dec 2012 03:24:07 +0000 Subject: [PATCH] expedite: enable benchmarking of async renderer. SVN revision: 81777 --- src/bin/main.c | 13 ++++++++++- src/bin/ui.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++---- src/bin/ui.h | 2 ++ 3 files changed, 68 insertions(+), 5 deletions(-) diff --git a/src/bin/main.c b/src/bin/main.c index 1c83299..02852af 100644 --- a/src/bin/main.c +++ b/src/bin/main.c @@ -1380,7 +1380,18 @@ main(int argc, char **argv) { engine_loop(); ui_loop(); - evas_render(evas); + if (async_render) + { + Eina_Bool ret = EINA_FALSE; + + eo_do(evas, + evas_canvas_sync(), + evas_canvas_render_async(NULL, NULL, &ret)); + } + else + { + evas_render(evas); + } } evas_free(evas); diff --git a/src/bin/ui.c b/src/bin/ui.c index b0063fc..dc11c38 100644 --- a/src/bin/ui.c +++ b/src/bin/ui.c @@ -22,6 +22,8 @@ struct _Menu_Item void (*func) (void); }; +int async_render = 0; + static Evas_Object *o_bg = NULL; static Evas_Object *o_wallpaper = NULL; static Evas_Object *o_title = NULL; @@ -257,12 +259,34 @@ _ui_all(void) { engine_loop(); ui_loop(); - evas_render(evas); + if (async_render) + { + Eina_Bool ret = EINA_FALSE; + + eo_do(evas, + evas_canvas_sync(), + evas_canvas_render_async(NULL, NULL, &ret)); + } + else + { + evas_render(evas); + } } /* This give time to delete the objects of the previous test and make the result of next test more accurate. Draw back, some time is not counted at all. */ - evas_render(evas); + if (async_render) + { + Eina_Bool ret = EINA_FALSE; + + eo_do(evas, + evas_canvas_sync(), + evas_canvas_render_async(NULL, NULL, &ret)); + } + else + { + evas_render(evas); + } t_count++; fps += p_fps; wfps += (p_fps * weights[t_count]); @@ -362,12 +386,34 @@ _ui_num(int n) { ui_loop(); engine_loop(); - evas_render(evas); + if (async_render) + { + Eina_Bool ret = EINA_FALSE; + + eo_do(evas, + evas_canvas_sync(), + evas_canvas_render_async(NULL, NULL, &ret)); + } + else + { + evas_render(evas); + } } /* This give time to delete the objects of the previous test and make the result of next test more accurate. Draw back, some time is not counted at all. */ - evas_render(evas); + if (async_render) + { + Eina_Bool ret = EINA_FALSE; + + eo_do(evas, + evas_canvas_sync(), + evas_canvas_render_async(NULL, NULL, &ret)); + } + else + { + evas_render(evas); + } t_count++; fps += p_fps; wfps += (p_fps * weights[n]); @@ -698,6 +744,10 @@ ui_args(int argc, char **argv) { cmp_report = 1; } + else if (!strcmp(argv[i], "-y")) + { + async_render = 1; + } } _ui_setup(); start = get_time(); diff --git a/src/bin/ui.h b/src/bin/ui.h index fce4a33..b4236da 100644 --- a/src/bin/ui.h +++ b/src/bin/ui.h @@ -1,6 +1,8 @@ #ifndef UI_H #define UI_H +extern int async_render; + void ui_args(int argc, char **argv); void ui_loop(void); void ui_menu(void);