output-layer: add cropping support

Add a src_box state field. Use the SRC_* KMS props in the DRM
backend, reject the layers in the Wayland backend (for now, we can
support it later via viewporter).
This commit is contained in:
Simon Ser 2023-04-20 10:39:46 +02:00
parent d795824346
commit 44069dfd5e
4 changed files with 23 additions and 4 deletions

View file

@ -294,6 +294,13 @@ static bool output_test(struct wlr_output *wlr_output,
height != layer_state->dst_box.height) {
supported = false;
}
if (!wlr_fbox_empty(&layer_state->src_box)) {
supported = supported &&
layer_state->src_box.x == 0 &&
layer_state->src_box.y == 0 &&
layer_state->src_box.width == width &&
layer_state->src_box.height == height;
}
supported = supported &&
test_buffer(output->backend, layer_state->buffer);
}