From: dyamy-lee Date: Thu, 5 Nov 2020 08:52:28 +0000 (+0900) Subject: fota_gui_common : set image buffer size by rotate_angle X-Git-Tag: submit/tizen/20201202.104648~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=94b00890938721810d46d8e4a88683cfd7af0e39;p=profile%2Fcommon%2Fapps%2Fnative%2Ffirmware-update-system-ui.git fota_gui_common : set image buffer size by rotate_angle Change-Id: I3f808e998d75aebe9671366dfcaca64206bca610 --- diff --git a/fota_gui_common/fota_gr_direct_ro_common.c b/fota_gui_common/fota_gr_direct_ro_common.c index b9c5729..e094c29 100644 --- a/fota_gui_common/fota_gr_direct_ro_common.c +++ b/fota_gui_common/fota_gr_direct_ro_common.c @@ -62,6 +62,8 @@ const int x_offset_prog_bar_img_pos = 240; const int y_offset_prog_bar_img_pos = 355; int rotate_angle = 0; int rollback_rotate_angle = 0; +int img_buf_width = 0; +int img_buf_height = 0; FbInfo s_fbi; tdm_if_disp s_disp; @@ -455,7 +457,7 @@ static void __init_screen(FbInfo *fbi) /* create tbm_surface for original image */ tbm_surface_h tbm_surface_ori = NULL; tbm_surface_info_s surface_info_ori; - tbm_surface_ori = tbm_surface_create(fbi->w, fbi->h, TBM_FORMAT_ARGB8888); // rotated width, height + tbm_surface_ori = tbm_surface_create(img_buf_width, img_buf_height, TBM_FORMAT_ARGB8888); // rotated width, height if(!tbm_surface_ori){ LOG("failed to tbm_surface_create\n"); } @@ -626,6 +628,16 @@ void _get_rotate(void) rotate_angle = ROTATE; LOG("Print Rotate Angle value = %d\n", rotate_angle); rollback_rotate_angle = 360 - rotate_angle; + + int rotate_step = (rotate_angle + 360) / 90 % 4; + if (rotate_step % 2 == 0) { + img_buf_width = s_fbi.w; + img_buf_height = s_fbi.h; + } else { + img_buf_width = s_fbi.h; + img_buf_height = s_fbi.w; + } + LOG("Print Img buffer(=image w,h) width = %d, height = %d\n", img_buf_width, img_buf_height); } /*-----------------------------------------------------------------------------