{
struct dri3_egl_surface *dri3_surf = loader_drawable_to_egl_surface(draw);
- dri3_surf->base.Width = width;
- dri3_surf->base.Height = height;
+ dri3_surf->surf.base.Width = width;
+ dri3_surf->surf.base.Height = height;
}
static bool
struct dri3_egl_surface *dri3_surf = loader_drawable_to_egl_surface(draw);
_EGLContext *ctx = _eglGetCurrentContext();
- return ctx->Resource.Display == dri3_surf->base.Resource.Display;
+ return ctx->Resource.Display == dri3_surf->surf.base.Resource.Display;
}
static __DRIcontext *
return dri2_ctx->dri_context;
}
+static __DRIscreen *
+egl_dri3_get_dri_screen(void)
+{
+ _EGLContext *ctx = _eglGetCurrentContext();
+ struct dri2_egl_context *dri2_ctx;
+ if (!ctx)
+ return NULL;
+ dri2_ctx = dri2_egl_context(ctx);
+ return dri2_egl_display(dri2_ctx->base.Resource.Display)->dri_screen;
+}
+
static void
egl_dri3_flush_drawable(struct loader_dri3_drawable *draw, unsigned flags)
{
struct dri3_egl_surface *dri3_surf = loader_drawable_to_egl_surface(draw);
- _EGLDisplay *disp = dri3_surf->base.Resource.Display;
+ _EGLDisplay *disp = dri3_surf->surf.base.Resource.Display;
- dri2_flush_drawable_for_swapbuffers(disp, &dri3_surf->base);
+ dri2_flush_drawable_for_swapbuffers(disp, &dri3_surf->surf.base);
}
static const struct loader_dri3_vtable egl_dri3_vtable = {
.set_drawable_size = egl_dri3_set_drawable_size,
.in_current_context = egl_dri3_in_current_context,
.get_dri_context = egl_dri3_get_dri_context,
+ .get_dri_screen = egl_dri3_get_dri_screen,
.flush_drawable = egl_dri3_flush_drawable,
.show_fps = NULL,
};
{
struct dri3_egl_surface *dri3_surf = dri3_egl_surface(surf);
- dri3_surf->base.SwapInterval = interval;
+ dri3_surf->surf.base.SwapInterval = interval;
loader_dri3_set_swap_interval(&dri3_surf->loader_drawable, interval);
return EGL_TRUE;
return NULL;
}
- if (!dri2_init_surface(&dri3_surf->base, disp, type, conf, attrib_list, false))
+ if (!dri2_init_surface(&dri3_surf->surf.base, disp, type, conf, attrib_list, false))
goto cleanup_surf;
if (type == EGL_PBUFFER_BIT) {
drawable = xcb_generate_id(dri2_dpy->conn);
xcb_create_pixmap(dri2_dpy->conn, conf->BufferSize,
drawable, dri2_dpy->screen->root,
- dri3_surf->base.Width, dri3_surf->base.Height);
+ dri3_surf->surf.base.Width, dri3_surf->surf.base.Height);
} else {
STATIC_ASSERT(sizeof(uintptr_t) == sizeof(native_surface));
drawable = (uintptr_t) native_surface;
}
dri_config = dri2_get_dri_config(dri2_conf, type,
- dri3_surf->base.GLColorspace);
+ dri3_surf->surf.base.GLColorspace);
if (loader_dri3_drawable_init(dri2_dpy->conn, drawable,
dri2_dpy->dri_screen,
goto cleanup_pixmap;
}
- return &dri3_surf->base;
+ return &dri3_surf->surf.base;
cleanup_pixmap:
if (type == EGL_PBUFFER_BIT)
case 24:
format = __DRI_IMAGE_FORMAT_XRGB8888;
break;
+ case 30:
+ format = __DRI_IMAGE_FORMAT_XRGB2101010;
+ break;
case 32:
format = __DRI_IMAGE_FORMAT_ARGB8888;
break;
dri2_img = malloc(sizeof *dri2_img);
if (!dri2_img) {
_eglError(EGL_BAD_ALLOC, "dri3_create_image_khr");
+ free(bp_reply);
return EGL_NO_IMAGE_KHR;
}
_EGLContext *ctx, EGLenum target,
EGLClientBuffer buffer, const EGLint *attr_list)
{
- (void) drv;
-
switch (target) {
case EGL_NATIVE_PIXMAP_KHR:
return dri3_create_image_khr_pixmap(disp, ctx, buffer, attr_list);