diff options
author | emersion <contact@emersion.fr> | 2018-05-25 13:54:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-25 13:54:16 +0100 |
commit | 6eb4b5b54d8640115764401822787c6e9c88697c (patch) | |
tree | c57602b7f8e910f974805f980629e2747a53f90b /render/wlr_renderer.c | |
parent | 35b31dcfb7f54c08301c4eb352325bb852b1bece (diff) | |
parent | 41130fe54bfed6c3a5171bbc225143c32cbefc70 (diff) |
Merge pull request #993 from emersion/bind-wl-drm-in-renderer
render: bind wl_drm in renderer
Diffstat (limited to 'render/wlr_renderer.c')
-rw-r--r-- | render/wlr_renderer.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/render/wlr_renderer.c b/render/wlr_renderer.c index 39006b58..aed821c9 100644 --- a/render/wlr_renderer.c +++ b/render/wlr_renderer.c @@ -159,9 +159,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; } @@ -174,11 +174,16 @@ 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); + } } struct wlr_renderer *wlr_renderer_autocreate(struct wlr_egl *egl, |