aboutsummaryrefslogtreecommitdiff
path: root/backend/x11
diff options
context:
space:
mode:
authorSimon Zeni <simon@bl4ckb0ne.ca>2021-04-21 21:29:33 -0400
committerSimon Ser <contact@emersion.fr>2021-04-28 20:55:57 +0200
commita8c91fbac9cad234fc074a9a7fea30bb7fb14489 (patch)
tree12041fe1fb8cad7520e3466a8ef0d1de3cca7f1d /backend/x11
parentc75aa71816826907805606a108626b4671120a7e (diff)
render/shm_allocator: make wlr_shm_allocator_create return a wlr_allocator
Diffstat (limited to 'backend/x11')
-rw-r--r--backend/x11/backend.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/backend/x11/backend.c b/backend/x11/backend.c
index 06bbfc6c..743f19ff 100644
--- a/backend/x11/backend.c
+++ b/backend/x11/backend.c
@@ -622,22 +622,20 @@ struct wlr_backend *wlr_x11_backend_create(struct wl_display *display,
goto error_event;
}
- struct wlr_allocator *alloc = wlr_gbm_allocator_create(drm_fd);
- if (alloc == NULL) {
+ x11->allocator = wlr_gbm_allocator_create(drm_fd);
+ if (x11->allocator == NULL) {
wlr_log(WLR_ERROR, "Failed to create GBM allocator");
close(drm_fd);
goto error_event;
}
- x11->allocator = alloc;
pixmap_formats = &x11->dri3_formats;
} else if (x11->have_shm) {
x11->drm_fd = -1;
- struct wlr_shm_allocator *shm_alloc = wlr_shm_allocator_create();
- if (shm_alloc == NULL) {
+ x11->allocator = wlr_shm_allocator_create();
+ if (x11->allocator == NULL) {
wlr_log(WLR_ERROR, "Failed to create shared memory allocator");
goto error_event;
}
- x11->allocator = &shm_alloc->base;
pixmap_formats = &x11->shm_formats;
} else {
wlr_log(WLR_ERROR,