return TPL_ERROR_NONE;
}
+tpl_result_t
+twe_surface_get_swapchain_buffers(twe_surface_h twe_surface,
+ tbm_surface_h *surfaces,
+ int *buffer_count)
+{
+ twe_wl_surf_source *surf_source = (twe_wl_surf_source *)twe_surface;
+ twe_wl_disp_source *disp_source = NULL;
+ int ret = 1;
+
+ if (!surf_source || g_source_is_destroyed(&surf_source->gsource)) {
+ TPL_ERR("twe_surface(%p) is invalid.", twe_surface);
+ return TPL_ERROR_INVALID_PARAMETER;
+ }
+
+ if (!surfaces) {
+ *buffer_count = tbm_surface_queue_get_size(surf_source->tbm_queue);
+ return TPL_ERROR_NONE;
+ }
+
+ disp_source = surf_source->disp_source;
+
+ ret = wayland_tbm_client_queue_get_surfaces(
+ disp_source->wl_tbm_client,
+ surf_source->tbm_queue,
+ surfaces, buffer_count);
+ if (!ret) {
+ TPL_ERR("Failed to get buffers from wl_tbm_client(%p) tbm_queue(%p)",
+ disp_source->wl_tbm_client, surf_source->tbm_queue);
+ return TPL_ERROR_INVALID_OPERATION;
+ }
+
+ return TPL_ERROR_NONE;
+}
tpl_result_t
twe_surface_set_rotate_callback(twe_surface_h twe_surface,
tpl_result_t
twe_surface_destroy_swapchain(twe_surface_h twe_surface);
+tpl_result_t
+twe_surface_get_swapchain_buffers(twe_surface_h twe_surface,
+ tbm_surface_h *surfaces,
+ int *buffer_count);
+
tbm_surface_queue_h
twe_surface_get_tbm_queue(twe_surface_h twe_surface);