TBM_TRACE_SURFACE("\n");
if (!tbm_surface_internal_query_supported_formats(formats, num))
- return TBM_SURFACE_ERROR_INVALID_OPERATION;
+ return tbm_get_last_error();
return TBM_SURFACE_ERROR_NONE;
}
{
TBM_TRACE_SURFACE("width(%d) height(%d)\n", width, height);
+ _tbm_set_last_result(TBM_ERROR_NONE);
+
if (!(width > 0) || !(height > 0)) {
#ifdef HAVE_CAPI_0_1_1
set_last_result(TBM_SURFACE_ERROR_INVALID_PARAMETER);
#endif
+ _tbm_set_last_result(TBM_ERROR_INVALID_PARAMETER);
return NULL;
}
#endif
return NULL;
}
+
#ifdef HAVE_CAPI_0_1_1
set_last_result(TBM_SURFACE_ERROR_NONE);
#endif
+
return surf;
}
tbm_surface_internal_destroy(surface);
- return TBM_SURFACE_ERROR_NONE;
+ return tbm_get_last_error();
}
int
ret = tbm_surface_internal_get_info(surface, opt, info, 1);
if (ret == 0)
- return TBM_SURFACE_ERROR_INVALID_OPERATION;
+ return tbm_get_last_error();
return TBM_SURFACE_ERROR_NONE;
}
tbm_surface_internal_unmap(surface);
- return TBM_SURFACE_ERROR_NONE;
+ return tbm_get_last_error();
}
int
ret = tbm_surface_internal_get_info(surface, 0, info, 0);
if (ret == 0)
- return TBM_SURFACE_ERROR_INVALID_OPERATION;
+ return tbm_get_last_error();
return TBM_SURFACE_ERROR_NONE;
}
{
TBM_TRACE_SURFACE("tbm_surface(%p)\n", surface);
- TBM_RETURN_VAL_IF_FAIL(surface, TBM_SURFACE_ERROR_INVALID_PARAMETER);
+ int width = 0;
+
+ _tbm_set_last_result(TBM_ERROR_NONE);
+
+ if (!surface) {
+#ifdef HAVE_CAPI_0_1_1
+ set_last_result(TBM_SURFACE_ERROR_INVALID_PARAMETER);
+#endif
+ _tbm_set_last_result(TBM_ERROR_INVALID_PARAMETER);
+ 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);
- TBM_RETURN_VAL_IF_FAIL(surface, TBM_SURFACE_ERROR_INVALID_PARAMETER);
+ int height = 0;
+
+ _tbm_set_last_result(TBM_ERROR_NONE);
- return tbm_surface_internal_get_height(surface);
+ if (!surface) {
+#ifdef HAVE_CAPI_0_1_1
+ set_last_result(TBM_SURFACE_ERROR_INVALID_PARAMETER);
+#endif
+ _tbm_set_last_result(TBM_ERROR_INVALID_PARAMETER);
+ 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 height;
}
tbm_format
{
TBM_TRACE_SURFACE("tbm_surface(%p)\n", surface);
+ _tbm_set_last_result(TBM_ERROR_NONE);
+
if (!surface) {
#ifdef HAVE_CAPI_0_1_1
set_last_result(TBM_SURFACE_ERROR_INVALID_PARAMETER);
#endif
+ _tbm_set_last_result(TBM_ERROR_INVALID_PARAMETER);
return 0;
}
+
#ifdef HAVE_CAPI_0_1_1
set_last_result(TBM_SURFACE_ERROR_NONE);
#endif
+
return tbm_surface_internal_get_format(surface);
}