expedite: add ability to dump any frame.

This commit is contained in:
Cedric BAIL 2015-06-25 18:30:26 +02:00
parent 014001fb20
commit c290c2d15c
2 changed files with 65 additions and 9 deletions

View File

@ -7,6 +7,7 @@
Evas *evas = NULL;
const char *profile = "n800";
const char *choosen_engine = NULL;
char *output = NULL;
int win_w = 720, win_h = 420;
int loops = LOOPS;
int one_test = 0;
@ -1128,6 +1129,7 @@ static const Ecore_Getopt optdesc = {
ECORE_GETOPT_STORE_INT('c', "count", "Number of main loop run per tests"),
ECORE_GETOPT_STORE_TRUE('f', "fullscreen", "Make window fullscreen"),
ECORE_GETOPT_STORE_STR('d', "datadir", "Define expedite data directory"),
ECORE_GETOPT_STORE_STR('o', "output", "Output frame specified by count from test to specified file"),
ECORE_GETOPT_STORE_INT('t', "test", "Run a single test"),
ECORE_GETOPT_STORE_TRUE('l', "list-tests", "List all tests"),
ECORE_GETOPT_STORE_TRUE('m', "compat", "Output compatible with expedite-cmp"),
@ -1221,6 +1223,7 @@ main(int argc, char **argv)
ECORE_GETOPT_VALUE_INT(loops),
ECORE_GETOPT_VALUE_BOOL(fullscreen),
ECORE_GETOPT_VALUE_STR(datadir),
ECORE_GETOPT_VALUE_STR(output),
ECORE_GETOPT_VALUE_INT(test),
ECORE_GETOPT_VALUE_BOOL(tests_list),
ECORE_GETOPT_VALUE_BOOL(cmp_report),
@ -1283,6 +1286,57 @@ main(int argc, char **argv)
ecore_app_args_set(argc, (const char **) argv);
if (output)
{
Ecore_Evas *pee;
Evas_Object *im;
pee = ecore_evas_buffer_new(1, 1);
if (!pee) return -1;
im = ecore_evas_object_image_new(pee);
if (!im) return -1;
evas_object_image_filled_set(im, EINA_TRUE);
evas_object_image_size_set(im,
resolutions[resolution_index].width,
resolutions[resolution_index].height);
ee = ecore_evas_object_ecore_evas_get(im);
if (!ee) return -1;
ecore_evas_resize(ee,
resolutions[resolution_index].width,
resolutions[resolution_index].height);
evas_object_show(im);
choosen_engine = ecore_evas_engine_name_get(pee);
evas = ecore_evas_get(ee);
evas_font_path_append(evas, datadir);
evas_font_hinting_set(evas, EVAS_FONT_HINTING_AUTO);
ui_setup(resolutions[resolution_index].width,
resolutions[resolution_index].height);
if (test > 0)
{
one_test = 1;
ui_num(test);
}
while (loops > 0)
{
ui_loop(NULL);
loops--;
}
ecore_evas_manual_render(pee);
evas_object_image_save(im, output, NULL, NULL);
goto done;
}
ee = ecore_evas_new(engine, 0, 0,
resolutions[resolution_index].width,
resolutions[resolution_index].height,
@ -1338,6 +1392,7 @@ main(int argc, char **argv)
ecore_main_loop_begin();
ecore_animator_del(anim);
done:
ecore_evas_free(ee);
ecore_evas_shutdown();

View File

@ -51,6 +51,7 @@ extern int one_test;
extern const char *choosen_engine;
extern Eina_Bool fullscreen;
extern Eina_Bool cmp_report;
extern char *output;
typedef struct _Expedite_Resolution Expedite_Resolution;
typedef struct _Expedite_Engine Expedite_Engine;
@ -88,15 +89,15 @@ int engine_abort(void);
ui_menu(); \
}
#define FPS_STD(x) \
if ((f >= loops) && (!done)) \
{ \
double fps; \
fps = (double)f / t; \
printf("%4.2f , %s\n", fps, x); \
ui_fps(fps); \
done = 1; \
}
#define FPS_STD(x) \
if (!output && (f >= loops) && (!done)) \
{ \
double fps; \
fps = (double)f / t; \
printf("%4.2f , %s\n", fps, x); \
ui_fps(fps); \
done = 1; \
}
#define SLOW 5.0