From: mike_m Date: Wed, 27 Jul 2011 03:13:47 +0000 (+0000) Subject: ecore: Reduce rendering latency in g_main_loop X-Git-Tag: accepted/2.0/20130306.224007~181^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2c40bda91365b671dd3ec2905ed87c35198083ed;p=profile%2Fivi%2Fecore.git ecore: Reduce rendering latency in g_main_loop After a lot of hair pulling, and other debugging, it appears that to make animation smooth on an embedded device, the following things should happen in (quick) sequence: 1. update the loop time 2. call timers (which animates and updates the scene graph) 3. call idle enterers (which renders to the display) 4. call fd buf handlers (which flushes xlib stuff) Signed-off-by: Mike McCormack git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/ecore@61784 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/lib/ecore/ecore_main.c b/src/lib/ecore/ecore_main.c index 41422a5..53d7a8a 100644 --- a/src/lib/ecore/ecore_main.c +++ b/src/lib/ecore/ecore_main.c @@ -492,12 +492,16 @@ _ecore_main_gsource_prepare(GSource *source __UNUSED__, gint *next_time) if (!ecore_idling && !_ecore_glib_idle_enterer_called) { + _ecore_time_loop_time = ecore_time_get(); while (_ecore_timer_call(_ecore_time_loop_time)); _ecore_timer_cleanup(); _ecore_idle_enterer_call(); _ecore_throttle(); _ecore_glib_idle_enterer_called = FALSE; + + if (fd_handlers_with_buffer) + _ecore_main_fd_handlers_buf_call(); } while (_ecore_signal_count_get()) _ecore_signal_call(); @@ -607,7 +611,6 @@ _ecore_main_gsource_check(GSource *source __UNUSED__) ret = TRUE; /* check timers after updating loop time */ - _ecore_time_loop_time = ecore_time_get(); if (!ret && _ecore_timers_exists()) ret = (0.0 == _ecore_timer_next_get()); @@ -675,6 +678,9 @@ _ecore_main_gsource_dispatch(GSource *source __UNUSED__, GSourceFunc callback __ _ecore_idle_enterer_call(); _ecore_throttle(); _ecore_glib_idle_enterer_called = TRUE; + + if (fd_handlers_with_buffer) + _ecore_main_fd_handlers_buf_call(); } in_main_loop--;