summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--base/base_gui_direct.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/base/base_gui_direct.c b/base/base_gui_direct.c
index 676ad35..2b497d1 100644
--- a/base/base_gui_direct.c
+++ b/base/base_gui_direct.c
@@ -450,12 +450,18 @@ 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_error_e result = TBM_SURFACE_ERROR_NONE;
+
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");
+ return;
+ }
+ result = tbm_surface_map(tbm_surface_ori, TBM_SURF_OPTION_READ | TBM_SURF_OPTION_WRITE, &surface_info_ori);
+ if(result != TBM_SURFACE_ERROR_NONE) {
+ LOG("tbm_surface_map failed: %d\n", result);
+ return;
}
- tbm_surface_map(tbm_surface_ori, TBM_SURF_OPTION_READ | TBM_SURF_OPTION_WRITE, &surface_info_ori);
-
_gr_direct_clear_screen_init(&surface_info_ori, COLOR_BLACK);
@@ -543,12 +549,18 @@ void fota_gr_direct_progress(int * saved_percent, int * percent_to_draw)
/* create tbm_surface for original image */
tbm_surface_h tbm_surface_ori = NULL;
tbm_surface_info_s surface_info_ori;
+ tbm_surface_error_e result = TBM_SURFACE_ERROR_NONE;
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");
+ return;
+ }
+ result = tbm_surface_map(tbm_surface_ori, TBM_SURF_OPTION_READ | TBM_SURF_OPTION_WRITE, &surface_info_ori);
+ if(result != TBM_SURFACE_ERROR_NONE) {
+ LOG("tbm_surface_map failed: %d\n", result);
+ return;
}
- tbm_surface_map(tbm_surface_ori, TBM_SURF_OPTION_READ | TBM_SURF_OPTION_WRITE, &surface_info_ori);
// need to keep previous image
_copy_buffers_by_rotate(s_fbi.buf[0], s_fbi.w, s_fbi.h, s_fbi.w * RGB32_PITCH,
surface_info_ori.planes[0].ptr, surface_info_ori.width, surface_info_ori.height, surface_info_ori.planes[0].stride,