diff options
author | Simon Zeni <simon@bl4ckb0ne.ca> | 2021-11-15 13:32:52 -0500 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2021-11-18 17:47:19 +0100 |
commit | 5865af75cf8029cc703cda36b68daafcb658c97b (patch) | |
tree | 0446444369c63c05109ffab3c027127ac19da17f /sway/desktop | |
parent | container: fix surface_is_popup() (diff) | |
download | sway-5865af75cf8029cc703cda36b68daafcb658c97b.tar.gz sway-5865af75cf8029cc703cda36b68daafcb658c97b.tar.zst sway-5865af75cf8029cc703cda36b68daafcb658c97b.zip |
sway: create wlr_renderer and wlr_allocator
wlroots now required the compositor to create its own wlr_renderer and
wlr_allocator to initialize the wlr_output
Diffstat (limited to 'sway/desktop')
-rw-r--r-- | sway/desktop/output.c | 6 | ||||
-rw-r--r-- | sway/desktop/render.c | 16 |
2 files changed, 10 insertions, 12 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c index edec71ad..cd9fd3a6 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c | |||
@@ -850,6 +850,12 @@ void handle_new_output(struct wl_listener *listener, void *data) { | |||
850 | return; | 850 | return; |
851 | } | 851 | } |
852 | 852 | ||
853 | if (!wlr_output_init_render(wlr_output, server->allocator, | ||
854 | server->renderer)) { | ||
855 | sway_log(SWAY_ERROR, "Failed to init output render"); | ||
856 | return; | ||
857 | } | ||
858 | |||
853 | struct sway_output *output = output_create(wlr_output); | 859 | struct sway_output *output = output_create(wlr_output); |
854 | if (!output) { | 860 | if (!output) { |
855 | return; | 861 | return; |
diff --git a/sway/desktop/render.c b/sway/desktop/render.c index 17fc8f6f..6c8c77ed 100644 --- a/sway/desktop/render.c +++ b/sway/desktop/render.c | |||
@@ -52,7 +52,7 @@ static int scale_length(int length, int offset, float scale) { | |||
52 | 52 | ||
53 | static void scissor_output(struct wlr_output *wlr_output, | 53 | static void scissor_output(struct wlr_output *wlr_output, |
54 | pixman_box32_t *rect) { | 54 | pixman_box32_t *rect) { |
55 | struct wlr_renderer *renderer = wlr_backend_get_renderer(wlr_output->backend); | 55 | struct wlr_renderer *renderer = wlr_output->renderer; |
56 | assert(renderer); | 56 | assert(renderer); |
57 | 57 | ||
58 | struct wlr_box box = { | 58 | struct wlr_box box = { |
@@ -100,8 +100,7 @@ static void render_texture(struct wlr_output *wlr_output, | |||
100 | pixman_region32_t *output_damage, struct wlr_texture *texture, | 100 | pixman_region32_t *output_damage, struct wlr_texture *texture, |
101 | const struct wlr_fbox *src_box, const struct wlr_box *dst_box, | 101 | const struct wlr_fbox *src_box, const struct wlr_box *dst_box, |
102 | const float matrix[static 9], float alpha) { | 102 | const float matrix[static 9], float alpha) { |
103 | struct wlr_renderer *renderer = | 103 | struct wlr_renderer *renderer = wlr_output->renderer; |
104 | wlr_backend_get_renderer(wlr_output->backend); | ||
105 | struct sway_output *output = wlr_output->data; | 104 | struct sway_output *output = wlr_output->data; |
106 | 105 | ||
107 | pixman_region32_t damage; | 106 | pixman_region32_t damage; |
@@ -218,8 +217,7 @@ void render_rect(struct sway_output *output, | |||
218 | pixman_region32_t *output_damage, const struct wlr_box *_box, | 217 | pixman_region32_t *output_damage, const struct wlr_box *_box, |
219 | float color[static 4]) { | 218 | float color[static 4]) { |
220 | struct wlr_output *wlr_output = output->wlr_output; | 219 | struct wlr_output *wlr_output = output->wlr_output; |
221 | struct wlr_renderer *renderer = | 220 | struct wlr_renderer *renderer = wlr_output->renderer; |
222 | wlr_backend_get_renderer(wlr_output->backend); | ||
223 | 221 | ||
224 | struct wlr_box box; | 222 | struct wlr_box box; |
225 | memcpy(&box, _box, sizeof(struct wlr_box)); | 223 | memcpy(&box, _box, sizeof(struct wlr_box)); |
@@ -1013,13 +1011,7 @@ static void render_seatops(struct sway_output *output, | |||
1013 | void output_render(struct sway_output *output, struct timespec *when, | 1011 | void output_render(struct sway_output *output, struct timespec *when, |
1014 | pixman_region32_t *damage) { | 1012 | pixman_region32_t *damage) { |
1015 | struct wlr_output *wlr_output = output->wlr_output; | 1013 | struct wlr_output *wlr_output = output->wlr_output; |
1016 | 1014 | struct wlr_renderer *renderer = output->server->renderer; | |
1017 | struct wlr_renderer *renderer = | ||
1018 | wlr_backend_get_renderer(wlr_output->backend); | ||
1019 | if (!sway_assert(renderer != NULL, | ||
1020 | "expected the output backend to have a renderer")) { | ||
1021 | return; | ||
1022 | } | ||
1023 | 1015 | ||
1024 | struct sway_workspace *workspace = output->current.active_workspace; | 1016 | struct sway_workspace *workspace = output->current.active_workspace; |
1025 | if (workspace == NULL) { | 1017 | if (workspace == NULL) { |