Commit 21fc3c80 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

CreateDIBSection takes a const pointer to BITMAPINFO.

parent 61197df7
......@@ -36,7 +36,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(ddraw);
/* FIXME */
extern HBITMAP DIB_CreateDIBSection( HDC hdc, BITMAPINFO *bmi, UINT usage, LPVOID *bits,
extern HBITMAP DIB_CreateDIBSection( HDC hdc, const BITMAPINFO *bmi, UINT usage, VOID **bits,
HANDLE section, DWORD offset, DWORD ovr_pitch );
static ICOM_VTABLE(IDirectDrawSurface7) DIB_IDirectDrawSurface7_VTable;
......
......@@ -62,7 +62,7 @@ typedef struct tagDC_FUNCS
BOOL (*pCloseFigure)(PHYSDEV);
BOOL (*pCreateBitmap)(PHYSDEV,HBITMAP);
BOOL (*pCreateDC)(HDC,PHYSDEV *,LPCWSTR,LPCWSTR,LPCWSTR,const DEVMODEW*);
HBITMAP (*pCreateDIBSection)(PHYSDEV,BITMAPINFO *,UINT,LPVOID *,HANDLE,DWORD,DWORD);
HBITMAP (*pCreateDIBSection)(PHYSDEV,const BITMAPINFO *,UINT,VOID **,HANDLE,DWORD,DWORD);
BOOL (*pDeleteBitmap)(HBITMAP);
BOOL (*pDeleteDC)(PHYSDEV);
BOOL (*pDeleteObject)(PHYSDEV,HGDIOBJ);
......
......@@ -4505,8 +4505,8 @@ static XImage *X11DRV_XShmCreateImage( int width, int height, int bpp,
* X11DRV_DIB_CreateDIBSection
*/
HBITMAP X11DRV_DIB_CreateDIBSection(
X11DRV_PDEVICE *physDev, BITMAPINFO *bmi, UINT usage,
LPVOID *bits, HANDLE section,
X11DRV_PDEVICE *physDev, const BITMAPINFO *bmi, UINT usage,
VOID **bits, HANDLE section,
DWORD offset, DWORD ovr_pitch)
{
HBITMAP res = 0;
......@@ -4516,7 +4516,7 @@ HBITMAP X11DRV_DIB_CreateDIBSection(
int nColorMap;
/* Fill BITMAP32 structure with DIB data */
BITMAPINFOHEADER *bi = &bmi->bmiHeader;
const BITMAPINFOHEADER *bi = &bmi->bmiHeader;
INT effHeight, totalSize;
BITMAP bm;
LPVOID mapBits = NULL;
......
......@@ -287,8 +287,8 @@ extern INT X11DRV_CoerceDIBSection2(HBITMAP bmp,INT,BOOL);
extern INT X11DRV_LockDIBSection2(HBITMAP bmp,INT,BOOL);
extern void X11DRV_UnlockDIBSection2(HBITMAP bmp,BOOL);
extern HBITMAP X11DRV_DIB_CreateDIBSection(X11DRV_PDEVICE *physDev, BITMAPINFO *bmi, UINT usage,
LPVOID *bits, HANDLE section, DWORD offset, DWORD ovr_pitch);
extern HBITMAP X11DRV_DIB_CreateDIBSection(X11DRV_PDEVICE *physDev, const BITMAPINFO *bmi, UINT usage,
VOID **bits, HANDLE section, DWORD offset, DWORD ovr_pitch);
extern void X11DRV_DIB_DeleteDIBSection(struct tagBITMAPOBJ *bmp);
extern INT X11DRV_DIB_Coerce(struct tagBITMAPOBJ *,INT,BOOL);
extern INT X11DRV_DIB_Lock(struct tagBITMAPOBJ *,INT,BOOL);
......
......@@ -409,7 +409,7 @@ HDC16 WINAPI CreateDC16(LPCSTR,LPCSTR,LPCSTR,const DEVMODEA*);
HBITMAP16 WINAPI CreateDIBitmap16(HDC16,const BITMAPINFOHEADER*,DWORD,
LPCVOID,const BITMAPINFO*,UINT16);
HBRUSH16 WINAPI CreateDIBPatternBrush16(HGLOBAL16,UINT16);
HBITMAP16 WINAPI CreateDIBSection16 (HDC16, BITMAPINFO *, UINT16,
HBITMAP16 WINAPI CreateDIBSection16 (HDC16, const BITMAPINFO *, UINT16,
SEGPTR *, HANDLE, DWORD offset);
HBITMAP16 WINAPI CreateDiscardableBitmap16(HDC16,INT16,INT16);
HRGN16 WINAPI CreateEllipticRgn16(INT16,INT16,INT16,INT16);
......
......@@ -3167,8 +3167,8 @@ HBITMAP WINAPI CreateDIBitmap(HDC,const BITMAPINFOHEADER*,DWORD,
LPCVOID,const BITMAPINFO*,UINT);
HBRUSH WINAPI CreateDIBPatternBrush(HGLOBAL,UINT);
HBRUSH WINAPI CreateDIBPatternBrushPt(const void*,UINT);
HBITMAP WINAPI CreateDIBSection (HDC, BITMAPINFO *, UINT,
LPVOID *, HANDLE, DWORD offset);
HBITMAP WINAPI CreateDIBSection(HDC, CONST BITMAPINFO *, UINT,
VOID **, HANDLE, DWORD offset);
HBITMAP WINAPI CreateDiscardableBitmap(HDC,INT,INT);
HRGN WINAPI CreateEllipticRgn(INT,INT,INT,INT);
HRGN WINAPI CreateEllipticRgnIndirect(const RECT *);
......
......@@ -841,7 +841,7 @@ HBITMAP WINAPI CreateDIBitmap( HDC hdc, const BITMAPINFOHEADER *header,
/***********************************************************************
* CreateDIBSection (GDI.489)
*/
HBITMAP16 WINAPI CreateDIBSection16 (HDC16 hdc, BITMAPINFO *bmi, UINT16 usage,
HBITMAP16 WINAPI CreateDIBSection16 (HDC16 hdc, const BITMAPINFO *bmi, UINT16 usage,
SEGPTR *bits16, HANDLE section, DWORD offset)
{
LPVOID bits32;
......@@ -853,7 +853,7 @@ HBITMAP16 WINAPI CreateDIBSection16 (HDC16 hdc, BITMAPINFO *bmi, UINT16 usage,
BITMAPOBJ *bmp = (BITMAPOBJ *) GDI_GetObjPtr(hbitmap, BITMAP_MAGIC);
if (bmp && bmp->dib && bits32)
{
BITMAPINFOHEADER *bi = &bmi->bmiHeader;
const BITMAPINFOHEADER *bi = &bmi->bmiHeader;
INT height = bi->biHeight >= 0 ? bi->biHeight : -bi->biHeight;
INT width_bytes = DIB_GetDIBWidthBytes(bi->biWidth, bi->biBitCount);
INT size = (bi->biSizeImage && bi->biCompression != BI_RGB) ?
......@@ -881,8 +881,8 @@ HBITMAP16 WINAPI CreateDIBSection16 (HDC16 hdc, BITMAPINFO *bmi, UINT16 usage,
/***********************************************************************
* DIB_CreateDIBSection
*/
HBITMAP DIB_CreateDIBSection(HDC hdc, BITMAPINFO *bmi, UINT usage,
LPVOID *bits, HANDLE section,
HBITMAP DIB_CreateDIBSection(HDC hdc, const BITMAPINFO *bmi, UINT usage,
VOID **bits, HANDLE section,
DWORD offset, DWORD ovr_pitch)
{
HBITMAP hbitmap = 0;
......@@ -896,12 +896,6 @@ HBITMAP DIB_CreateDIBSection(HDC hdc, BITMAPINFO *bmi, UINT usage,
bDesktopDC = TRUE;
}
/* Windows ignores the supplied values of biClrUsed and biClrImportant thus: */
if (bmi->bmiHeader.biBitCount >= 1 && bmi->bmiHeader.biBitCount <= 8)
bmi->bmiHeader.biClrUsed = bmi->bmiHeader.biClrImportant = 1L << bmi->bmiHeader.biBitCount;
else
bmi->bmiHeader.biClrUsed = bmi->bmiHeader.biClrImportant = 0;
if ((dc = DC_GetDCPtr( hdc )))
{
if(dc->funcs->pCreateDIBSection)
......@@ -918,8 +912,8 @@ HBITMAP DIB_CreateDIBSection(HDC hdc, BITMAPINFO *bmi, UINT usage,
/***********************************************************************
* CreateDIBSection (GDI32.@)
*/
HBITMAP WINAPI CreateDIBSection(HDC hdc, BITMAPINFO *bmi, UINT usage,
LPVOID *bits, HANDLE section,
HBITMAP WINAPI CreateDIBSection(HDC hdc, CONST BITMAPINFO *bmi, UINT usage,
VOID **bits, HANDLE section,
DWORD offset)
{
return DIB_CreateDIBSection(hdc, bmi, usage, bits, section, offset, 0);
......
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