Commit 572e0f01 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

gdi32: Keep track of the background colour.

parent 4c859de0
...@@ -143,6 +143,46 @@ static HBITMAP CDECL dibdrv_SelectBitmap( PHYSDEV dev, HBITMAP bitmap ) ...@@ -143,6 +143,46 @@ static HBITMAP CDECL dibdrv_SelectBitmap( PHYSDEV dev, HBITMAP bitmap )
} }
/*********************************************************************** /***********************************************************************
* dibdrv_SetBkColor
*/
static COLORREF CDECL dibdrv_SetBkColor( PHYSDEV dev, COLORREF color )
{
PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSetBkColor );
dibdrv_physdev *pdev = get_dibdrv_pdev(dev);
pdev->bkgnd_color = pdev->dib.funcs->colorref_to_pixel( &pdev->dib, color );
if( GetBkMode(dev->hdc) == OPAQUE )
calc_and_xor_masks( GetROP2(dev->hdc), pdev->bkgnd_color, &pdev->bkgnd_and, &pdev->bkgnd_xor );
else
{
pdev->bkgnd_and = ~0u;
pdev->bkgnd_xor = 0;
}
return next->funcs->pSetBkColor( next, color );
}
/***********************************************************************
* dibdrv_SetBkMode
*/
static INT CDECL dibdrv_SetBkMode( PHYSDEV dev, INT mode )
{
PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSetBkMode );
dibdrv_physdev *pdev = get_dibdrv_pdev(dev);
if( mode == OPAQUE )
calc_and_xor_masks( GetROP2(dev->hdc), pdev->bkgnd_color, &pdev->bkgnd_and, &pdev->bkgnd_xor );
else
{
pdev->bkgnd_and = ~0u;
pdev->bkgnd_xor = 0;
}
return next->funcs->pSetBkMode( next, mode );
}
/***********************************************************************
* dibdrv_SetDeviceClipping * dibdrv_SetDeviceClipping
*/ */
static void CDECL dibdrv_SetDeviceClipping( PHYSDEV dev, HRGN vis_rgn, HRGN clip_rgn ) static void CDECL dibdrv_SetDeviceClipping( PHYSDEV dev, HRGN vis_rgn, HRGN clip_rgn )
...@@ -165,6 +205,8 @@ static INT CDECL dibdrv_SetROP2( PHYSDEV dev, INT rop ) ...@@ -165,6 +205,8 @@ static INT CDECL dibdrv_SetROP2( PHYSDEV dev, INT rop )
calc_and_xor_masks(rop, pdev->pen_color, &pdev->pen_and, &pdev->pen_xor); calc_and_xor_masks(rop, pdev->pen_color, &pdev->pen_and, &pdev->pen_xor);
update_brush_rop(pdev, rop); update_brush_rop(pdev, rop);
if( GetBkMode(dev->hdc) == OPAQUE )
calc_and_xor_masks(rop, pdev->bkgnd_color, &pdev->bkgnd_and, &pdev->bkgnd_xor);
return next->funcs->pSetROP2( next, rop ); return next->funcs->pSetROP2( next, rop );
} }
...@@ -254,8 +296,8 @@ const DC_FUNCTIONS dib_driver = ...@@ -254,8 +296,8 @@ const DC_FUNCTIONS dib_driver =
dibdrv_SelectPen, /* pSelectPen */ dibdrv_SelectPen, /* pSelectPen */
NULL, /* pSetArcDirection */ NULL, /* pSetArcDirection */
NULL, /* pSetBitmapBits */ NULL, /* pSetBitmapBits */
NULL, /* pSetBkColor */ dibdrv_SetBkColor, /* pSetBkColor */
NULL, /* pSetBkMode */ dibdrv_SetBkMode, /* pSetBkMode */
dibdrv_SetDCBrushColor, /* pSetDCBrushColor */ dibdrv_SetDCBrushColor, /* pSetDCBrushColor */
dibdrv_SetDCPenColor, /* pSetDCPenColor */ dibdrv_SetDCPenColor, /* pSetDCPenColor */
NULL, /* pSetDIBColorTable */ NULL, /* pSetDIBColorTable */
......
...@@ -108,6 +108,9 @@ typedef struct dibdrv_physdev ...@@ -108,6 +108,9 @@ typedef struct dibdrv_physdev
UINT brush_style; UINT brush_style;
DWORD brush_color, brush_and, brush_xor; DWORD brush_color, brush_and, brush_xor;
BOOL (* brush_rects)(struct dibdrv_physdev *pdev, int num, RECT *rects); BOOL (* brush_rects)(struct dibdrv_physdev *pdev, int num, RECT *rects);
/* background */
DWORD bkgnd_color, bkgnd_and, bkgnd_xor;
} dibdrv_physdev; } dibdrv_physdev;
#define DEFER_FORMAT 1 #define DEFER_FORMAT 1
......
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