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