Cage: implement output transform

This commit adds the command line switch -r, which rotates the output 90
degrees clockwise and can be specified up to three times.
This commit is contained in:
Tristan Daniel 2019-04-14 01:50:12 +02:00 committed by Jente Hidskes
parent 69872baead
commit 9e6a5ad44f
4 changed files with 20 additions and 6 deletions

View file

@ -211,10 +211,7 @@ handle_output_damage_frame(struct wl_listener *listener, void *data)
goto damage_finish;
}
int output_width, output_height;
wlr_output_transformed_resolution(output->wlr_output, &output_width, &output_height);
wlr_renderer_begin(renderer, output_width, output_height);
wlr_renderer_begin(renderer, output->wlr_output->width, output->wlr_output->height);
if (!pixman_region32_not_empty(&damage)) {
wlr_log(WLR_DEBUG, "Output isn't damaged but needs a buffer swap");
@ -258,6 +255,9 @@ handle_output_damage_frame(struct wl_listener *listener, void *data)
wlr_renderer_scissor(renderer, NULL);
wlr_renderer_end(renderer);
int output_width, output_height;
wlr_output_transformed_resolution(output->wlr_output, &output_width, &output_height);
#ifdef DEBUG
if (output->server->debug_damage_tracking) {
pixman_region32_union_rect(&damage, &damage, 0, 0, output_width, output_height);
@ -366,6 +366,8 @@ handle_new_output(struct wl_listener *listener, void *data)
server->output->damage_destroy.notify = handle_output_damage_destroy;
wl_signal_add(&server->output->damage->events.destroy, &server->output->damage_destroy);
wlr_output_set_transform(wlr_output, server->output_transform);
wlr_output_layout_add_auto(server->output_layout, wlr_output);
/* Disconnect the signal now, because we only use one static output. */