Update for wlroots multi renderer

This commit is contained in:
emersion 2018-05-04 20:59:05 +01:00
parent fbcbbb976c
commit 5503601273
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
2 changed files with 10 additions and 3 deletions

View file

@ -4,6 +4,7 @@
#include <strings.h>
#include <time.h>
#include <wayland-server.h>
#include <wlr/render/multi.h>
#include <wlr/render/wlr_renderer.h>
#include <wlr/types/wlr_box.h>
#include <wlr/types/wlr_matrix.h>
@ -191,6 +192,13 @@ static void render_surface_iterator(struct wlr_surface *surface, int sx, int sy,
return;
}
struct wlr_texture *texture =
wlr_multi_texture_get_child(surface->texture, renderer);
if (!sway_assert(texture != NULL,
"expected the texture to be uploaded to the output renderer")) {
return;
}
scale_box(&box, wlr_output->scale);
float matrix[9];
@ -199,8 +207,7 @@ static void render_surface_iterator(struct wlr_surface *surface, int sx, int sy,
wlr_matrix_project_box(matrix, &box, transform, rotation,
wlr_output->transform_matrix);
wlr_render_texture_with_matrix(renderer, surface->texture,
matrix, alpha);
wlr_render_texture_with_matrix(renderer, texture, matrix, alpha);
}
static void render_layer(struct sway_output *output,

View file

@ -51,7 +51,7 @@ bool server_init(struct sway_server *server) {
struct wlr_renderer *renderer = wlr_backend_get_renderer(server->backend);
assert(renderer);
wlr_renderer_init_wl_shm(renderer, server->wl_display);
wlr_renderer_init_wl_display(renderer, server->wl_display);
server->compositor = wlr_compositor_create(server->wl_display, renderer);
server->data_device_manager =