aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/elementary/src/lib/elm_win.c
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@samsung.com>2013-03-20 17:37:40 +0900
committerCedric BAIL <cedric.bail@samsung.com>2013-03-22 14:45:09 +0900
commit77581f1c0aed7606a5ada7cd311b6a3ba72ef5c3 (patch)
treea5f51bfd8fabc08e84b51b5d533652bec3e72139 /legacy/elementary/src/lib/elm_win.c
parentupdate po's (diff)
downloadefl-77581f1c0aed7606a5ada7cd311b6a3ba72ef5c3.tar.gz
elementary: add infrastructure to track startup time.
Set ELM_FIRST_FRAME to : * D or E: for exit * A: for abort * T: to display the time since entering main();
Diffstat (limited to 'legacy/elementary/src/lib/elm_win.c')
-rw-r--r--legacy/elementary/src/lib/elm_win.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/legacy/elementary/src/lib/elm_win.c b/legacy/elementary/src/lib/elm_win.c
index 9d708e6442..bc9b35cbc8 100644
--- a/legacy/elementary/src/lib/elm_win.c
+++ b/legacy/elementary/src/lib/elm_win.c
@@ -213,6 +213,26 @@ _elm_win_on_resize_obj_changed_size_hints(void *data,
Evas_Object *obj,
void *event_info);
+EAPI double _elm_startup_time = 0;
+
+static void
+_elm_win_first_frame_do(void *data EINA_UNUSED, Evas *e EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ double end = ecore_time_unix_get();
+ char *first = getenv("ELM_FIRST_FRAME");
+
+ switch (*first)
+ {
+ case 'A': abort();
+ case 'E':
+ case 'D': exit(-1);
+ case 'T': fprintf(stderr, "Startup time: '%f' - '%f' = '%f'\n", end, _elm_startup_time, end - _elm_startup_time);
+ break;
+ }
+
+ evas_event_callback_del_full(e, EVAS_CALLBACK_RENDER_POST, _elm_win_first_frame_do, NULL);
+}
+
static void
_elm_win_state_eval(void *data __UNUSED__)
{
@@ -2784,6 +2804,10 @@ _win_constructor(Eo *obj, void *_pd, va_list *list)
evas_obj_type_set(MY_CLASS_NAME),
evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
+ if (getenv("ELM_FIRST_FRAME"))
+ evas_event_callback_add(ecore_evas_get(tmp_sd.ee), EVAS_CALLBACK_RENDER_POST,
+ _elm_win_first_frame_do, NULL);
+
/* copying possibly altered fields back */
#define SD_CPY(_field) \
do \