gdi32: Use NtGdiCreateDIBSection for CreateDIBSection.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2021-08-31 13:18:37 +01:00 committed by Alexandre Julliard
parent b2522bfb90
commit f6e584e626
5 changed files with 18 additions and 5 deletions

View File

@ -877,7 +877,7 @@ BOOL WINAPI GdiTransparentBlt( HDC hdcDest, int xDest, int yDest, int widthDest,
info.bmiHeader.biPlanes = 1;
info.bmiHeader.biBitCount = 24;
info.bmiHeader.biCompression = BI_RGB;
bmpWork = CreateDIBSection( 0, &info, DIB_RGB_COLORS, NULL, NULL, 0 );
bmpWork = NtGdiCreateDIBSection( 0, NULL, 0, &info, DIB_RGB_COLORS, 0, 0, 0, NULL );
}
else bmpWork = NtGdiCreateCompatibleBitmap( hdcDest, widthDest, heightDest );
oldWork = NtGdiSelectBitmap(hdcWork, bmpWork);

View File

@ -76,7 +76,7 @@ HBITMAP WINAPI NtGdiCreateCompatibleBitmap( HDC hdc, INT width, INT height )
memcpy( bi->bmiColors, dib.dsBitfields, sizeof(dib.dsBitfields) );
else if (dib.dsBmih.biBitCount <= 8) /* copy the color table */
NtGdiDoPalette( hdc, 0, 256, bi->bmiColors, NtGdiGetDIBColorTable, FALSE );
return CreateDIBSection( hdc, bi, DIB_RGB_COLORS, NULL, NULL, 0 );
return NtGdiCreateDIBSection( hdc, NULL, 0, bi, DIB_RGB_COLORS, 0, 0, 0, NULL );
default:
return 0;

View File

@ -1460,10 +1460,11 @@ HBITMAP WINAPI NtGdiCreateDIBitmapInternal( HDC hdc, INT width, INT height, DWOR
/***********************************************************************
* CreateDIBSection (GDI32.@)
* NtGdiCreateDIBSection (win32u.@)
*/
HBITMAP WINAPI DECLSPEC_HOTPATCH CreateDIBSection(HDC hdc, const BITMAPINFO *bmi, UINT usage,
void **bits, HANDLE section, DWORD offset)
HBITMAP WINAPI NtGdiCreateDIBSection( HDC hdc, HANDLE section, DWORD offset, const BITMAPINFO *bmi,
UINT usage, UINT header_size, ULONG flags,
ULONG_PTR color_space, void **bits )
{
char buffer[FIELD_OFFSET( BITMAPINFO, bmiColors[256] )];
BITMAPINFO *info = (BITMAPINFO *)buffer;

View File

@ -753,6 +753,15 @@ HBITMAP WINAPI CreateDIBitmap( HDC hdc, const BITMAPINFOHEADER *header, DWORD in
0, 0, 0, 0 );
}
/***********************************************************************
* CreateDIBSection (GDI32.@)
*/
HBITMAP WINAPI DECLSPEC_HOTPATCH CreateDIBSection( HDC hdc, const BITMAPINFO *bmi, UINT usage,
void **bits, HANDLE section, DWORD offset )
{
return NtGdiCreateDIBSection( hdc, section, offset, bmi, usage, 0, 0, 0, bits );
}
/***********************************************************************
* GetDIBits (win32u.@)
*/

View File

@ -222,6 +222,9 @@ HBITMAP WINAPI NtGdiCreateDIBitmapInternal( HDC hdc, INT width, INT height, DWO
const void *bits, const BITMAPINFO *data,
UINT coloruse, UINT max_info, UINT max_bits,
ULONG flags, HANDLE xform );
HBITMAP WINAPI NtGdiCreateDIBSection( HDC hdc, HANDLE section, DWORD offset, const BITMAPINFO *bmi,
UINT usage, UINT header_size, ULONG flags,
ULONG_PTR color_space, void **bits );
HPALETTE WINAPI NtGdiCreateHalftonePalette( HDC hdc );
HBRUSH WINAPI NtGdiCreateHatchBrushInternal( INT style, COLORREF color, BOOL pen );
HDC WINAPI NtGdiCreateMetafileDC( HDC hdc );