{
TBM_TRACE_SURFACE("tbm_surface(%p)\n", surface);
+ int width = 0;
+
_tbm_set_last_result(TBM_ERROR_NONE);
if (!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
{
TBM_TRACE_SURFACE("tbm_surface(%p)\n", surface);
+ int height = 0;
+
_tbm_set_last_result(TBM_ERROR_NONE);
if (!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