gdi32: Emulate DDB support using the DIB driver when the graphics driver doesn't support bitmaps.
This commit is contained in:
parent
c9bdcbafab
commit
f1f5f33468
|
@ -609,11 +609,7 @@ BOOL BITMAP_SetOwnerDC( HBITMAP hbitmap, PHYSDEV physdev )
|
|||
set_initial_bitmap_bits( hbitmap, bitmap );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
WARN( "Trying to select bitmap %p in DC that doesn't support it\n", hbitmap );
|
||||
ret = FALSE;
|
||||
}
|
||||
else bitmap->funcs = &dib_driver; /* use the DIB driver to emulate DDB support */
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -666,7 +662,8 @@ static HGDIOBJ BITMAP_SelectObject( HGDIOBJ handle, HDC hdc )
|
|||
if(old_physdev == dc->dibdrv)
|
||||
old_physdev = pop_dc_driver( &dc->physDev );
|
||||
|
||||
if(bitmap->dib)
|
||||
physdev = GET_DC_PHYSDEV( dc, pSelectBitmap );
|
||||
if (bitmap->dib || physdev->funcs == &null_driver)
|
||||
{
|
||||
physdev = dc->dibdrv;
|
||||
if (physdev) push_dc_driver( &dc->physDev, physdev, physdev->funcs );
|
||||
|
@ -676,8 +673,6 @@ static HGDIOBJ BITMAP_SelectObject( HGDIOBJ handle, HDC hdc )
|
|||
dc->dibdrv = physdev = dc->physDev;
|
||||
}
|
||||
}
|
||||
else
|
||||
physdev = GET_DC_PHYSDEV( dc, pSelectBitmap );
|
||||
|
||||
if (!BITMAP_SetOwnerDC( handle, physdev ))
|
||||
{
|
||||
|
|
|
@ -403,6 +403,14 @@ static BOOL dibdrv_DeleteDC( PHYSDEV dev )
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* dibdrv_DeleteBitmap
|
||||
*/
|
||||
static BOOL dibdrv_DeleteBitmap( HBITMAP bitmap )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* dibdrv_SelectBitmap
|
||||
*/
|
||||
|
@ -414,7 +422,6 @@ static HBITMAP dibdrv_SelectBitmap( PHYSDEV dev, HBITMAP bitmap )
|
|||
TRACE("(%p, %p)\n", dev, bitmap);
|
||||
|
||||
if (!bmp) return 0;
|
||||
assert(bmp->dib);
|
||||
|
||||
free_dib_info(&pdev->dib);
|
||||
pdev->defer = 0;
|
||||
|
@ -533,7 +540,7 @@ const struct gdi_dc_funcs dib_driver =
|
|||
NULL, /* pCreateCompatibleDC */
|
||||
dibdrv_CreateDC, /* pCreateDC */
|
||||
NULL, /* pCreateDIBSection */
|
||||
NULL, /* pDeleteBitmap */
|
||||
dibdrv_DeleteBitmap, /* pDeleteBitmap */
|
||||
dibdrv_DeleteDC, /* pDeleteDC */
|
||||
NULL, /* pDeleteObject */
|
||||
NULL, /* pDescribePixelFormat */
|
||||
|
|
Loading…
Reference in New Issue