summaryrefslogtreecommitdiff
path: root/src/lib/ecore_evas/ecore_evas.c
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-12-08 15:07:40 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-12-09 14:48:07 +0900
commit0e902ffffe50587fcd5012c84ac57028857ed00c (patch)
treef896729b30ec28aa0c92fa7de20ff02ee3250828 /src/lib/ecore_evas/ecore_evas.c
parentcc1ff312768c3915516e1d8c36e6d4c382de830a (diff)
ecore evas - add animator update syncing to only render on animator ticks
this adds a ifdefable feature to sync rendering only to animator slots. this should reduce over-render of more frames than a user can see when updates are triggered by things like mouse movements (which may come in many times faster than the framerate). this is an experiment to see if this helps smoothness and load. it also has problems in e grabs x while rendering - this is now fixed in e18 alreadey, but it is just a config you can turn off.
Diffstat (limited to 'src/lib/ecore_evas/ecore_evas.c')
-rw-r--r--src/lib/ecore_evas/ecore_evas.c46
1 files changed, 45 insertions, 1 deletions
diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c
index 771e7dc839..db2ada75e8 100644
--- a/src/lib/ecore_evas/ecore_evas.c
+++ b/src/lib/ecore_evas/ecore_evas.c
@@ -43,6 +43,28 @@ static Ecore_Idle_Enterer *ecore_evas_idle_enterer = NULL;
43static Ecore_Evas *ecore_evases = NULL; 43static Ecore_Evas *ecore_evases = NULL;
44static int _ecore_evas_fps_debug = 0; 44static int _ecore_evas_fps_debug = 0;
45 45
46#define RENDER_SYNC 1
47
48#ifdef RENDER_SYNC
49static Ecore_Animator *ecore_evas_animator = NULL;
50static Eina_Bool ecore_evas_animator_ticked = EINA_FALSE;
51static Eina_Bool ecore_evas_first = EINA_TRUE;
52static int overtick = 0;
53
54static Eina_Bool
55_ecore_evas_animator(void *data EINA_UNUSED)
56{
57 ecore_evas_animator_ticked = EINA_TRUE;
58 overtick--;
59 if (overtick == 0)
60 {
61 ecore_evas_animator = NULL;
62 return EINA_FALSE;
63 }
64 return EINA_TRUE;
65}
66#endif
67
46static Eina_Bool 68static Eina_Bool
47_ecore_evas_idle_enter(void *data EINA_UNUSED) 69_ecore_evas_idle_enter(void *data EINA_UNUSED)
48{ 70{
@@ -55,6 +77,25 @@ _ecore_evas_idle_enter(void *data EINA_UNUSED)
55#endif 77#endif
56 78
57 if (!ecore_evases) return ECORE_CALLBACK_RENEW; 79 if (!ecore_evases) return ECORE_CALLBACK_RENEW;
80
81#ifdef RENDER_SYNC
82 if (!ecore_evas_first)
83 {
84 if ((!ecore_evas_animator_ticked) &&
85 (!ecore_main_loop_animator_ticked_get()))
86 {
87 if (!ecore_evas_animator)
88 {
89 overtick = 1;
90 ecore_evas_animator = ecore_animator_add(_ecore_evas_animator, NULL);
91 }
92 return ECORE_CALLBACK_RENEW;
93 }
94 ecore_evas_animator_ticked = EINA_FALSE;
95 }
96 ecore_evas_first = EINA_FALSE;
97#endif
98
58 if (_ecore_evas_fps_debug) 99 if (_ecore_evas_fps_debug)
59 { 100 {
60 t1 = ecore_time_get(); 101 t1 = ecore_time_get();
@@ -351,7 +392,10 @@ ecore_evas_shutdown(void)
351 if (_ecore_evas_fps_debug) _ecore_evas_fps_debug_shutdown(); 392 if (_ecore_evas_fps_debug) _ecore_evas_fps_debug_shutdown();
352 ecore_idle_enterer_del(ecore_evas_idle_enterer); 393 ecore_idle_enterer_del(ecore_evas_idle_enterer);
353 ecore_evas_idle_enterer = NULL; 394 ecore_evas_idle_enterer = NULL;
354 395#ifdef RENDER_SYNC
396 if (ecore_evas_animator) ecore_animator_del(ecore_evas_animator);
397 ecore_evas_animator = NULL;
398#endif
355#ifdef BUILD_ECORE_EVAS_EWS 399#ifdef BUILD_ECORE_EVAS_EWS
356 while (_ecore_evas_ews_shutdown()); 400 while (_ecore_evas_ews_shutdown());
357#endif 401#endif