diff options
author | Cedric BAIL <cedric@osg.samsung.com> | 2015-06-25 18:30:26 +0200 |
---|---|---|
committer | Cedric BAIL <cedric@osg.samsung.com> | 2015-06-25 18:30:26 +0200 |
commit | c290c2d15c34f188b1745c7fc92a9d7992316294 (patch) | |
tree | e2fb5702b49e89712794f1de19776515b8e5c77f | |
parent | 014001fb20499d175f4e5c896ac4d27bf05c69c5 (diff) |
expedite: add ability to dump any frame.
-rw-r--r-- | src/bin/main.c | 55 | ||||
-rw-r--r-- | src/bin/main.h | 19 |
2 files changed, 65 insertions, 9 deletions
diff --git a/src/bin/main.c b/src/bin/main.c index 65cdea7..98e8ee7 100644 --- a/src/bin/main.c +++ b/src/bin/main.c | |||
@@ -7,6 +7,7 @@ | |||
7 | Evas *evas = NULL; | 7 | Evas *evas = NULL; |
8 | const char *profile = "n800"; | 8 | const char *profile = "n800"; |
9 | const char *choosen_engine = NULL; | 9 | const char *choosen_engine = NULL; |
10 | char *output = NULL; | ||
10 | int win_w = 720, win_h = 420; | 11 | int win_w = 720, win_h = 420; |
11 | int loops = LOOPS; | 12 | int loops = LOOPS; |
12 | int one_test = 0; | 13 | int one_test = 0; |
@@ -1128,6 +1129,7 @@ static const Ecore_Getopt optdesc = { | |||
1128 | ECORE_GETOPT_STORE_INT('c', "count", "Number of main loop run per tests"), | 1129 | ECORE_GETOPT_STORE_INT('c', "count", "Number of main loop run per tests"), |
1129 | ECORE_GETOPT_STORE_TRUE('f', "fullscreen", "Make window fullscreen"), | 1130 | ECORE_GETOPT_STORE_TRUE('f', "fullscreen", "Make window fullscreen"), |
1130 | ECORE_GETOPT_STORE_STR('d', "datadir", "Define expedite data directory"), | 1131 | ECORE_GETOPT_STORE_STR('d', "datadir", "Define expedite data directory"), |
1132 | ECORE_GETOPT_STORE_STR('o', "output", "Output frame specified by count from test to specified file"), | ||
1131 | ECORE_GETOPT_STORE_INT('t', "test", "Run a single test"), | 1133 | ECORE_GETOPT_STORE_INT('t', "test", "Run a single test"), |
1132 | ECORE_GETOPT_STORE_TRUE('l', "list-tests", "List all tests"), | 1134 | ECORE_GETOPT_STORE_TRUE('l', "list-tests", "List all tests"), |
1133 | ECORE_GETOPT_STORE_TRUE('m', "compat", "Output compatible with expedite-cmp"), | 1135 | ECORE_GETOPT_STORE_TRUE('m', "compat", "Output compatible with expedite-cmp"), |
@@ -1221,6 +1223,7 @@ main(int argc, char **argv) | |||
1221 | ECORE_GETOPT_VALUE_INT(loops), | 1223 | ECORE_GETOPT_VALUE_INT(loops), |
1222 | ECORE_GETOPT_VALUE_BOOL(fullscreen), | 1224 | ECORE_GETOPT_VALUE_BOOL(fullscreen), |
1223 | ECORE_GETOPT_VALUE_STR(datadir), | 1225 | ECORE_GETOPT_VALUE_STR(datadir), |
1226 | ECORE_GETOPT_VALUE_STR(output), | ||
1224 | ECORE_GETOPT_VALUE_INT(test), | 1227 | ECORE_GETOPT_VALUE_INT(test), |
1225 | ECORE_GETOPT_VALUE_BOOL(tests_list), | 1228 | ECORE_GETOPT_VALUE_BOOL(tests_list), |
1226 | ECORE_GETOPT_VALUE_BOOL(cmp_report), | 1229 | ECORE_GETOPT_VALUE_BOOL(cmp_report), |
@@ -1283,6 +1286,57 @@ main(int argc, char **argv) | |||
1283 | 1286 | ||
1284 | ecore_app_args_set(argc, (const char **) argv); | 1287 | ecore_app_args_set(argc, (const char **) argv); |
1285 | 1288 | ||
1289 | if (output) | ||
1290 | { | ||
1291 | Ecore_Evas *pee; | ||
1292 | Evas_Object *im; | ||
1293 | |||
1294 | pee = ecore_evas_buffer_new(1, 1); | ||
1295 | if (!pee) return -1; | ||
1296 | |||
1297 | im = ecore_evas_object_image_new(pee); | ||
1298 | if (!im) return -1; | ||
1299 | evas_object_image_filled_set(im, EINA_TRUE); | ||
1300 | evas_object_image_size_set(im, | ||
1301 | resolutions[resolution_index].width, | ||
1302 | resolutions[resolution_index].height); | ||
1303 | |||
1304 | ee = ecore_evas_object_ecore_evas_get(im); | ||
1305 | if (!ee) return -1; | ||
1306 | |||
1307 | ecore_evas_resize(ee, | ||
1308 | resolutions[resolution_index].width, | ||
1309 | resolutions[resolution_index].height); | ||
1310 | |||
1311 | evas_object_show(im); | ||
1312 | |||
1313 | choosen_engine = ecore_evas_engine_name_get(pee); | ||
1314 | evas = ecore_evas_get(ee); | ||
1315 | |||
1316 | evas_font_path_append(evas, datadir); | ||
1317 | evas_font_hinting_set(evas, EVAS_FONT_HINTING_AUTO); | ||
1318 | |||
1319 | ui_setup(resolutions[resolution_index].width, | ||
1320 | resolutions[resolution_index].height); | ||
1321 | |||
1322 | if (test > 0) | ||
1323 | { | ||
1324 | one_test = 1; | ||
1325 | ui_num(test); | ||
1326 | } | ||
1327 | |||
1328 | while (loops > 0) | ||
1329 | { | ||
1330 | ui_loop(NULL); | ||
1331 | loops--; | ||
1332 | } | ||
1333 | |||
1334 | ecore_evas_manual_render(pee); | ||
1335 | evas_object_image_save(im, output, NULL, NULL); | ||
1336 | |||
1337 | goto done; | ||
1338 | } | ||
1339 | |||
1286 | ee = ecore_evas_new(engine, 0, 0, | 1340 | ee = ecore_evas_new(engine, 0, 0, |
1287 | resolutions[resolution_index].width, | 1341 | resolutions[resolution_index].width, |
1288 | resolutions[resolution_index].height, | 1342 | resolutions[resolution_index].height, |
@@ -1338,6 +1392,7 @@ main(int argc, char **argv) | |||
1338 | ecore_main_loop_begin(); | 1392 | ecore_main_loop_begin(); |
1339 | ecore_animator_del(anim); | 1393 | ecore_animator_del(anim); |
1340 | 1394 | ||
1395 | done: | ||
1341 | ecore_evas_free(ee); | 1396 | ecore_evas_free(ee); |
1342 | 1397 | ||
1343 | ecore_evas_shutdown(); | 1398 | ecore_evas_shutdown(); |
diff --git a/src/bin/main.h b/src/bin/main.h index 4f373b5..cba52c7 100644 --- a/src/bin/main.h +++ b/src/bin/main.h | |||
@@ -51,6 +51,7 @@ extern int one_test; | |||
51 | extern const char *choosen_engine; | 51 | extern const char *choosen_engine; |
52 | extern Eina_Bool fullscreen; | 52 | extern Eina_Bool fullscreen; |
53 | extern Eina_Bool cmp_report; | 53 | extern Eina_Bool cmp_report; |
54 | extern char *output; | ||
54 | 55 | ||
55 | typedef struct _Expedite_Resolution Expedite_Resolution; | 56 | typedef struct _Expedite_Resolution Expedite_Resolution; |
56 | typedef struct _Expedite_Engine Expedite_Engine; | 57 | typedef struct _Expedite_Engine Expedite_Engine; |
@@ -88,15 +89,15 @@ int engine_abort(void); | |||
88 | ui_menu(); \ | 89 | ui_menu(); \ |
89 | } | 90 | } |
90 | 91 | ||
91 | #define FPS_STD(x) \ | 92 | #define FPS_STD(x) \ |
92 | if ((f >= loops) && (!done)) \ | 93 | if (!output && (f >= loops) && (!done)) \ |
93 | { \ | 94 | { \ |
94 | double fps; \ | 95 | double fps; \ |
95 | fps = (double)f / t; \ | 96 | fps = (double)f / t; \ |
96 | printf("%4.2f , %s\n", fps, x); \ | 97 | printf("%4.2f , %s\n", fps, x); \ |
97 | ui_fps(fps); \ | 98 | ui_fps(fps); \ |
98 | done = 1; \ | 99 | done = 1; \ |
99 | } | 100 | } |
100 | 101 | ||
101 | #define SLOW 5.0 | 102 | #define SLOW 5.0 |
102 | 103 | ||