From 41130fe54bfed6c3a5171bbc225143c32cbefc70 Mon Sep 17 00:00:00 2001 From: emersion Date: Mon, 21 May 2018 19:07:08 +0100 Subject: render: bind wl_drm in renderer --- render/wlr_renderer.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'render/wlr_renderer.c') diff --git a/render/wlr_renderer.c b/render/wlr_renderer.c index 8d1bd9ce..6407e1ec 100644 --- a/render/wlr_renderer.c +++ b/render/wlr_renderer.c @@ -158,9 +158,9 @@ bool wlr_renderer_format_supported(struct wlr_renderer *r, return r->impl->format_supported(r, fmt); } -void wlr_renderer_init_wl_shm(struct wlr_renderer *r, - struct wl_display *display) { - if (wl_display_init_shm(display)) { +void wlr_renderer_init_wl_display(struct wlr_renderer *r, + struct wl_display *wl_display) { + if (wl_display_init_shm(wl_display)) { wlr_log(L_ERROR, "Failed to initialize shm"); return; } @@ -173,9 +173,14 @@ void wlr_renderer_init_wl_shm(struct wlr_renderer *r, } for (size_t i = 0; i < len; ++i) { + // These formats are already added by default if (formats[i] != WL_SHM_FORMAT_ARGB8888 && formats[i] != WL_SHM_FORMAT_XRGB8888) { - wl_display_add_shm_format(display, formats[i]); + wl_display_add_shm_format(wl_display, formats[i]); } } + + if (r->impl->init_wl_display) { + r->impl->init_wl_display(r, wl_display); + } } -- cgit v1.2.3