return &dri2_img->base;
}
+static struct wl_buffer*
+dri2_create_wayland_buffer_from_image(_EGLDriver *drv, _EGLDisplay *dpy,
+ _EGLImage *img)
+{
+ struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
+ return dri2_dpy->vtbl->create_wayland_buffer_from_image(drv, dpy, img);
+}
+
#ifdef HAVE_DRM_PLATFORM
static EGLBoolean
dri2_check_dma_buf_attribs(const _EGLImageAttribs *attrs)
dri2_drv->base.API.QueryBufferAge = dri2_query_buffer_age;
dri2_drv->base.API.CreateImageKHR = dri2_create_image_khr;
dri2_drv->base.API.DestroyImageKHR = dri2_destroy_image_khr;
+ dri2_drv->base.API.CreateWaylandBufferFromImageWL = dri2_create_wayland_buffer_from_image;
#ifdef HAVE_DRM_PLATFORM
dri2_drv->base.API.CreateDRMImageMESA = dri2_create_drm_image_mesa;
dri2_drv->base.API.ExportDRMImageMESA = dri2_export_drm_image_mesa;
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
+struct wl_buffer;
+
struct dri2_egl_driver
{
_EGLDriver base;
EGLint (*query_buffer_age)(_EGLDriver *drv, _EGLDisplay *dpy,
_EGLSurface *surf);
+
+ struct wl_buffer* (*create_wayland_buffer_from_image)(
+ _EGLDriver *drv, _EGLDisplay *dpy, _EGLImage *img);
};
struct dri2_egl_display
#include "egltypedefs.h"
+struct wl_buffer;
+
static inline _EGLSurface *
dri2_fallback_create_pixmap_surface(_EGLDriver *drv, _EGLDisplay *disp,
_EGLConfig *conf,
{
return 0;
}
+
+static inline struct wl_buffer*
+dri2_fallback_create_wayland_buffer_from_image(_EGLDriver *drv,
+ _EGLDisplay *dpy,
+ _EGLImage *img)
+{
+ return NULL;
+}
.post_sub_buffer = dri2_fallback_post_sub_buffer,
.copy_buffers = dri2_fallback_copy_buffers,
.query_buffer_age = dri2_fallback_query_buffer_age,
+ .create_wayland_buffer_from_image = dri2_fallback_create_wayland_buffer_from_image,
};
EGLBoolean
.post_sub_buffer = dri2_fallback_post_sub_buffer,
.copy_buffers = dri2_fallback_copy_buffers,
.query_buffer_age = dri2_drm_query_buffer_age,
+ .create_wayland_buffer_from_image = dri2_fallback_create_wayland_buffer_from_image,
};
EGLBoolean
}
static struct wl_buffer *
-dri2_wl_create_wayland_buffer_from_image_wl(_EGLDriver *drv,
- _EGLDisplay *disp,
- _EGLImage *img)
+dri2_wl_create_wayland_buffer_from_image(_EGLDriver *drv,
+ _EGLDisplay *disp,
+ _EGLImage *img)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_image *dri2_img = dri2_egl_image(img);
.post_sub_buffer = dri2_fallback_post_sub_buffer,
.copy_buffers = dri2_fallback_copy_buffers,
.query_buffer_age = dri2_wl_query_buffer_age,
+ .create_wayland_buffer_from_image = dri2_wl_create_wayland_buffer_from_image,
};
EGLBoolean
loader_set_logger(_eglLog);
- drv->API.CreateWaylandBufferFromImageWL =
- dri2_wl_create_wayland_buffer_from_image_wl;
-
dri2_dpy = calloc(1, sizeof *dri2_dpy);
if (!dri2_dpy)
return _eglError(EGL_BAD_ALLOC, "eglInitialize");
.post_sub_buffer = dri2_fallback_post_sub_buffer,
.copy_buffers = dri2_x11_copy_buffers,
.query_buffer_age = dri2_fallback_query_buffer_age,
+ .create_wayland_buffer_from_image = dri2_fallback_create_wayland_buffer_from_image,
};
static struct dri2_egl_display_vtbl dri2_x11_display_vtbl = {
.post_sub_buffer = dri2_x11_post_sub_buffer,
.copy_buffers = dri2_x11_copy_buffers,
.query_buffer_age = dri2_fallback_query_buffer_age,
+ .create_wayland_buffer_from_image = dri2_fallback_create_wayland_buffer_from_image,
};
static EGLBoolean