diff options
-rw-r--r-- | packaging/ico-uxf-weston-plugin.spec | 2 | ||||
-rw-r--r-- | settings/weston.ini | 4 | ||||
-rw-r--r-- | src/ico_ivi_common_private.h | 1 | ||||
-rw-r--r-- | src/ico_plugin_version.h | 2 | ||||
-rw-r--r-- | src/ico_window_animation.c | 18 | ||||
-rw-r--r-- | src/ico_window_mgr.c | 23 |
6 files changed, 40 insertions, 10 deletions
diff --git a/packaging/ico-uxf-weston-plugin.spec b/packaging/ico-uxf-weston-plugin.spec index 7a3573d..066a2c3 100644 --- a/packaging/ico-uxf-weston-plugin.spec +++ b/packaging/ico-uxf-weston-plugin.spec @@ -1,6 +1,6 @@ Name: ico-uxf-weston-plugin Summary: Weston Plugins for IVI -Version: 0.9.21 +Version: 0.9.22 Release: 1.1 Group: Graphics & UI Framework/Automotive UI License: MIT diff --git a/settings/weston.ini b/settings/weston.ini index 590c0a3..cddd9f8 100644 --- a/settings/weston.ini +++ b/settings/weston.ini @@ -83,10 +83,10 @@ modules=ivi-controller.so,ico_window_mgr.so,ico_window_animation.so,ico_input_mg displayno=1,0 [ivi-animation] -# default animation name +# default animation name, time(ms) and frame rate(frame/sec) default=fade -# default animation time(ms) time=500 +fps=30 [ivi-option] # option flags (but not used) diff --git a/src/ico_ivi_common_private.h b/src/ico_ivi_common_private.h index 1d2174c..497f0c2 100644 --- a/src/ico_ivi_common_private.h +++ b/src/ico_ivi_common_private.h @@ -79,6 +79,7 @@ int ico_ivi_debugflag(void); /* Get debug flag /* Get default animation name */ const char *ico_ivi_default_animation_name(void); int ico_ivi_default_animation_time(void); /* Get default animation time(ms) */ +int ico_ivi_default_animation_fps(void); /* Get animation frame rate(fps) */ /* Debug Traces */ /* Define for debug write */ diff --git a/src/ico_plugin_version.h b/src/ico_plugin_version.h index d7d1daf..fcb0c04 100644 --- a/src/ico_plugin_version.h +++ b/src/ico_plugin_version.h @@ -1 +1 @@ -#define ICO_PLUIGN_VERSION "0.9.21 (Mar-28-2014)" +#define ICO_PLUIGN_VERSION "0.9.22 (Mar-31-2014)" 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); diff --git a/src/ico_window_mgr.c b/src/ico_window_mgr.c index 780a508..522af45 100644 --- a/src/ico_window_mgr.c +++ b/src/ico_window_mgr.c @@ -234,6 +234,7 @@ static int _ico_ivi_option_flag = 0; /* option flags static int _ico_ivi_debug_level = 3; /* debug Level */ static char *_ico_ivi_animation_name = NULL; /* default animation name */ static int _ico_ivi_animation_time = 500; /* default animation time */ +static int _ico_ivi_animation_fps = 30; /* animation frame rate */ /* static management table */ static struct ico_win_mgr *_ico_win_mgr = NULL; @@ -320,6 +321,20 @@ ico_ivi_default_animation_time(void) /*--------------------------------------------------------------------------*/ /** + * @brief ico_ivi_default_animation_fps: get default animation frame rate + * + * @param None + * @return Default animation frame rate(frames/sec) + */ +/*--------------------------------------------------------------------------*/ +WL_EXPORT int +ico_ivi_default_animation_fps(void) +{ + return _ico_ivi_animation_fps; +} + +/*--------------------------------------------------------------------------*/ +/** * @brief ico_ivi_get_mynode: Get my NodeId * * @param None @@ -596,6 +611,8 @@ ico_window_mgr_get_usurf_client(const uint32_t surfaceid, struct wl_client *clie return NULL; } usurf = (struct uifw_win_surface *)uclient->surface_link.next; + uifw_trace("ico_window_mgr_get_usurf_client: client=%08x 1st surface=%08x", + (int)client, usurf->surfaceid); } return usurf; } @@ -2849,10 +2866,12 @@ module_init(struct weston_compositor *ec, int *argc, char *argv[]) if (section) { weston_config_section_get_string(section, "default", &_ico_ivi_animation_name, NULL); weston_config_section_get_int(section, "time", &_ico_ivi_animation_time, 500); + weston_config_section_get_int(section, "fps", &_ico_ivi_animation_fps, 30); } if (_ico_ivi_animation_name == NULL) _ico_ivi_animation_name = (char *)"fade"; if (_ico_ivi_animation_time < 100) _ico_ivi_animation_time = 500; + if (_ico_ivi_animation_fps < 3) _ico_ivi_animation_fps = 30; /* create ico_window_mgr management table */ _ico_win_mgr = (struct ico_win_mgr *)malloc(sizeof(struct ico_win_mgr)); @@ -2951,8 +2970,8 @@ module_init(struct weston_compositor *ec, int *argc, char *argv[]) wl_event_loop_add_timer(loop, win_mgr_timer_mapsurface, NULL); wl_event_source_timer_update(_ico_win_mgr->wait_mapevent, 1000); - uifw_info("ico_window_mgr: animation name=%s time=%d", - _ico_ivi_animation_name, _ico_ivi_animation_time); + uifw_info("ico_window_mgr: animation name=%s time=%d fps=%d", + _ico_ivi_animation_name, _ico_ivi_animation_time, _ico_ivi_animation_fps); uifw_info("ico_window_mgr: option flag=0x%04x log level=%d debug flag=0x%04x", _ico_ivi_option_flag, _ico_ivi_debug_level & 0x0ffff, (_ico_ivi_debug_level >> 16) & 0x0ffff); |