From: SooChan Lim Date: Fri, 27 Apr 2018 02:38:54 +0000 (+0900) Subject: surface: revert the code of return params of getting width/height X-Git-Tag: submit/tizen/20180427.043352~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=404ba7712bfcf966fa9070da944ff11fa0b593b1;p=platform%2Fcore%2Fuifw%2Flibtbm.git surface: revert the code of return params of getting width/height Change-Id: If24926ebc95b7c1c65875dd3143932e9520e7399 --- diff --git a/src/tbm_surface.c b/src/tbm_surface.c index 07cf55a..0766cf5 100644 --- a/src/tbm_surface.c +++ b/src/tbm_surface.c @@ -142,6 +142,8 @@ tbm_surface_get_width(tbm_surface_h surface) { TBM_TRACE_SURFACE("tbm_surface(%p)\n", surface); + int width = 0; + _tbm_set_last_result(TBM_ERROR_NONE); if (!surface) { @@ -149,14 +151,22 @@ tbm_surface_get_width(tbm_surface_h surface) set_last_result(TBM_SURFACE_ERROR_INVALID_PARAMETER); #endif _tbm_set_last_result(TBM_ERROR_INVALID_PARAMETER); - return 0; + return TBM_SURFACE_ERROR_INVALID_PARAMETER; + } + + width = tbm_surface_internal_get_width(surface); + if (tbm_get_last_error() != TBM_ERROR_NONE) { +#ifdef HAVE_CAPI_0_1_1 + set_last_result(TBM_SURFACE_ERROR_INVALID_PARAMETER); +#endif + return TBM_SURFACE_ERROR_INVALID_PARAMETER; } #ifdef HAVE_CAPI_0_1_1 set_last_result(TBM_SURFACE_ERROR_NONE); #endif - return tbm_surface_internal_get_width(surface); + return width; } int @@ -164,6 +174,8 @@ tbm_surface_get_height(tbm_surface_h surface) { TBM_TRACE_SURFACE("tbm_surface(%p)\n", surface); + int height = 0; + _tbm_set_last_result(TBM_ERROR_NONE); if (!surface) { @@ -171,14 +183,22 @@ tbm_surface_get_height(tbm_surface_h surface) set_last_result(TBM_SURFACE_ERROR_INVALID_PARAMETER); #endif _tbm_set_last_result(TBM_ERROR_INVALID_PARAMETER); - return 0; + return TBM_SURFACE_ERROR_INVALID_PARAMETER; + } + + height = tbm_surface_internal_get_height(surface); + if (tbm_get_last_error() != TBM_ERROR_NONE) { +#ifdef HAVE_CAPI_0_1_1 + set_last_result(TBM_SURFACE_ERROR_INVALID_PARAMETER); +#endif + return TBM_SURFACE_ERROR_INVALID_PARAMETER; } #ifdef HAVE_CAPI_0_1_1 set_last_result(TBM_SURFACE_ERROR_NONE); #endif - return tbm_surface_internal_get_height(surface); + return height; } tbm_format