scene: Apply output offset for direct scanout

When setting the primary buffer location for direct scanout, subtract
the offset of that output to put the buffer location in output-relative
coordinates.

Fixes #3910
This commit is contained in:
David Turner 2024-10-24 11:09:57 +01:00
parent 0ba1982488
commit e51ce333bc
2 changed files with 9 additions and 6 deletions

View file

@ -96,11 +96,13 @@ struct wlr_output_state {
struct wlr_buffer *buffer;
// Source crop for the buffer. If all zeros then no crop is applied.
// As usual with source crop, this is in buffer coordinates.
// Double-buffered by WLR_OUTPUT_STATE_BUFFER along with `buffer`.
struct wlr_fbox buffer_src_box;
// Destination rect to scale the buffer to (after source crop). If width
// and height are zero then the buffer is displayed at native size.
// Double-buffered by WLR_OUTPUT_STATE_BUFFER along with `buffer`.
// and height are zero then the buffer is displayed at native size. The
// offset is relative to the origin of this output. Double-buffered by
// WLR_OUTPUT_STATE_BUFFER along with `buffer`.
struct wlr_box buffer_dst_box;
/* Request a tearing page-flip. When enabled, this may cause the output to