summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2017-06-13 14:33:56 -0700
committerCedric BAIL <cedric@osg.samsung.com>2017-06-13 14:33:56 -0700
commitfe8e23cbc6ed8daab6d47ffd9cadfbcf444a0006 (patch)
tree9bea0bcac5028b15b951f02429e7deb136b37e39
parente7b11dd328d9db82b49cde795944a721beaf0112 (diff)
make it possible to follow output tick.
-rw-r--r--src/bin/main.c24
-rw-r--r--src/bin/main.h1
-rw-r--r--src/bin/ui.c7
3 files changed, 28 insertions, 4 deletions
diff --git a/src/bin/main.c b/src/bin/main.c
index cc812c8..4e26070 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -1135,6 +1135,7 @@ static const Ecore_Getopt optdesc = {
1135 ECORE_GETOPT_STORE_TRUE('m', "compat", "Output compatible with expedite-cmp"), 1135 ECORE_GETOPT_STORE_TRUE('m', "compat", "Output compatible with expedite-cmp"),
1136 ECORE_GETOPT_STORE_TRUE('y', "async", "Enable async output"), 1136 ECORE_GETOPT_STORE_TRUE('y', "async", "Enable async output"),
1137 ECORE_GETOPT_STORE_TRUE('a', "all", "Run all tests"), 1137 ECORE_GETOPT_STORE_TRUE('a', "all", "Run all tests"),
1138 ECORE_GETOPT_STORE_FALSE('i', "tick", "Follow output animator tick"),
1138 ECORE_GETOPT_LICENSE('L', "license"), 1139 ECORE_GETOPT_LICENSE('L', "license"),
1139 ECORE_GETOPT_COPYRIGHT('C', "copyright"), 1140 ECORE_GETOPT_COPYRIGHT('C', "copyright"),
1140 ECORE_GETOPT_VERSION('V', "version"), 1141 ECORE_GETOPT_VERSION('V', "version"),
@@ -1171,6 +1172,8 @@ static const Expedite_Resolution resolutions[] = {
1171 { NULL, 0, 0 } 1172 { NULL, 0, 0 }
1172}; 1173};
1173 1174
1175Eina_Bool tick = EINA_TRUE;
1176
1174static void 1177static void
1175_cb_delete(Ecore_Evas *ee EINA_UNUSED) 1178_cb_delete(Ecore_Evas *ee EINA_UNUSED)
1176{ 1179{
@@ -1180,6 +1183,22 @@ _cb_delete(Ecore_Evas *ee EINA_UNUSED)
1180static Eina_Bool 1183static Eina_Bool
1181_cb_anim(void *data EINA_UNUSED) 1184_cb_anim(void *data EINA_UNUSED)
1182{ 1185{
1186 static double last = 0;
1187 static double avg = 0;
1188 static unsigned long long count = 0;
1189 double current;
1190
1191 current = ecore_loop_time_get();
1192 if (count++)
1193 {
1194 avg += current - last;
1195 if (abs(current - last - (avg / (count - 1))) > 0.05)
1196 fprintf(stderr, "delta: %f vs %f (%f)\n",
1197 current - last,
1198 avg / (count - 1));
1199 }
1200 last = current;
1201
1183 ui_loop(NULL); 1202 ui_loop(NULL);
1184 return EINA_TRUE; 1203 return EINA_TRUE;
1185} 1204}
@@ -1230,6 +1249,7 @@ main(int argc, char **argv)
1230 ECORE_GETOPT_VALUE_BOOL(cmp_report), 1249 ECORE_GETOPT_VALUE_BOOL(cmp_report),
1231 ECORE_GETOPT_VALUE_BOOL(async), 1250 ECORE_GETOPT_VALUE_BOOL(async),
1232 ECORE_GETOPT_VALUE_BOOL(all_tests), 1251 ECORE_GETOPT_VALUE_BOOL(all_tests),
1252 ECORE_GETOPT_VALUE_BOOL(tick),
1233 ECORE_GETOPT_VALUE_BOOL(quit_option), 1253 ECORE_GETOPT_VALUE_BOOL(quit_option),
1234 ECORE_GETOPT_VALUE_BOOL(quit_option), 1254 ECORE_GETOPT_VALUE_BOOL(quit_option),
1235 ECORE_GETOPT_VALUE_BOOL(quit_option), 1255 ECORE_GETOPT_VALUE_BOOL(quit_option),
@@ -1351,7 +1371,7 @@ main(int argc, char **argv)
1351 1371
1352 choosen_engine = ecore_evas_engine_name_get(ee); 1372 choosen_engine = ecore_evas_engine_name_get(ee);
1353 ecore_evas_callback_delete_request_set(ee, _cb_delete); 1373 ecore_evas_callback_delete_request_set(ee, _cb_delete);
1354 ecore_evas_callback_post_render_set(ee, _cb_post_render); 1374 if (tick) ecore_evas_callback_post_render_set(ee, _cb_post_render);
1355 1375
1356 evas = ecore_evas_get(ee); 1376 evas = ecore_evas_get(ee);
1357 1377
@@ -1390,7 +1410,7 @@ main(int argc, char **argv)
1390 if (all_tests) ui_all(); 1410 if (all_tests) ui_all();
1391 1411
1392 anim = ecore_animator_add(_cb_anim, ee); 1412 anim = ecore_animator_add(_cb_anim, ee);
1393 ecore_animator_custom_tick(); 1413 if (tick) ecore_animator_custom_tick();
1394 ecore_main_loop_begin(); 1414 ecore_main_loop_begin();
1395 ecore_animator_del(anim); 1415 ecore_animator_del(anim);
1396 1416
diff --git a/src/bin/main.h b/src/bin/main.h
index cba52c7..cd481b1 100644
--- a/src/bin/main.h
+++ b/src/bin/main.h
@@ -52,6 +52,7 @@ extern const char *choosen_engine;
52extern Eina_Bool fullscreen; 52extern Eina_Bool fullscreen;
53extern Eina_Bool cmp_report; 53extern Eina_Bool cmp_report;
54extern char *output; 54extern char *output;
55extern Eina_Bool tick;
55 56
56typedef struct _Expedite_Resolution Expedite_Resolution; 57typedef struct _Expedite_Resolution Expedite_Resolution;
57typedef struct _Expedite_Engine Expedite_Engine; 58typedef struct _Expedite_Engine Expedite_Engine;
diff --git a/src/bin/ui.c b/src/bin/ui.c
index 40e4124..78e3db1 100644
--- a/src/bin/ui.c
+++ b/src/bin/ui.c
@@ -664,8 +664,11 @@ ui_func_set(void (*kfunc) (const char *key), void (*lfunc) (double t, int f))
664 f_loop = f_start = 0; 664 f_loop = f_start = 0;
665 ui_fps(0.0); 665 ui_fps(0.0);
666 666
667 ecore_animator_source_set(ECORE_ANIMATOR_SOURCE_CUSTOM); 667 if (tick)
668 ecore_animator_custom_tick(); 668 {
669 ecore_animator_source_set(ECORE_ANIMATOR_SOURCE_CUSTOM);
670 ecore_animator_custom_tick();
671 }
669} 672}
670 673
671void 674void