tdm_helper_clear_buffer(tbm_surface_h buffer);
/**
+ * @brief Get the buffer full size.
+ * @details
+ * In some hardware, the buffer width or height is aligned with the fixed size.
+ * eg. 8, 16, etc. In this case, the real size of buffer could be bigger than
+ * the buffer size of tbm_surface_info_s.
+ * @param[in] buffer A TDM buffer
+ */
+void
+tdm_helper_get_buffer_full_size(tbm_surface_h buffer, int *buffer_w, int *buffer_h);
+
+/**
* @brief convert the source buffer to the destination buffer with given rectangles
* trannsform
* @details
tdm_helper_clear_buffer_pos(buffer, NULL);
}
+EXTERN void
+tdm_helper_get_buffer_full_size(tbm_surface_h buffer, int *buffer_w, int *buffer_h)
+{
+ tbm_surface_info_s info;
+ int ret;
+
+ TDM_RETURN_IF_FAIL(buffer != NULL);
+
+ ret = tbm_surface_get_info(buffer, &info);
+ TDM_RETURN_IF_FAIL(ret == TBM_SURFACE_ERROR_NONE);
+
+ if (buffer_w) {
+ if (IS_RGB(info.format))
+ *buffer_w = info.planes[0].stride >> 2;
+ else
+ *buffer_w = info.planes[0].stride;
+ }
+
+ if (buffer_h)
+ *buffer_h = info.planes[0].size / info.planes[0].stride;
+}
+
static pixman_format_code_t
_tdm_helper_pixman_format_get(tbm_format format)
{