From: jeon Date: Thu, 24 Oct 2019 08:54:15 +0000 (+0900) Subject: backend: clear leds when a clear_fadeout animation is stopped X-Git-Tag: accepted/tizen/5.5/unified/20200102.014046~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;ds=sidebyside;h=98d55d75af723457f985ab3b5dbd0f305982444e;p=platform%2Fcore%2Fuifw%2Flibpui.git backend: clear leds when a clear_fadeout animation is stopped Change-Id: If2eebf2a1c59cdc9843f69ac7b50a14580c5af34 --- diff --git a/backends/default/default_ani_clear_fadeout.c b/backends/default/default_ani_clear_fadeout.c index 5ed7453..39a6d7d 100644 --- a/backends/default/default_ani_clear_fadeout.c +++ b/backends/default/default_ani_clear_fadeout.c @@ -65,7 +65,7 @@ _ani_clear_fadeout_get_frame(default_ani_info *ani_info) } ani_info->frame_idx++; - if (ani_info->frame_idx > ani_info->frame_max) + if (ani_info->frame_idx >= ani_info->frame_max) { ani_info->frame_idx = 0; ani_info->repeat_cur++; @@ -204,6 +204,45 @@ _ani_clear_fadeout_start(pui_ani_t *ani, int repeat) return e; } +void +_ani_clear_led_clear(pui_ani_t *ani) +{ + pui_int_error e = PUI_INT_ERROR_NONE; + pui_ani_control_buffer *buffer = NULL; + + buffer = pui_backend_ani_get_buffer(ani); + + if (!buffer) + { + pui_err("Failed to get buffer !\n"); + return; + } + + for(int i = 0; i<12; i++) + { + buffer->ptr[4*i] = 0; + buffer->ptr[4*i + 1] = 0;//R + buffer->ptr[4*i + 2] = 0;//G + buffer->ptr[4*i + 3] = 0;//B + } + + e = pui_backend_ani_set_buffer(ani, buffer); + + if (e != PUI_INT_ERROR_NONE) + { + pui_err("Failed on setting buffer on animation !(e=%d)\n", e); + return; + } + + e = pui_backend_ani_update(ani); + + if (e != PUI_INT_ERROR_NONE) + { + pui_err("Failed on updating animation !(e=%d)\n", e); + return; + } +} + pui_error _ani_clear_fadeout_stop(pui_ani_t *ani, pui_bool force) { @@ -220,6 +259,8 @@ _ani_clear_fadeout_stop(pui_ani_t *ani, pui_bool force) pui_backend_ani_remove_frame_cb(ani); + _ani_clear_led_clear(ani); + if (force) pui_backend_ani_status_update(ani, PUI_ANI_STATUS_PAUSED); else