Etaash Mathamsetty (@etaash.mathamsetty) commented about dlls/winewayland.drv/wayland_surface.c:
BITMAP bm; - unsigned int *ptr, *bits = NULL; + unsigned int *ptr, *bits = NULL, *non_square_bits; unsigned char *mask_bits = NULL; - int i, j; + int i, j, square_length, actual_width, actual_height; BOOL has_alpha = FALSE;
if (!NtGdiExtGetObjectW(color, sizeof(bm), &bm)) goto failed;
- shm_buffer = wayland_shm_buffer_create(bm.bmWidth, bm.bmHeight, + square_length = max(bm.bmWidth, bm.bmHeight); + + if (force_square) + { + actual_width = square_length;
`wayland_shm_buffer` structure has fields for width and height you can use to avoid storing duplicates. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9868#note_127157