summaryrefslogtreecommitdiff
path: root/src/lib/ecore_evas/ecore_evas.c
diff options
context:
space:
mode:
authorDerek Foreman <derek.foreman.samsung@gmail.com>2018-09-18 09:42:29 -0500
committerDerek Foreman <derek.foreman.samsung@gmail.com>2018-09-18 09:42:30 -0500
commit501114e679c687ef0b27697fdea1d49f62b59769 (patch)
tree458fa07015f961efecdfd3e66f1407e595e45c1c /src/lib/ecore_evas/ecore_evas.c
parent8b17564c74860251a86dbcf76dfa2b07a57a4e0a (diff)
ecore_evas: Refactor out ticking start/stop as functions
Summary: These are the refcounted ticky guts of the signal add/del catchers, we'll need to use these to start/stop from other call chains in the near future. Reviewers: devilhorns Reviewed By: devilhorns Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D7039
Diffstat (limited to 'src/lib/ecore_evas/ecore_evas.c')
-rw-r--r--src/lib/ecore_evas/ecore_evas.c74
1 files changed, 43 insertions, 31 deletions
diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c
index f3033b6..e7540b6 100644
--- a/src/lib/ecore_evas/ecore_evas.c
+++ b/src/lib/ecore_evas/ecore_evas.c
@@ -3196,6 +3196,47 @@ _ecore_evas_animator_fallback(void *data)
3196} 3196}
3197 3197
3198static void 3198static void
3199_ticking_start(Ecore_Evas *ee)
3200{
3201 if (!ee->animator_count)
3202 INF("Setting up animator for %p from '%s' with title '%s'.", ee->evas, ee->driver, ee->prop.title);
3203
3204 if (ee->engine.func->fn_animator_register &&
3205 ee->engine.func->fn_animator_unregister)
3206 {
3207 // Backend support per window vsync
3208 ecore_evas_tick_begin(ee);
3209 }
3210 else
3211 {
3212 // Backend doesn't support per window vsync, fallback to generic support
3213 if (ee->animator_count++ > 0) return;
3214 ee->anim = ecore_animator_add(_ecore_evas_animator_fallback, ee);
3215 }
3216}
3217
3218static void
3219_ticking_stop(Ecore_Evas *ee)
3220{
3221 if (ee->animator_count == 1)
3222 INF("Unsetting up animator for %p from '%s' titled '%s'.", ee->evas, ee->driver, ee->prop.title);
3223
3224 if (ee->engine.func->fn_animator_register &&
3225 ee->engine.func->fn_animator_unregister)
3226 {
3227 // Backend support per window vsync
3228 ecore_evas_tick_end(ee);
3229 }
3230 else
3231 {
3232 // Backend doesn't support per window vsync, fallback to generic support
3233 if (--ee->animator_count > 0) return;
3234 ecore_animator_del(ee->anim);
3235 ee->anim = NULL;
3236 }
3237}
3238
3239static void
3199_check_animator_event_catcher_add(void *data, const Efl_Event *event) 3240_check_animator_event_catcher_add(void *data, const Efl_Event *event)
3200{ 3241{
3201 const Efl_Callback_Array_Item_Full *array = event->info; 3242 const Efl_Callback_Array_Item_Full *array = event->info;
@@ -3206,21 +3247,7 @@ _check_animator_event_catcher_add(void *data, const Efl_Event *event)
3206 { 3247 {
3207 if (array[i].desc == EFL_EVENT_ANIMATOR_TICK) 3248 if (array[i].desc == EFL_EVENT_ANIMATOR_TICK)
3208 { 3249 {
3209 if (!ee->animator_count) 3250 _ticking_start(ee);
3210 INF("Setting up animator for %p from '%s' with title '%s'.", ee->evas, ee->driver, ee->prop.title);
3211
3212 if (ee->engine.func->fn_animator_register &&
3213 ee->engine.func->fn_animator_unregister)
3214 {
3215 // Backend support per window vsync
3216 ecore_evas_tick_begin(ee);
3217 }
3218 else
3219 {
3220 // Backend doesn't support per window vsync, fallback to generic support
3221 if (ee->animator_count++ > 0) return;
3222 ee->anim = ecore_animator_add(_ecore_evas_animator_fallback, ee);
3223 }
3224 3251
3225 // No need to walk more than once per array as you can not del 3252 // No need to walk more than once per array as you can not del
3226 // a partial array 3253 // a partial array
@@ -3240,22 +3267,7 @@ _check_animator_event_catcher_del(void *data, const Efl_Event *event)
3240 { 3267 {
3241 if (array[i].desc == EFL_EVENT_ANIMATOR_TICK) 3268 if (array[i].desc == EFL_EVENT_ANIMATOR_TICK)
3242 { 3269 {
3243 if (ee->animator_count == 1) 3270 _ticking_stop(ee);
3244 INF("Unsetting up animator for %p from '%s' titled '%s'.", ee->evas, ee->driver, ee->prop.title);
3245
3246 if (ee->engine.func->fn_animator_register &&
3247 ee->engine.func->fn_animator_unregister)
3248 {
3249 // Backend support per window vsync
3250 ecore_evas_tick_end(ee);
3251 }
3252 else
3253 {
3254 // Backend doesn't support per window vsync, fallback to generic support
3255 if (--ee->animator_count > 0) return;
3256 ecore_animator_del(ee->anim);
3257 ee->anim = NULL;
3258 }
3259 return; 3271 return;
3260 } 3272 }
3261 } 3273 }