render/pixel-format: add support for block-based formats

Some formats like sub-sampled YCbCr use a block of bytes to
store the color values for more than one pixel. Update our format
table to be able to handle such formats.
This commit is contained in:
Simon Ser 2023-05-08 22:17:26 +02:00
parent 78a1ac540e
commit 96f3f3c92e
9 changed files with 117 additions and 56 deletions

View file

@ -550,7 +550,7 @@ static void capture_output(struct wl_client *wl_client,
}
frame->box = buffer_box;
frame->shm_stride = (shm_info->bpp / 8) * buffer_box.width;
frame->shm_stride = pixel_format_info_min_stride(shm_info, buffer_box.width);
zwlr_screencopy_frame_v1_send_buffer(frame->resource,
convert_drm_format_to_wl_shm(frame->shm_format),