From 81e5ad871548fbe1e4babf1b7b64cddc92938410 Mon Sep 17 00:00:00 2001 From: JunsuChoi Date: Fri, 26 Apr 2019 17:42:40 +0900 Subject: [PATCH] efl_ui_animation_view: Update callback is called only actual change time. Summary: The transit_cb is called from 0 to 1 depending on the duration. Since the update callback is called even if there is no actual change, we change it to call when there is a change in the frame. Test Plan: N/A Reviewers: Hermet, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8715 --- src/lib/elementary/efl_ui_animation_view.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/lib/elementary/efl_ui_animation_view.c b/src/lib/elementary/efl_ui_animation_view.c index 167805e38b..7f7ddd8f93 100644 --- a/src/lib/elementary/efl_ui_animation_view.c +++ b/src/lib/elementary/efl_ui_animation_view.c @@ -172,7 +172,10 @@ _transit_cb(Elm_Transit_Effect *effect, Elm_Transit *transit, double progress) pd->progress = progress; int minframe = (pd->frame_cnt - 1) * pd->min_progress; int maxframe = (pd->frame_cnt - 1) * pd->max_progress; - evas_object_vg_animated_frame_set(pd->vg, (int)((maxframe - minframe) * progress) + minframe); + + int update_frame = (int)((maxframe - minframe) * progress) + minframe; + int current_frame = evas_object_vg_animated_frame_get(pd->vg); + evas_object_vg_animated_frame_set(pd->vg, update_frame); if (pd->auto_repeat) { @@ -184,7 +187,10 @@ _transit_cb(Elm_Transit_Effect *effect, Elm_Transit *transit, double progress) } } - evas_object_smart_callback_call(pd->obj, SIG_PLAY_UPDATE, NULL); + //transit_cb is always called with a progress value 0 ~ 1. + //SIG_PLAY_UPDATE callback is called only when there is a real change. + if (update_frame != current_frame) + evas_object_smart_callback_call(pd->obj, SIG_PLAY_UPDATE, NULL); } EOLIAN static void