Add X11DRV_DIB_UpdateDIBSection2 that takes a HBITMAP parameter.

This commit is contained in:
Ove Kaaven 2000-07-28 23:59:06 +00:00 committed by Alexandre Julliard
parent d9b8f9be37
commit 97e482bc95
2 changed files with 31 additions and 17 deletions

View File

@ -3186,25 +3186,12 @@ static BOOL X11DRV_DIB_FaultHandler( LPVOID res, LPCVOID addr )
}
/***********************************************************************
* X11DRV_DIB_UpdateDIBSection
* X11DRV_DIB_CmnUpdateDIBSection
*/
void X11DRV_DIB_UpdateDIBSection(DC *dc, BOOL toDIB)
static void X11DRV_DIB_CmnUpdateDIBSection(BITMAPOBJ *bmp, BOOL toDIB)
{
BITMAPOBJ *bmp;
/* Ensure this is a Compatible DC that has a DIB section selected */
if (!dc) return;
if (!(dc->w.flags & DC_MEMORY)) return;
bmp = (BITMAPOBJ *)GDI_GetObjPtr( dc->w.hBitmap, BITMAP_MAGIC );
if (!bmp) return;
if (!bmp->dib)
{
GDI_HEAP_UNLOCK(dc->w.hBitmap);
return;
}
if (!bmp->dib) return;
if (!toDIB)
{
@ -3263,8 +3250,34 @@ void X11DRV_DIB_UpdateDIBSection(DC *dc, BOOL toDIB)
break;
}
}
}
GDI_HEAP_UNLOCK(dc->w.hBitmap);
/***********************************************************************
* X11DRV_DIB_UpdateDIBSection2
*/
void X11DRV_DIB_UpdateDIBSection2(HBITMAP hbmp, BOOL toDIB)
{
BITMAPOBJ *bmp;
bmp = (BITMAPOBJ *)GDI_GetObjPtr( hbmp, BITMAP_MAGIC );
if (!bmp) return;
X11DRV_DIB_CmnUpdateDIBSection(bmp, toDIB);
GDI_HEAP_UNLOCK(hbmp);
}
/***********************************************************************
* X11DRV_DIB_UpdateDIBSection
*/
void X11DRV_DIB_UpdateDIBSection(DC *dc, BOOL toDIB)
{
/* Ensure this is a Compatible DC that has a DIB section selected */
if (!dc) return;
if (!(dc->w.flags & DC_MEMORY)) return;
X11DRV_DIB_UpdateDIBSection2(dc->w.hBitmap, toDIB);
}
/***********************************************************************

View File

@ -263,6 +263,7 @@ extern int *X11DRV_DIB_BuildColorMap( struct tagDC *dc, WORD coloruse,
WORD depth, const BITMAPINFO *info,
int *nColors );
extern void X11DRV_DIB_UpdateDIBSection(struct tagDC *dc, BOOL toDIB);
extern void X11DRV_DIB_UpdateDIBSection2(HBITMAP hbmp, BOOL toDIB);
extern HBITMAP X11DRV_DIB_CreateDIBSection(struct tagDC *dc, BITMAPINFO *bmi, UINT usage,
LPVOID *bits, HANDLE section, DWORD offset, DWORD ovr_pitch);