gdi32: Add a helper to retrieve the bitmap functions.

This commit is contained in:
Huw Davies 2011-08-19 16:26:13 +01:00 committed by Alexandre Julliard
parent cb82c45b3a
commit e82f88d5ee
2 changed files with 8 additions and 4 deletions

View File

@ -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 */
{

View File

@ -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 */