aboutsummaryrefslogtreecommitdiff
path: root/include/wlr/render
diff options
context:
space:
mode:
authorIsaac Freund <ifreund@ifreund.xyz>2020-03-23 14:32:27 +0100
committerSimon Ser <contact@emersion.fr>2020-03-23 15:19:16 +0100
commitc682d97841235cc328f044a4e2f2272f7a32b226 (patch)
treea92949600285a76af28bddda4a9f0ce410fd40e3 /include/wlr/render
parent34303e1b47defc7aca518983ac3aaea6c881d112 (diff)
Return failure of wlr_renderer_init_wl_display()
This makes it easier for the user of this library to properly handle failure of this function. The signature of wlr_renderer_impl.init_wl_display was also modified to allow for proper error propagation.
Diffstat (limited to 'include/wlr/render')
-rw-r--r--include/wlr/render/interface.h2
-rw-r--r--include/wlr/render/wlr_renderer.h7
2 files changed, 7 insertions, 2 deletions
diff --git a/include/wlr/render/interface.h b/include/wlr/render/interface.h
index 4e992077..6936afa3 100644
--- a/include/wlr/render/interface.h
+++ b/include/wlr/render/interface.h
@@ -62,7 +62,7 @@ struct wlr_renderer_impl {
struct wlr_texture *(*texture_from_dmabuf)(struct wlr_renderer *renderer,
struct wlr_dmabuf_attributes *attribs);
void (*destroy)(struct wlr_renderer *renderer);
- void (*init_wl_display)(struct wlr_renderer *renderer,
+ bool (*init_wl_display)(struct wlr_renderer *renderer,
struct wl_display *wl_display);
};
diff --git a/include/wlr/render/wlr_renderer.h b/include/wlr/render/wlr_renderer.h
index 54e6506e..db543bef 100644
--- a/include/wlr/render/wlr_renderer.h
+++ b/include/wlr/render/wlr_renderer.h
@@ -109,7 +109,12 @@ bool wlr_renderer_read_pixels(struct wlr_renderer *r, enum wl_shm_format fmt,
*/
bool wlr_renderer_format_supported(struct wlr_renderer *r,
enum wl_shm_format fmt);
-void wlr_renderer_init_wl_display(struct wlr_renderer *r,
+/**
+ * Creates necessary shm and invokes the initialization of the implementation.
+ *
+ * Returns false on failure.
+ */
+bool wlr_renderer_init_wl_display(struct wlr_renderer *r,
struct wl_display *wl_display);
/**