#include <libds/single_pixel_buffer_v1.h>
+#include "e_tbm_gbm_server.h"
#include "e_comp_wl_private.h"
typedef struct _E_Buffer E_Buffer;
}
static Eina_Bool
-_e_comp_wl_buffer_tbm_type_get(E_Comp_Wl_Buffer *base, struct wl_resource *resource,
+_e_comp_wl_buffer_tbm_type_get(E_Comp_Wl_Buffer *base, struct ds_buffer *ds_buffer,
E_Client *ec)
{
tbm_surface_h tsurface;
- struct gbm_bo *gbo;
- if (!base || !resource || !ec) return EINA_FALSE;
-
- tsurface = wayland_tbm_server_get_surface(e_comp_wl->tbm.server, resource);
- if (tsurface)
- {
- tbm_surface_internal_ref(tsurface);
- }
- else
- {
- if (!e_comp->e_comp_screen->gdevice) return EINA_FALSE;
-
- gbo = gbm_bo_import(e_comp->e_comp_screen->gdevice, GBM_BO_IMPORT_WL_BUFFER,
- resource, GBM_BO_USE_RENDERING);
- if (!gbo) return EINA_FALSE;
+ if (!base || !ds_buffer || !ec) return EINA_FALSE;
- tsurface = e_comp_wl_tbm_import_gbm_bo(gbo);
- if (!tsurface)
- {
- gbm_bo_destroy(gbo);
- return EINA_FALSE;
- }
-
- if (!e_comp_wl_tbm_gbm_bo_user_data_set(tsurface, gbo))
- {
- tbm_surface_destroy(tsurface);
- gbm_bo_destroy(gbo);
- return EINA_FALSE;
- }
- }
+ tsurface = e_tbm_gbm_server_tbm_surface_get_from_buffer(ds_buffer);
+ if (!tsurface)
+ return EINA_FALSE;
if ((ec) && (ec->comp_data->video_client))
{
}
else
{
- res = _e_comp_wl_buffer_tbm_type_get(base, resource, ec);
+ res = _e_comp_wl_buffer_tbm_type_get(base, ds_buffer, ec);
EINA_SAFETY_ON_FALSE_GOTO(res, err);
}
}
else
{
- res = _e_comp_wl_buffer_tbm_type_get(base, resource, ec);
+ res = _e_comp_wl_buffer_tbm_type_get(base, ds_buffer, ec);
if (!res && e_comp->gl)
res = _e_comp_wl_buffer_native_type_get(base,resource, ec);
/* remove debug info */
eina_stringshare_del(base->debug_info.owner_name);
- if (base->tbm_surface) tbm_surface_internal_unref(base->tbm_surface);
-
if (base->buffer_release)
e_explicit_sync_buffer_release_destroy(base->buffer_release);