Commit e82f88d5 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

gdi32: Add a helper to retrieve the bitmap functions.

parent cb82c45b
......@@ -583,8 +583,7 @@ INT WINAPI SetDIBits( HDC hdc, HBITMAP hbitmap, UINT startscan,
physdev = GET_DC_PHYSDEV( dc, pCreateBitmap );
if (!BITMAP_SetOwnerDC( hbitmap, physdev )) goto done;
funcs = bitmap->funcs;
if (bitmap->dib) funcs = dc->dibdrv.dev.funcs;
funcs = get_bitmap_funcs( bitmap );
result = lines;
......@@ -947,8 +946,7 @@ INT WINAPI GetDIBits(
return 0;
}
funcs = bmp->funcs;
if (bmp->dib) funcs = dc->dibdrv.dev.funcs;
funcs = get_bitmap_funcs( bmp );
if (dst_info->bmiHeader.biBitCount == 0) /* query bitmap info only */
{
......
......@@ -571,6 +571,12 @@ static inline int get_dib_num_of_colors( const BITMAPINFO *info )
return info->bmiHeader.biBitCount > 8 ? 0 : 1 << info->bmiHeader.biBitCount;
}
static inline const struct gdi_dc_funcs *get_bitmap_funcs( const BITMAPOBJ *bitmap )
{
if( bitmap->dib ) return &dib_driver;
return bitmap->funcs;
}
extern void free_heap_bits( struct gdi_image_bits *bits ) DECLSPEC_HIDDEN;
#endif /* __WINE_GDI_PRIVATE_H */
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