summaryrefslogtreecommitdiff
path: root/src/lib/ecore_evas/ecore_evas.c
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2018-11-22 11:45:00 +0000
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2018-12-03 11:04:27 +0000
commit12827e8873c7bd7e04f85214c787ffbc89d6492f (patch)
tree1b5e3724c4ee339f05a7e60be15caf54cc2d32a0 /src/lib/ecore_evas/ecore_evas.c
parent6ec6d93535ebda03e1a4fac28b13d81b9ec79ee7 (diff)
ecore_evas - fix aninmator based frame render ticking to full framerate
so i was seeing ecore evas only rendering every 2nd frame... this is because it was adding and deleting animatiors every time it rendered instead of keeping one around as lon as updates where there to render and then remove it afterwards. this caused nasty timing problems and thus problems assessing framerate of rendered content etc. etc. ... not good. this fixes that. this only happened if you only used pure legacy ecore animators. if you used the efl animator tick events it worked right. @fix
Diffstat (limited to 'src/lib/ecore_evas/ecore_evas.c')
-rw-r--r--src/lib/ecore_evas/ecore_evas.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c
index f63463a..109b5ef 100644
--- a/src/lib/ecore_evas/ecore_evas.c
+++ b/src/lib/ecore_evas/ecore_evas.c
@@ -120,9 +120,6 @@ _ecore_evas_animator(void *data, const Efl_Event *ev EINA_UNUSED)
120 Ecore_Evas *ee = data; 120 Ecore_Evas *ee = data;
121 121
122 ee->animator_ticked = EINA_TRUE; 122 ee->animator_ticked = EINA_TRUE;
123
124 efl_event_callback_del(ee->evas, EFL_EVENT_ANIMATOR_TICK, _ecore_evas_animator, ee);
125 ee->animator_registered = EINA_FALSE;
126} 123}
127 124
128static Eina_Bool 125static Eina_Bool
@@ -308,6 +305,11 @@ _ecore_evas_idle_enter(void *data EINA_UNUSED)
308 if (ee->engine.func->fn_evas_changed) 305 if (ee->engine.func->fn_evas_changed)
309 ee->engine.func->fn_evas_changed(ee, change); 306 ee->engine.func->fn_evas_changed(ee, change);
310 307
308 if (!change)
309 {
310 efl_event_callback_del(ee->evas, EFL_EVENT_ANIMATOR_TICK, _ecore_evas_animator, ee);
311 ee->animator_registered = EINA_FALSE;
312 }
311#ifdef ECORE_EVAS_ASYNC_RENDER_DEBUG 313#ifdef ECORE_EVAS_ASYNC_RENDER_DEBUG
312 if ((ee->in_async_render) && (ee->async_render_start <= 0.0)) 314 if ((ee->in_async_render) && (ee->async_render_start <= 0.0))
313 { 315 {
@@ -3284,7 +3286,10 @@ _ticking_start(Ecore_Evas *ee)
3284 { 3286 {
3285 // Backend doesn't support per window vsync, fallback to generic support 3287 // Backend doesn't support per window vsync, fallback to generic support
3286 if (ee->animator_count++ > 0) return; 3288 if (ee->animator_count++ > 0) return;
3287 ee->anim = ecore_animator_add(_ecore_evas_animator_fallback, ee); 3289 if (!ee->anim)
3290 {
3291 ee->anim = ecore_animator_add(_ecore_evas_animator_fallback, ee);
3292 }
3288 } 3293 }
3289} 3294}
3290 3295
@@ -3304,8 +3309,11 @@ _ticking_stop(Ecore_Evas *ee)
3304 { 3309 {
3305 // Backend doesn't support per window vsync, fallback to generic support 3310 // Backend doesn't support per window vsync, fallback to generic support
3306 if (--ee->animator_count > 0) return; 3311 if (--ee->animator_count > 0) return;
3307 ecore_animator_del(ee->anim); 3312 if (ee->anim)
3308 ee->anim = NULL; 3313 {
3314 ecore_animator_del(ee->anim);
3315 ee->anim = NULL;
3316 }
3309 } 3317 }
3310} 3318}
3311 3319