renderlayersurface(struct wlr_surface *surface, int sx, int sy, void *data)
{
LayerSurface *layersurface = data;
struct wlr_texture *texture = wlr_surface_get_texture(surface);
struct wlr_output *output;
double ox = 0, oy = 0;
enum wl_output_transform transform;
struct wlr_box box;
float matrix[9];
struct timespec now;
if (!texture) {
return;
}
output = layersurface->layer_surface->output;
wlr_output_layout_output_coords(output_layout, output, &ox, &oy);
ox += layersurface->geo.x + sx, oy += layersurface->geo.y + sy;
transform = wlr_output_transform_invert(surface->current.transform);
memcpy(&box, &layersurface->geo, sizeof(struct wlr_box));
wlr_matrix_project_box(matrix, &box, transform, 0,
output->transform_matrix);
wlr_render_texture_with_matrix(drw, texture, matrix, 1);
clock_gettime(CLOCK_MONOTONIC, &now);
wlr_surface_send_frame_done(surface, &now);
}
void