st/eglwayland: Add support for EGL_DEFAULT_DISPLAY
This commit is contained in:

committed by
Kristian Høgsberg

parent
b8325fd255
commit
a23bf646bd
@@ -98,6 +98,8 @@ wayland_drm_display_destroy(struct native_display *ndpy)
|
||||
FREE(drmdpy->device_name);
|
||||
if (drmdpy->base.config)
|
||||
FREE(drmdpy->base.config);
|
||||
if (drmdpy->base.own_dpy)
|
||||
wl_display_destroy(drmdpy->base.dpy);
|
||||
|
||||
ndpy_uninit(ndpy);
|
||||
|
||||
|
@@ -65,6 +65,8 @@ wayland_shm_display_destroy(struct native_display *ndpy)
|
||||
|
||||
if (shmdpy->base.config)
|
||||
FREE(shmdpy->base.config);
|
||||
if (shmdpy->base.own_dpy)
|
||||
wl_display_destroy(shmdpy->base.dpy);
|
||||
|
||||
ndpy_uninit(ndpy);
|
||||
|
||||
|
@@ -459,9 +459,17 @@ static struct native_display *
|
||||
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,
|
||||
@@ -482,6 +490,8 @@ native_create_display(void *dpy, boolean use_sw, void *user_data)
|
||||
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;
|
||||
}
|
||||
|
||||
|
@@ -41,6 +41,7 @@ struct wayland_display {
|
||||
|
||||
struct wayland_config *config;
|
||||
struct wl_display *dpy;
|
||||
boolean own_dpy;
|
||||
|
||||
struct wl_buffer *(*create_buffer)(struct wayland_display *display,
|
||||
struct wayland_surface *surface,
|
||||
|
Reference in New Issue
Block a user