mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-15 06:59:43 -05:00
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:
parent
78a1ac540e
commit
96f3f3c92e
9 changed files with 117 additions and 56 deletions
|
|
@ -71,8 +71,7 @@ static struct wlr_buffer *allocator_create_buffer(
|
|||
wlr_buffer_init(&buffer->base, &buffer_impl, width, height);
|
||||
|
||||
// TODO: consider using a single file for multiple buffers
|
||||
int bytes_per_pixel = info->bpp / 8;
|
||||
int stride = width * bytes_per_pixel; // TODO: align?
|
||||
int stride = pixel_format_info_min_stride(info, width); // TODO: align?
|
||||
buffer->size = stride * height;
|
||||
buffer->shm.fd = allocate_shm_file(buffer->size);
|
||||
if (buffer->shm.fd < 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue