Commit f1f5f334 authored by Alexandre Julliard's avatar Alexandre Julliard

gdi32: Emulate DDB support using the DIB driver when the graphics driver doesn't support bitmaps.

parent c9bdcbaf
......@@ -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 ))
{
......
......@@ -404,6 +404,14 @@ static BOOL dibdrv_DeleteDC( PHYSDEV dev )
}
/***********************************************************************
* dibdrv_DeleteBitmap
*/
static BOOL dibdrv_DeleteBitmap( HBITMAP bitmap )
{
return TRUE;
}
/***********************************************************************
* dibdrv_SelectBitmap
*/
static HBITMAP dibdrv_SelectBitmap( PHYSDEV dev, HBITMAP bitmap )
......@@ -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 */
......
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