diff options
author | Masayuki Sasaki <masayuki.sasaki@mail.toyota-td.jp> | 2014-04-03 13:37:33 +0900 |
---|---|---|
committer | Masayuki Sasaki <masayuki.sasaki@mail.toyota-td.jp> | 2014-04-03 13:38:37 +0900 |
commit | b4ca3fe8070e0ee5e28e1025ec2a14507a7444a1 (patch) | |
tree | 77c0417a942409892920b2859d07a9783a087a7c /src/ico_window_animation.c | |
parent | 851c876cda3d5dd4ea82a818dd78fc67f6b27007 (diff) | |
download | ico-uxf-weston-plugin-b4ca3fe8070e0ee5e28e1025ec2a14507a7444a1.tar.gz ico-uxf-weston-plugin-b4ca3fe8070e0ee5e28e1025ec2a14507a7444a1.tar.bz2 ico-uxf-weston-plugin-b4ca3fe8070e0ee5e28e1025ec2a14507a7444a1.zip |
0.9.22 release
bug fix: CPU is occupied in surface animation.
Change-Id: Ia59b8c8fc24639e9f53d29d03f78bb9aec42e678
Signed-off-by: Masayuki Sasaki <masayuki.sasaki@mail.toyota-td.jp>
Diffstat (limited to 'src/ico_window_animation.c')
-rw-r--r-- | src/ico_window_animation.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/ico_window_animation.c b/src/ico_window_animation.c index 934483c..0489486 100644 --- a/src/ico_window_animation.c +++ b/src/ico_window_animation.c @@ -79,7 +79,9 @@ struct animation_data { /* static valiables */ static struct weston_compositor *weston_ec; /* Weston compositor */ static char *default_animation; /* default animation name */ +static int animation_fps; /* animation frame rate(frame/sec) */ static int animation_time; /* default animation time(ms) */ +static int animation_count; /* current number of animations */ static struct animation_data *free_data; /* free data list */ /* support animation names */ @@ -209,6 +211,7 @@ ico_window_animation(const int op, void *data) struct weston_output, link); wl_list_insert(output->animation_list.prev, &usurf->animation.animation.link); + animation_count ++; } } else if (((usurf->animation.state == ICO_WINDOW_MGR_ANIMATION_STATE_SHOW) && @@ -413,15 +416,17 @@ animation_cont(struct weston_animation *animation, struct weston_output *output, if (usurf->animation.time == 0) { usurf->animation.time = animation_time; } - if (((output == NULL) && (msecs == 0)) || - (nowsec >= ((uint32_t)usurf->animation.time))) { + if (((output == NULL) && (msecs == 0)) || (nowsec >= ((uint32_t)usurf->animation.time))) { par = 100; } else { par = (nowsec * 100 + usurf->animation.time / 2) / usurf->animation.time; - if (par < 1) par = 1; + if (par < 2) par = 2; } - if ((par >= 100) || (par != usurf->animation.current)) { + if ((par >= 100) || + (abs(usurf->animation.current - par) >= + (((1000 * 100) / animation_fps) / usurf->animation.time)) || + ((animation_count > 1) && (par != usurf->animation.current))) { usurf->animation.current = par; return 0; } @@ -460,6 +465,9 @@ animation_end(struct uifw_win_surface *usurf, const int disp) } animadata = (struct animation_data *)usurf->animation.animadata; + if (animation_count > 0) { + animation_count --; + } ev = ico_ivi_get_primary_view(usurf); if (animadata) { @@ -1250,6 +1258,8 @@ module_init(struct weston_compositor *ec, int *argc, char *argv[]) weston_ec = ec; default_animation = (char *)ico_ivi_default_animation_name(); animation_time = ico_ivi_default_animation_time(); + animation_fps = ico_ivi_default_animation_fps(); + animation_count = 0; ico_window_mgr_set_hook_animation(ico_window_animation); |