From 475afc484dbc53f3ecf1836b4102ded9c27cd6ba Mon Sep 17 00:00:00 2001 From: dyamy-lee Date: Thu, 5 Nov 2020 17:52:28 +0900 Subject: [PATCH] fota_gui_common : set image buffer size by rotate_angle Change-Id: I3f808e998d75aebe9671366dfcaca64206bca610 --- fota_gui_common/fota_gr_direct_ro_common.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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); } /*----------------------------------------------------------------------------- -- 2.34.1