summaryrefslogtreecommitdiff
path: root/lib/mesa/src/gallium/winsys/sw/gdi/gdi_sw_winsys.c
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2024-04-02 09:30:07 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2024-04-02 09:30:07 +0000
commitf54e142455cb3c9d1662dae7e096a32a47e5409b (patch)
tree440ecd46269f0eac25e349e1ed58f246490c5e26 /lib/mesa/src/gallium/winsys/sw/gdi/gdi_sw_winsys.c
parent36d8503c27530f68d655d3ef77a6eaa4dfd8ad65 (diff)
Import Mesa 23.3.6
Diffstat (limited to 'lib/mesa/src/gallium/winsys/sw/gdi/gdi_sw_winsys.c')
-rw-r--r--lib/mesa/src/gallium/winsys/sw/gdi/gdi_sw_winsys.c33
1 files changed, 20 insertions, 13 deletions
diff --git a/lib/mesa/src/gallium/winsys/sw/gdi/gdi_sw_winsys.c b/lib/mesa/src/gallium/winsys/sw/gdi/gdi_sw_winsys.c
index 7077862d4..34f424ff5 100644
--- a/lib/mesa/src/gallium/winsys/sw/gdi/gdi_sw_winsys.c
+++ b/lib/mesa/src/gallium/winsys/sw/gdi/gdi_sw_winsys.c
@@ -58,7 +58,7 @@ struct gdi_sw_displaytarget
void *data;
- BITMAPINFO bmi;
+ BITMAPV5HEADER bmi;
};
@@ -150,17 +150,24 @@ gdi_sw_displaytarget_create(struct sw_winsys *winsys,
if(!gdt->data)
goto no_data;
- gdt->bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
- gdt->bmi.bmiHeader.biWidth = gdt->stride / cpp;
- gdt->bmi.bmiHeader.biHeight= -(long)height;
- gdt->bmi.bmiHeader.biPlanes = 1;
- gdt->bmi.bmiHeader.biBitCount = bpp;
- gdt->bmi.bmiHeader.biCompression = BI_RGB;
- gdt->bmi.bmiHeader.biSizeImage = 0;
- gdt->bmi.bmiHeader.biXPelsPerMeter = 0;
- gdt->bmi.bmiHeader.biYPelsPerMeter = 0;
- gdt->bmi.bmiHeader.biClrUsed = 0;
- gdt->bmi.bmiHeader.biClrImportant = 0;
+ gdt->bmi.bV5Size = sizeof(BITMAPV5HEADER);
+ gdt->bmi.bV5Width = gdt->stride / cpp;
+ gdt->bmi.bV5Height = -(long)height;
+ gdt->bmi.bV5Planes = 1;
+ gdt->bmi.bV5BitCount = bpp;
+ gdt->bmi.bV5Compression = BI_RGB;
+ gdt->bmi.bV5SizeImage = 0;
+ gdt->bmi.bV5XPelsPerMeter = 0;
+ gdt->bmi.bV5YPelsPerMeter = 0;
+ gdt->bmi.bV5ClrUsed = 0;
+ gdt->bmi.bV5ClrImportant = 0;
+
+ if (format == PIPE_FORMAT_B5G6R5_UNORM) {
+ gdt->bmi.bV5Compression = BI_BITFIELDS;
+ gdt->bmi.bV5RedMask = 0xF800;
+ gdt->bmi.bV5GreenMask = 0x07E0;
+ gdt->bmi.bV5BlueMask = 0x001F;
+ }
*stride = gdt->stride;
return (struct sw_displaytarget *)gdt;
@@ -203,7 +210,7 @@ gdi_sw_display( struct sw_winsys *winsys,
StretchDIBits(hDC,
0, 0, gdt->width, gdt->height,
0, 0, gdt->width, gdt->height,
- gdt->data, &gdt->bmi, 0, SRCCOPY);
+ gdt->data, (BITMAPINFO *)&gdt->bmi, 0, SRCCOPY);
}
static void