summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2017-02-28 11:01:09 -0800
committerCedric BAIL <cedric@osg.samsung.com>2017-02-28 11:04:34 -0800
commitd8edf70c327258975503cf81ff5e633bcab05d48 (patch)
tree83f2b87b6c40d28af9abe7c0cdb7b9ba60510a14 /src
parentb4381fd2d54f419c31794b61fe7bc680119c6f17 (diff)
ecore: improve debugging of animator.
Diffstat (limited to 'src')
-rw-r--r--src/lib/ecore/ecore.c1
-rw-r--r--src/lib/ecore/ecore_anim.c49
-rw-r--r--src/lib/ecore/ecore_private.h2
3 files changed, 51 insertions, 1 deletions
diff --git a/src/lib/ecore/ecore.c b/src/lib/ecore/ecore.c
index e531c1ca81..99ba1dd2f0 100644
--- a/src/lib/ecore/ecore.c
+++ b/src/lib/ecore/ecore.c
@@ -234,6 +234,7 @@ ecore_init(void)
234 EINA_LOG_ERR("Ecore was unable to create a log domain."); 234 EINA_LOG_ERR("Ecore was unable to create a log domain.");
235 goto shutdown_log_dom; 235 goto shutdown_log_dom;
236 } 236 }
237 _ecore_animator_init();
237 238
238 _ecore_pfx = eina_prefix_new(NULL, ecore_init, 239 _ecore_pfx = eina_prefix_new(NULL, ecore_init,
239 "ECORE", "ecore", "checkme", 240 "ECORE", "ecore", "checkme",
diff --git a/src/lib/ecore/ecore_anim.c b/src/lib/ecore/ecore_anim.c
index 5ce277523e..44bd1f2cf2 100644
--- a/src/lib/ecore/ecore_anim.c
+++ b/src/lib/ecore/ecore_anim.c
@@ -59,6 +59,33 @@ struct _Ecore_Animator
59 Eina_Bool just_added : 1; 59 Eina_Bool just_added : 1;
60}; 60};
61 61
62static int _ecore_anim_log_dom = -1;
63
64#ifdef ERR
65# undef ERR
66#endif
67#define ERR(...) EINA_LOG_DOM_ERR(_ecore_anim_log_dom, __VA_ARGS__)
68
69#ifdef DBG
70# undef DBG
71#endif
72#define DBG(...) EINA_LOG_DOM_DBG(_ecore_anim_log_dom, __VA_ARGS__)
73
74#ifdef INF
75# undef INF
76#endif
77#define INF(...) EINA_LOG_DOM_INFO(_ecore_anim_log_dom, __VA_ARGS__)
78
79#ifdef WRN
80# undef WRN
81#endif
82#define WRN(...) EINA_LOG_DOM_WARN(_ecore_anim_log_dom, __VA_ARGS__)
83
84#ifdef CRI
85# undef CRI
86#endif
87#define CRI(...) EINA_LOG_DOM_CRIT(_ecore_anim_log_dom, __VA_ARGS__)
88
62static Eina_Bool _do_tick(void); 89static Eina_Bool _do_tick(void);
63static Eina_Bool _ecore_animator_run(void *data); 90static Eina_Bool _ecore_animator_run(void *data);
64 91
@@ -427,10 +454,12 @@ _begin_tick(void)
427 switch (src) 454 switch (src)
428 { 455 {
429 case ECORE_ANIMATOR_SOURCE_TIMER: 456 case ECORE_ANIMATOR_SOURCE_TIMER:
457 DBG("General animator registered with timer source.");
430 _timer_tick_begin(); 458 _timer_tick_begin();
431 break; 459 break;
432 460
433 case ECORE_ANIMATOR_SOURCE_CUSTOM: 461 case ECORE_ANIMATOR_SOURCE_CUSTOM:
462 DBG("General animator registered with custom source.");
434 if (begin_tick_cb) begin_tick_cb((void *)begin_tick_data); 463 if (begin_tick_cb) begin_tick_cb((void *)begin_tick_data);
435 break; 464 break;
436 465
@@ -446,6 +475,8 @@ _end_tick(void)
446 eina_evlog("<animator", NULL, 0.0, NULL); 475 eina_evlog("<animator", NULL, 0.0, NULL);
447 ticking = 0; 476 ticking = 0;
448 477
478 DBG("General animator unregistered.");
479
449 _timer_tick_end(); 480 _timer_tick_end();
450 481
451 if ((src == ECORE_ANIMATOR_SOURCE_CUSTOM) && end_tick_cb) 482 if ((src == ECORE_ANIMATOR_SOURCE_CUSTOM) && end_tick_cb)
@@ -458,6 +489,7 @@ _do_tick(void)
458 Ecore_Animator *animator; 489 Ecore_Animator *animator;
459 Eina_Inlist *tmp; 490 Eina_Inlist *tmp;
460 491
492 DBG("General animator tick.");
461 EINA_INLIST_FOREACH(animators, animator) 493 EINA_INLIST_FOREACH(animators, animator)
462 { 494 {
463 animator->just_added = EINA_FALSE; 495 animator->just_added = EINA_FALSE;
@@ -865,6 +897,10 @@ ecore_animator_source_set(Ecore_Animator_Source source)
865 EINA_MAIN_LOOP_CHECK_RETURN; 897 EINA_MAIN_LOOP_CHECK_RETURN;
866 _end_tick(); 898 _end_tick();
867 src = source; 899 src = source;
900 DBG("New source set to %s.",
901 source == ECORE_ANIMATOR_SOURCE_TIMER ? "TIMER" :
902 source == ECORE_ANIMATOR_SOURCE_CUSTOM ? "CUSTOM" :
903 "UNKNOW");
868 if (_have_animators()) _begin_tick(); 904 if (_have_animators()) _begin_tick();
869} 905}
870 906
@@ -921,6 +957,9 @@ _ecore_animator_shutdown(void)
921 (EINA_INLIST_GET(animators), EINA_INLIST_GET(animator)); 957 (EINA_INLIST_GET(animators), EINA_INLIST_GET(animator));
922 free(animator); 958 free(animator);
923 } 959 }
960
961 eina_log_domain_unregister(_ecore_anim_log_dom);
962 _ecore_anim_log_dom = -1;
924} 963}
925 964
926void 965void
@@ -988,3 +1027,13 @@ _ecore_animator_flush(void)
988 } 1027 }
989 return EINA_TRUE; 1028 return EINA_TRUE;
990} 1029}
1030
1031void
1032_ecore_animator_init(void)
1033{
1034 _ecore_anim_log_dom = eina_log_domain_register("ecore animator", ECORE_DEFAULT_LOG_COLOR);
1035 if (_ecore_anim_log_dom < 0)
1036 {
1037 EINA_LOG_ERR("Ecore was unable to create a log domain.");
1038 }
1039}
diff --git a/src/lib/ecore/ecore_private.h b/src/lib/ecore/ecore_private.h
index 0197c8df08..f810c6c129 100644
--- a/src/lib/ecore/ecore_private.h
+++ b/src/lib/ecore/ecore_private.h
@@ -245,6 +245,7 @@ void _ecore_exe_event_del_free(void *data,
245 void *ev); 245 void *ev);
246#endif 246#endif
247 247
248void _ecore_animator_init(void);
248void _ecore_animator_shutdown(void); 249void _ecore_animator_shutdown(void);
249void _ecore_animator_run_reset(void); 250void _ecore_animator_run_reset(void);
250Eina_Bool _ecore_animator_run_get(void); 251Eina_Bool _ecore_animator_run_get(void);
@@ -275,7 +276,6 @@ void _ecore_throttle(void);
275 276
276void _ecore_main_call_flush(void); 277void _ecore_main_call_flush(void);
277 278
278
279static inline Eina_Bool 279static inline Eina_Bool
280_ecore_call_task_cb(Ecore_Task_Cb func, 280_ecore_call_task_cb(Ecore_Task_Cb func,
281 void *data) 281 void *data)