ld: error: undefined symbol: wlr_backend_get_renderer
>>> referenced by output.c
>>>               labwc.p/src_output.c.o:(render_rect)
>>> referenced by output.c
>>>               labwc.p/src_output.c.o:(render_rect)
>>> referenced by output.c
>>>               labwc.p/src_output.c.o:(render_texture)
>>> referenced 5 more times

Based on 5865af75cf
Based on a6538ced35
This commit is contained in:
Jan Beich 2021-11-21 07:01:16 +00:00 committed by Johan Malm
parent 0a6ab7cd35
commit 3e5458fa24
3 changed files with 33 additions and 14 deletions

View file

@ -9,6 +9,7 @@
#include <unistd.h>
#include <wayland-server-core.h>
#include <wlr/backend.h>
#include <wlr/render/allocator.h>
#include <wlr/render/wlr_renderer.h>
#include <wlr/types/wlr_compositor.h>
#include <wlr/types/wlr_cursor.h>
@ -105,6 +106,7 @@ struct seat {
struct server {
struct wl_display *wl_display;
struct wlr_renderer *renderer;
struct wlr_allocator *allocator;
struct wlr_backend *backend;
struct wlr_xdg_shell *xdg_shell;

View file

@ -110,7 +110,7 @@ scale_box(struct wlr_box *box, float scale)
static void
scissor_output(struct wlr_output *output, pixman_box32_t *rect)
{
struct wlr_renderer *renderer = wlr_backend_get_renderer(output->backend);
struct wlr_renderer *renderer = output->renderer;
struct wlr_box box = {
.x = rect->x1,
@ -134,8 +134,7 @@ render_texture(struct wlr_output *wlr_output,
const struct wlr_fbox *src_box, const struct wlr_box *dst_box,
const float matrix[static 9])
{
struct wlr_renderer *renderer =
wlr_backend_get_renderer(wlr_output->backend);
struct wlr_renderer *renderer = wlr_output->renderer;
pixman_region32_t damage;
pixman_region32_init(&damage);
@ -364,8 +363,7 @@ render_rect(struct output *output, pixman_region32_t *output_damage,
const struct wlr_box *_box, float color[static 4])
{
struct wlr_output *wlr_output = output->wlr_output;
struct wlr_renderer *renderer =
wlr_backend_get_renderer(wlr_output->backend);
struct wlr_renderer *renderer = wlr_output->renderer;
struct wlr_box box;
memcpy(&box, _box, sizeof(struct wlr_box));
@ -748,8 +746,7 @@ output_render(struct output *output, pixman_region32_t *damage)
struct server *server = output->server;
struct wlr_output *wlr_output = output->wlr_output;
struct wlr_renderer *renderer =
wlr_backend_get_renderer(wlr_output->backend);
struct wlr_renderer *renderer = wlr_output->renderer;
if (!renderer) {
wlr_log(WLR_DEBUG, "no renderer");
return;
@ -945,6 +942,13 @@ new_output_notify(struct wl_listener *listener, void *data)
struct server *server = wl_container_of(listener, server, new_output);
struct wlr_output *wlr_output = data;
/* Configures the output created by the backend to use our allocator
* and our renderer. Must be done once, before commiting the output */
if (!wlr_output_init_render(wlr_output, server->allocator, server->renderer)) {
wlr_log(WLR_ERROR, "unable to init output renderer");
return;
}
/* The mode is a tuple of (width, height, refresh rate). */
wlr_log(WLR_DEBUG, "set preferred mode");
struct wlr_output_mode *preferred_mode =

View file

@ -185,15 +185,28 @@ server_init(struct server *server)
*/
drop_permissions();
/*
* If we don't provide a renderer, autocreate makes a GLES2 renderer
* for us. The renderer is responsible for defining the various pixel
* formats it supports for shared memory, this configures that for
* clients.
*/
server->renderer = wlr_backend_get_renderer(server->backend);
/* Autocreates a renderer, either Pixman, GLES2 or Vulkan for us. The user
* can also specify a renderer using the WLR_RENDERER env var.
* The renderer is responsible for defining the various pixel formats it
* supports for shared memory, this configures that for clients. */
server->renderer = wlr_renderer_autocreate(server->backend);
if (!server->renderer) {
wlr_log(WLR_ERROR, "unable to create renderer");
exit(EXIT_FAILURE);
}
wlr_renderer_init_wl_display(server->renderer, server->wl_display);
/* Autocreates an allocator for us.
* The allocator is the bridge between the renderer and the backend. It
* handles the buffer creation, allowing wlroots to render onto the
* screen */
server->allocator = wlr_allocator_autocreate(server->backend, server->renderer);
if (!server->allocator) {
wlr_log(WLR_ERROR, "unable to create allocator");
exit(EXIT_FAILURE);
}
wl_list_init(&server->views);
wl_list_init(&server->unmanaged_surfaces);