From cf43a447cbea8958928813e0cc6e5d6348e0afea Mon Sep 17 00:00:00 2001 From: David Turner Date: Thu, 24 Oct 2024 18:32:44 +0100 Subject: [PATCH] scene: Transform coordinates for direct scanout We support direct scanout when there is an output and buffer transform so long as the transforms are the same (so cancel out for the buffer contents). But we still need to apply the output transform to the destination box location and size. --- types/scene/wlr_scene.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/types/scene/wlr_scene.c b/types/scene/wlr_scene.c index e4d68654a..766189485 100644 --- a/types/scene/wlr_scene.c +++ b/types/scene/wlr_scene.c @@ -1865,10 +1865,12 @@ static bool scene_entry_try_direct_scanout(struct render_list_entry *entry, pending.buffer_src_box = buffer->src_box; } - // Translate the location from scene coordinates to output coordinates + // Translate the position from scene coordinates to output coordinates pending.buffer_dst_box.x = entry->x - scene_output->x; pending.buffer_dst_box.y = entry->y - scene_output->y; + scene_node_get_size(node, &pending.buffer_dst_box.width, &pending.buffer_dst_box.height); + transform_output_box(&pending.buffer_dst_box, data); wlr_output_state_set_buffer(&pending, buffer->buffer); if (buffer->wait_timeline != NULL) {