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, ...@@ -583,8 +583,7 @@ INT WINAPI SetDIBits( HDC hdc, HBITMAP hbitmap, UINT startscan,
physdev = GET_DC_PHYSDEV( dc, pCreateBitmap ); physdev = GET_DC_PHYSDEV( dc, pCreateBitmap );
if (!BITMAP_SetOwnerDC( hbitmap, physdev )) goto done; if (!BITMAP_SetOwnerDC( hbitmap, physdev )) goto done;
funcs = bitmap->funcs; funcs = get_bitmap_funcs( bitmap );
if (bitmap->dib) funcs = dc->dibdrv.dev.funcs;
result = lines; result = lines;
...@@ -947,8 +946,7 @@ INT WINAPI GetDIBits( ...@@ -947,8 +946,7 @@ INT WINAPI GetDIBits(
return 0; return 0;
} }
funcs = bmp->funcs; funcs = get_bitmap_funcs( bmp );
if (bmp->dib) funcs = dc->dibdrv.dev.funcs;
if (dst_info->bmiHeader.biBitCount == 0) /* query bitmap info only */ 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 ) ...@@ -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; 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; extern void free_heap_bits( struct gdi_image_bits *bits ) DECLSPEC_HIDDEN;
#endif /* __WINE_GDI_PRIVATE_H */ #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