fota_gui_common : set image buffer size by rotate_angle 85/247985/2
authordyamy-lee <dyamy.lee@samsung.com>
Thu, 5 Nov 2020 08:52:28 +0000 (17:52 +0900)
committerdyamy-lee <dyamy.lee@samsung.com>
Mon, 23 Nov 2020 08:26:44 +0000 (17:26 +0900)
Change-Id: I3f808e998d75aebe9671366dfcaca64206bca610

fota_gui_common/fota_gr_direct_ro_common.c

index b9c5729878917bc2bd6be8a9071734176e1bca97..e094c294a57136ec3f99952143707046ab1b4779 100644 (file)
@@ -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);
 }
 
 /*-----------------------------------------------------------------------------