Commit ab88c7cb authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

win32u: Implement NtGdiIcmBrushInfo and use it instead of __wine_get_brush_bitmap_info.

parent 0492108a
......@@ -489,7 +489,7 @@ static DWORD emfdc_create_brush( struct emf *emf, HBRUSH brush )
DWORD info_size;
UINT usage;
if (!__wine_get_brush_bitmap_info( brush, info, NULL, &usage )) break;
if (!NtGdiIcmBrushInfo( 0, brush, info, NULL, NULL, &usage, NULL, 0 )) break;
info_size = get_dib_info_size( info, usage );
emr = HeapAlloc( GetProcessHeap(), 0,
......@@ -530,7 +530,7 @@ static DWORD emfdc_create_brush( struct emf *emf, HBRUSH brush )
if (info->bmiHeader.biClrUsed == 1 << info->bmiHeader.biBitCount)
info->bmiHeader.biClrUsed = 0;
memcpy( (BYTE *)emr + emr->offBmi, info, emr->cbBmi );
__wine_get_brush_bitmap_info( brush, NULL, (char *)emr + emr->offBits, NULL );
NtGdiIcmBrushInfo( 0, brush, NULL, (char *)emr + emr->offBits, NULL, NULL, NULL, 0 );
if (!emfdc_record( emf, &emr->emr )) index = 0;
HeapFree( GetProcessHeap(), 0, emr );
......
......@@ -547,7 +547,8 @@ static INT16 metadc_create_brush( struct metadc *metadc, HBRUSH brush )
DWORD info_size;
UINT usage;
if (!__wine_get_brush_bitmap_info( brush, src_info, NULL, &usage )) goto done;
if (!NtGdiIcmBrushInfo( 0, brush, src_info, NULL, NULL, &usage, NULL, 0 ))
goto done;
info_size = get_dib_info_size( src_info, usage );
size = FIELD_OFFSET( METARECORD, rdParm[2] ) +
......@@ -559,7 +560,7 @@ static INT16 metadc_create_brush( struct metadc *metadc, HBRUSH brush )
mr->rdParm[0] = logbrush.lbStyle;
mr->rdParm[1] = usage;
dst_info = (BITMAPINFO *)(mr->rdParm + 2);
__wine_get_brush_bitmap_info( brush, dst_info, (char *)dst_info + info_size, NULL );
NtGdiIcmBrushInfo( 0, brush, dst_info, (char *)dst_info + info_size, NULL, NULL, NULL, 0 );
if (dst_info->bmiHeader.biClrUsed == 1 << dst_info->bmiHeader.biBitCount)
dst_info->bmiHeader.biClrUsed = 0;
break;
......
......@@ -145,13 +145,20 @@ void free_brush_pattern( struct brush_pattern *pattern )
}
/**********************************************************************
* __wine_get_brush_bitmap_info (win32u.@)
* NtGdiIcmBrushInfo (win32u.@)
*/
BOOL CDECL __wine_get_brush_bitmap_info( HBRUSH handle, BITMAPINFO *info, void *bits, UINT *usage )
BOOL WINAPI NtGdiIcmBrushInfo( HDC hdc, HBRUSH handle, BITMAPINFO *info, void *bits,
ULONG *bits_size, UINT *usage, BOOL *unk, UINT mode )
{
BRUSHOBJ *brush;
BOOL ret = FALSE;
if (mode)
{
FIXME( "unsupported mode %u\n", mode );
return FALSE;
}
if (!(brush = GDI_GetObjPtr( handle, NTGDI_OBJ_BRUSH ))) return FALSE;
if (brush->pattern.info)
......@@ -183,6 +190,7 @@ BOOL CDECL __wine_get_brush_bitmap_info( HBRUSH handle, BITMAPINFO *info, void *
else memcpy( bits, brush->pattern.bits.ptr,
brush->pattern.info->bmiHeader.biSizeImage );
}
if (bits_size) *bits_size = brush->pattern.info->bmiHeader.biSizeImage;
if (usage) *usage = brush->pattern.usage;
ret = TRUE;
}
......
......@@ -1031,7 +1031,6 @@ BOOL WINAPI NtGdiSetColorAdjustment( HDC hdc, const COLORADJUSTMENT *ca )
static struct unix_funcs unix_funcs =
{
SetDIBits,
__wine_get_brush_bitmap_info,
__wine_get_file_outline_text_metric,
__wine_get_icm_profile,
__wine_send_input,
......
......@@ -145,6 +145,7 @@ static void * const syscalls[] =
NtGdiGetTransform,
NtGdiGradientFill,
NtGdiHfontCreate,
NtGdiIcmBrushInfo,
NtGdiInitSpool,
NtGdiIntersectClipRect,
NtGdiInvertRgn,
......
......@@ -530,7 +530,7 @@
@ stub NtGdiHT_Get8BPPFormatPalette
@ stub NtGdiHT_Get8BPPMaskPalette
@ stdcall -syscall NtGdiHfontCreate(ptr long long long ptr)
@ stub NtGdiIcmBrushInfo
@ stdcall -syscall NtGdiIcmBrushInfo(long long ptr ptr ptr ptr ptr long)
@ stub NtGdiInit
@ stdcall -syscall NtGdiInitSpool()
@ stdcall -syscall NtGdiIntersectClipRect(long long long long long)
......@@ -1325,6 +1325,5 @@
# gdi32
@ stdcall SetDIBits(long long long long ptr ptr long)
@ cdecl __wine_get_brush_bitmap_info(long ptr ptr ptr)
@ cdecl __wine_get_icm_profile(long long ptr ptr)
@ cdecl __wine_get_file_outline_text_metric(wstr ptr)
......@@ -38,7 +38,6 @@ struct unix_funcs
INT (WINAPI *pSetDIBits)( HDC hdc, HBITMAP hbitmap, UINT startscan,
UINT lines, const void *bits, const BITMAPINFO *info,
UINT coloruse );
BOOL (CDECL *get_brush_bitmap_info)( HBRUSH handle, BITMAPINFO *info, void *bits, UINT *usage );
BOOL (CDECL *get_file_outline_text_metric)( const WCHAR *path, OUTLINETEXTMETRICW *otm );
BOOL (CDECL *get_icm_profile)( HDC hdc, BOOL allow_default, DWORD *size, WCHAR *filename );
BOOL (CDECL *wine_send_input)( HWND hwnd, const INPUT *input, const RAWINPUT *rawinput );
......
......@@ -38,12 +38,6 @@ BOOL CDECL __wine_get_icm_profile( HDC hdc, BOOL allow_default, DWORD *size, WCH
return unix_funcs->get_icm_profile( hdc, allow_default, size, filename );
}
BOOL CDECL __wine_get_brush_bitmap_info( HBRUSH handle, BITMAPINFO *info, void *bits, UINT *usage )
{
if (!unix_funcs) return FALSE;
return unix_funcs->get_brush_bitmap_info( handle, info, bits, usage );
}
BOOL CDECL __wine_get_file_outline_text_metric( const WCHAR *path, OUTLINETEXTMETRICW *otm )
{
if (!unix_funcs) return FALSE;
......
......@@ -1377,6 +1377,20 @@ NTSTATUS WINAPI wow64_NtGdiGradientFill( UINT *args )
return NtGdiGradientFill( hdc, vert_array, nvert, grad_array, ngrad, mode );
}
NTSTATUS WINAPI wow64_NtGdiIcmBrushInfo( UINT *args )
{
HDC hdc = get_handle( &args );
HBRUSH handle = get_handle( &args );
BITMAPINFO *info = get_ptr( &args );
void *bits = get_ptr( &args );
ULONG *bits_size = get_ptr( &args );
UINT *usage = get_ptr( &args );
BOOL *unk = get_ptr( &args );
UINT mode = get_ulong( &args );
return NtGdiIcmBrushInfo( hdc, handle, info, bits, bits_size, usage, unk, mode );
}
NTSTATUS WINAPI wow64_NtGdiInvertRgn( UINT *args )
{
HDC hdc = get_handle( &args );
......
......@@ -131,6 +131,7 @@
SYSCALL_ENTRY( NtGdiGetTransform ) \
SYSCALL_ENTRY( NtGdiGradientFill ) \
SYSCALL_ENTRY( NtGdiHfontCreate ) \
SYSCALL_ENTRY( NtGdiIcmBrushInfo ) \
SYSCALL_ENTRY( NtGdiInitSpool ) \
SYSCALL_ENTRY( NtGdiIntersectClipRect ) \
SYSCALL_ENTRY( NtGdiInvertRgn ) \
......
......@@ -375,6 +375,8 @@ BOOL WINAPI NtGdiGradientFill( HDC hdc, TRIVERTEX *vert_array, ULONG nvert,
void *grad_array, ULONG ngrad, ULONG mode );
HFONT WINAPI NtGdiHfontCreate( const void *logfont, ULONG unk2, ULONG unk3,
ULONG unk4, void *data );
BOOL WINAPI NtGdiIcmBrushInfo( HDC hdc, HBRUSH handle, BITMAPINFO *info, void *bits,
ULONG *bits_size, UINT *usage, BOOL *unk, UINT mode );
DWORD WINAPI NtGdiInitSpool(void);
INT WINAPI NtGdiIntersectClipRect( HDC hdc, INT left, INT top, INT right, INT bottom );
BOOL WINAPI NtGdiInvertRgn( HDC hdc, HRGN hrgn );
......@@ -481,8 +483,6 @@ NTSTATUS WINAPI NtGdiDdDDISetQueuedLimit( D3DKMT_SETQUEUEDLIMIT *desc );
NTSTATUS WINAPI NtGdiDdDDISetVidPnSourceOwner( const D3DKMT_SETVIDPNSOURCEOWNER *desc );
/* Wine extensions */
extern BOOL CDECL __wine_get_brush_bitmap_info( HBRUSH handle, BITMAPINFO *info, void *bits,
UINT *usage );
extern BOOL CDECL __wine_get_icm_profile( HDC hdc, BOOL allow_default, DWORD *size,
WCHAR *filename );
extern BOOL CDECL __wine_get_file_outline_text_metric( const WCHAR *path,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment