EAPI void ecore_wl2_window_damage(Ecore_Wl2_Window *window, Eina_Rectangle *rects, unsigned int count);
-EAPI Eina_Bool ecore_wl2_buffer_init(Ecore_Wl2_Buffer_Type types);
+EAPI Eina_Bool ecore_wl2_buffer_init(Ecore_Wl2_Display *ewd, Ecore_Wl2_Buffer_Type types);
EAPI Ecore_Wl2_Buffer *ecore_wl2_buffer_create(Ecore_Wl2_Display *ewd, int w, int h, Eina_Bool alpha);
EAPI void ecore_wl2_buffer_destroy(Ecore_Wl2_Buffer *b);
EAPI struct wl_buffer *ecore_wl2_buffer_wl_buffer_get(Ecore_Wl2_Display *ewd, Ecore_Wl2_Buffer *buf);
}
EAPI Eina_Bool
-ecore_wl2_buffer_init(Ecore_Wl2_Buffer_Type types)
+ecore_wl2_buffer_init(Ecore_Wl2_Display *ewd, Ecore_Wl2_Buffer_Type types)
{
int fd;
- Eina_Bool dmabuf = types & ECORE_WL2_BUFFER_DMABUF;
- Eina_Bool shm = types & ECORE_WL2_BUFFER_SHM;
+ Eina_Bool dmabuf = ewd->wl.dmabuf && (types & ECORE_WL2_BUFFER_DMABUF);
+ Eina_Bool shm = ewd->wl.shm && (types & ECORE_WL2_BUFFER_SHM);
Eina_Bool success = EINA_FALSE;
if (buffer_manager)
Eina_Bool
_evas_dmabuf_surface_create(Surface *s, int w, int h, int num_buff)
{
+ Ecore_Wl2_Display *ewd;
Ecore_Wl2_Buffer_Type types = 0;
Dmabuf_Surface *surf = NULL;
int i = 0;
- if (ecore_wl2_display_shm_get(s->info->info.wl2_display))
+ ewd = s->info->info.wl2_display;
+ if (ecore_wl2_display_shm_get(ewd))
types |= ECORE_WL2_BUFFER_SHM;
- if (ecore_wl2_display_dmabuf_get(s->info->info.wl2_display))
+ if (ecore_wl2_display_dmabuf_get(ewd))
types |= ECORE_WL2_BUFFER_DMABUF;
if (!(s->surf.dmabuf = calloc(1, sizeof(Dmabuf_Surface)))) return EINA_FALSE;
surf->buffer = calloc(surf->nbuf, sizeof(Ecore_Wl2_Buffer *));
if (!surf->buffer) goto err;
- if (!ecore_wl2_buffer_init(types)) goto err;
+ if (!ecore_wl2_buffer_init(ewd, types)) goto err;
if (w && h)
{