native_create_display(void *dpy, boolean use_sw, void *user_data)
{
struct wayland_display *display = NULL;
+ boolean own_dpy = FALSE;
use_sw = use_sw || debug_get_bool_option("EGL_SOFTWARE", FALSE);
+ if (dpy == NULL) {
+ dpy = wl_display_connect(NULL);
+ if (dpy == NULL)
+ return NULL;
+ own_dpy = TRUE;
+ }
+
if (use_sw) {
_eglLog(_EGL_INFO, "use software fallback");
display = wayland_create_shm_display((struct wl_display *) dpy,
display->base.create_window_surface = wayland_create_window_surface;
display->base.create_pixmap_surface = wayland_create_pixmap_surface;
+ display->own_dpy = own_dpy;
+
return &display->base;
}