From: SooChan Lim Date: Fri, 2 Jul 2021 02:08:18 +0000 (+0900) Subject: tbm_surface_internal: do not print the error message X-Git-Tag: submit/tizen/20210702.072025~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7b5a6c040006654827e2b95834e1ef0407106a4b;p=platform%2Fcore%2Fuifw%2Flibtbm.git tbm_surface_internal: do not print the error message If the tbm_module does not support the surface_data, the libtbm prints nothing. Change-Id: Ibbe628d66a6ff1a1d56a9e578a38e8101e84530e --- diff --git a/src/tbm_surface_internal.c b/src/tbm_surface_internal.c index 251b975..f540387 100644 --- a/src/tbm_surface_internal.c +++ b/src/tbm_surface_internal.c @@ -106,6 +106,16 @@ void _tbm_surface_mutex_unlock(void); } \ } +#define TBM_SURFACE_RETURN_VAL_SET_ERR_NO_LOG_IF_FAIL(cond, val, error, error_type) {\ + if (!(cond)) {\ + if (error)\ + *error = error_type;\ + _tbm_set_last_result(error_type);\ + _tbm_surface_mutex_unlock();\ + return val;\ + } \ +} + /* LCOV_EXCL_START */ static double _tbm_surface_internal_get_time(void) @@ -2880,7 +2890,7 @@ tbm_surface_internal_export(tbm_surface_h surface, tbm_error_e *error) TBM_SURFACE_RETURN_VAL_SET_ERR_IF_FAIL(bufmgr != NULL, NULL, error, TBM_ERROR_INVALID_OPERATION); // this function supports when the module suppport surface_data. - TBM_SURFACE_RETURN_VAL_SET_ERR_IF_FAIL(tbm_module_support_surface_data(bufmgr->module), NULL, error, TBM_ERROR_NOT_SUPPORTED); + TBM_SURFACE_RETURN_VAL_SET_ERR_NO_LOG_IF_FAIL(tbm_module_support_surface_data(bufmgr->module), NULL, error, TBM_ERROR_NOT_SUPPORTED); TBM_SURFACE_RETURN_VAL_SET_ERR_IF_FAIL(_tbm_surface_internal_is_valid(surface), NULL, error, TBM_ERROR_INVALID_PARAMETER); @@ -2908,7 +2918,7 @@ tbm_surface_internal_import(tbm_surface_info_s *surface_info, tbm_surface_buffer TBM_SURFACE_RETURN_VAL_SET_ERR_IF_FAIL(bufmgr != NULL, NULL, error, TBM_ERROR_INVALID_OPERATION); // this function supports when the module suppport surface_data. - TBM_SURFACE_RETURN_VAL_SET_ERR_IF_FAIL(tbm_module_support_surface_data(bufmgr->module), NULL, error, TBM_ERROR_NOT_SUPPORTED); + TBM_SURFACE_RETURN_VAL_SET_ERR_NO_LOG_IF_FAIL(tbm_module_support_surface_data(bufmgr->module), NULL, error, TBM_ERROR_NOT_SUPPORTED); TBM_SURFACE_RETURN_VAL_SET_ERR_IF_FAIL(surface_info != NULL, NULL, error, TBM_ERROR_INVALID_PARAMETER); TBM_SURFACE_RETURN_VAL_SET_ERR_IF_FAIL(surface_info->width > 0, NULL, error, TBM_ERROR_INVALID_PARAMETER);