remove unused valiable
[platform/core/uifw/libtbm.git] / src / tbm_surface_internal.c
index fd375a9..df77fe7 100644 (file)
@@ -69,7 +69,6 @@ void _tbm_surface_mutex_unlock(void);
 }
 
 /* LCOV_EXCL_START */
-
 static double
 _tbm_surface_internal_get_time(void)
 {
@@ -218,7 +217,6 @@ _tbm_surface_internal_format_to_str(tbm_format format)
                return "unknwon";
        }
 }
-/* LCOV_EXCL_STOP */
 
 static bool
 _tbm_surface_mutex_init(void)
@@ -270,6 +268,7 @@ _deinit_surface_bufmgr(void)
        tbm_bufmgr_deinit(g_surface_bufmgr);
        g_surface_bufmgr = NULL;
 }
+/* LCOV_EXCL_STOP */
 
 static int
 _tbm_surface_internal_is_valid(tbm_surface_h surface)
@@ -315,8 +314,10 @@ _tbm_surface_internal_query_plane_data(tbm_surface_h surface,
        ret = mgr->backend->surface_get_plane_data(surf->info.width,
                        surf->info.height, surf->info.format, plane_idx, size, offset, pitch, bo_idx);
        if (!ret) {
+               /* LCOV_EXCL_START */
                TBM_LOG_E("Fail to surface_get_plane_data. surface(%p)\n", surface);
                return 0;
+               /* LCOV_EXCL_STOP */
        }
 
        return 1;
@@ -411,8 +412,10 @@ tbm_surface_internal_query_supported_formats(uint32_t **formats,
 
        ret = mgr->backend->surface_supported_format(formats, num);
        if (!ret)  {
+               /* LCOV_EXCL_START */
                TBM_LOG_E("Fail to surface_supported_format.\n");
                goto fail;
+               /* LCOV_EXCL_START */
        }
 
        TBM_TRACE("tbm_bufmgr(%p) format num(%u)\n", g_surface_bufmgr, *num);
@@ -421,6 +424,7 @@ tbm_surface_internal_query_supported_formats(uint32_t **formats,
 
        return ret;
 
+/* LCOV_EXCL_START */
 fail:
        if (bufmgr_initialized) {
                LIST_DELINIT(&g_surface_bufmgr->surf_list);
@@ -431,6 +435,7 @@ fail:
        TBM_LOG_E("error: tbm_bufmgr(%p)\n", g_surface_bufmgr);
 
        return 0;
+/* LCOV_EXCL_STOP */
 }
 
 int
@@ -642,8 +647,10 @@ tbm_surface_internal_create_with_flags(int width, int height,
 
        surf = calloc(1, sizeof(struct _tbm_surface));
        if (!surf) {
+               /* LCOV_EXCL_START */
                TBM_LOG_E("fail to alloc surf\n");
                goto alloc_surf_fail;
+               /* LCOV_EXCL_STOP */
        }
 
        surf->bufmgr = mgr;
@@ -744,6 +751,7 @@ tbm_surface_internal_create_with_flags(int width, int height,
 
        return surf;
 
+/* LCOV_EXCL_START */
 alloc_bo_fail:
        for (j = 0; j < i; j++) {
                if (surf->bos[j])
@@ -762,6 +770,7 @@ check_valid_fail:
        TBM_LOG_E("error: width(%d) height(%d) format(%s) flags(%d)\n",
                        width, height,
                        _tbm_surface_internal_format_to_str(format), flags);
+/* LCOV_EXCL_STOP */
 
        return NULL;
 }
@@ -795,8 +804,10 @@ tbm_surface_internal_create_with_bos(tbm_surface_info_s *info,
 
        surf = calloc(1, sizeof(struct _tbm_surface));
        if (!surf) {
+               /* LCOV_EXCL_START */
                TBM_LOG_E("fail to allocate struct _tbm_surface.\n");
                goto alloc_surf_fail;
+               /* LCOV_EXCL_STOP */
        }
 
        surf->bufmgr = mgr;
@@ -865,6 +876,7 @@ tbm_surface_internal_create_with_bos(tbm_surface_info_s *info,
 
        return surf;
 
+/* LCOV_EXCL_START */
 check_bo_fail:
        for (i = 0; i < num; i++) {
                if (surf->bos[i])
@@ -882,6 +894,7 @@ check_valid_fail:
        TBM_LOG_E("error: width(%u) height(%u) format(%s) bo_num(%d)\n",
                        info->width, info->height,
                        _tbm_surface_internal_format_to_str(info->format), num);
+/* LCOV_EXCL_STOP */
 
        return NULL;
 }
@@ -1695,10 +1708,12 @@ fail:
 void
 tbm_surface_internal_dump_with_scale_start(char *path, int w, int h, int count, double scale)
 {
-       TBM_RETURN_IF_FAIL(scale > 0.0);
-
-       tbm_surface_internal_dump_start(path, (int)(scale * w), (int)(scale * h), count);
+       if (scale > 0.0) {
+               w *= scale;
+               h *= scale;
+       }
 
+       tbm_surface_internal_dump_start(path, w, h, count);
        scale_factor = scale;
 }