Commit 4a32a875 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

gdi32: Move background mode to DC_ATTR.

parent a81d0b97
......@@ -86,7 +86,7 @@ static void set_initial_dc_state( DC *dc )
dc->polyFillMode = ALTERNATE;
dc->stretchBltMode = BLACKONWHITE;
dc->relAbsMode = ABSOLUTE;
dc->backgroundMode = OPAQUE;
dc->attr->background_mode = OPAQUE;
dc->backgroundColor = RGB( 255, 255, 255 );
dc->dcBrushColor = RGB( 255, 255, 255 );
dc->dcPenColor = RGB( 0, 0, 0 );
......@@ -392,6 +392,7 @@ INT CDECL nulldrv_SaveDC( PHYSDEV dev )
HeapFree( GetProcessHeap(), 0, newdc );
return 0;
}
*newdc->attr = *dc->attr;
newdc->layout = dc->layout;
newdc->hPen = dc->hPen;
newdc->hBrush = dc->hBrush;
......@@ -402,20 +403,16 @@ INT CDECL nulldrv_SaveDC( PHYSDEV dev )
newdc->polyFillMode = dc->polyFillMode;
newdc->stretchBltMode = dc->stretchBltMode;
newdc->relAbsMode = dc->relAbsMode;
newdc->backgroundMode = dc->backgroundMode;
newdc->backgroundColor = dc->backgroundColor;
newdc->textColor = dc->textColor;
newdc->dcBrushColor = dc->dcBrushColor;
newdc->dcPenColor = dc->dcPenColor;
newdc->brush_org = dc->brush_org;
newdc->mapperFlags = dc->mapperFlags;
newdc->attr->text_align = dc->attr->text_align;
newdc->charExtra = dc->charExtra;
newdc->breakExtra = dc->breakExtra;
newdc->breakRem = dc->breakRem;
newdc->MapMode = dc->MapMode;
newdc->attr->graphics_mode = dc->attr->graphics_mode;
newdc->attr->cur_pos = dc->attr->cur_pos;
newdc->ArcDirection = dc->ArcDirection;
newdc->xformWorld2Wnd = dc->xformWorld2Wnd;
newdc->xformWorld2Vport = dc->xformWorld2Vport;
......@@ -479,7 +476,7 @@ BOOL CDECL nulldrv_RestoreDC( PHYSDEV dev, INT level )
dc->polyFillMode = dcs->polyFillMode;
dc->stretchBltMode = dcs->stretchBltMode;
dc->relAbsMode = dcs->relAbsMode;
dc->backgroundMode = dcs->backgroundMode;
dc->attr->background_mode = dcs->attr->background_mode;
dc->backgroundColor = dcs->backgroundColor;
dc->textColor = dcs->textColor;
dc->dcBrushColor = dcs->dcBrushColor;
......@@ -1558,24 +1555,6 @@ INT WINAPI GetRelAbs( HDC hdc, DWORD dwIgnore )
}
/***********************************************************************
* GetBkMode (GDI32.@)
*/
INT WINAPI GetBkMode( HDC hdc )
{
INT ret = 0;
DC * dc = get_dc_ptr( hdc );
if (dc)
{
ret = dc->backgroundMode;
release_dc_ptr( dc );
}
return ret;
}
/***********************************************************************
* SetBkMode (GDI32.@)
*/
......@@ -1595,8 +1574,8 @@ INT WINAPI SetBkMode( HDC hdc, INT mode )
mode = physdev->funcs->pSetBkMode( physdev, mode );
if (mode)
{
ret = dc->backgroundMode;
dc->backgroundMode = mode;
ret = dc->attr->background_mode;
dc->attr->background_mode = mode;
}
release_dc_ptr( dc );
}
......
......@@ -1230,7 +1230,7 @@ static BOOL dashed_pen_lines(dibdrv_physdev *pdev, int num, POINT *pts, BOOL clo
else
{
get_color_masks( dc, &pdev->dib, dc->ROPmode, pdev->pen_brush.colorref,
pdev->pen_is_ext ? TRANSPARENT : dc->backgroundMode,
pdev->pen_is_ext ? TRANSPARENT : dc->attr->background_mode,
&pdev->dash_masks[1], &pdev->dash_masks[0] );
for (i = 0; i < num - 1; i++)
......@@ -1891,12 +1891,12 @@ static BOOL create_hatch_brush_bits(dibdrv_physdev *pdev, dib_brush *brush, BOOL
if (!init_hatch_brush( pdev, brush )) return FALSE;
get_color_masks( dc, &pdev->dib, brush->rop, brush->colorref, dc->backgroundMode,
get_color_masks( dc, &pdev->dib, brush->rop, brush->colorref, dc->attr->background_mode,
&fg_mask, &bg_mask );
if (brush->colorref & (1 << 24)) /* PALETTEINDEX */
*needs_reselect = TRUE;
if (dc->backgroundMode != TRANSPARENT && (dc->backgroundColor & (1 << 24)))
if (dc->attr->background_mode != TRANSPARENT && (dc->backgroundColor & (1 << 24)))
*needs_reselect = TRUE;
brush->dib.funcs->create_rop_masks( &brush->dib, hatches[brush->hatch],
......
......@@ -5998,7 +5998,7 @@ BOOL WINAPI NtGdiExtTextOutW( HDC hdc, INT x, INT y, UINT flags, const RECT *lpr
TRACE("%p, %d, %d, %08x, %s, %s, %d, %p)\n", hdc, x, y, flags,
wine_dbgstr_rect(lprect), debugstr_wn(str, count), count, lpDx);
TRACE("align = %x bkmode = %x mapmode = %x\n", align, dc->backgroundMode, dc->MapMode);
TRACE("align = %x bkmode = %x mapmode = %x\n", align, dc->attr->background_mode, dc->MapMode);
if(align & TA_UPDATECP)
{
......@@ -6202,7 +6202,7 @@ BOOL WINAPI NtGdiExtTextOutW( HDC hdc, INT x, INT y, UINT flags, const RECT *lpr
break;
}
if (dc->backgroundMode != TRANSPARENT)
if (dc->attr->background_mode != TRANSPARENT)
{
if(!((flags & ETO_CLIPPED) && (flags & ETO_OPAQUE)))
{
......
......@@ -66,6 +66,15 @@ UINT WINAPI SetTextAlign( HDC hdc, UINT align )
}
/***********************************************************************
* GetBkMode (GDI32.@)
*/
INT WINAPI GetBkMode( HDC hdc )
{
DC_ATTR *dc_attr = get_dc_attr( hdc );
return dc_attr ? dc_attr->background_mode : 0;
}
/***********************************************************************
* GetCurrentPositionEx (GDI32.@)
*/
BOOL WINAPI GetCurrentPositionEx( HDC hdc, POINT *point )
......
......@@ -122,7 +122,6 @@ typedef struct tagDC
WORD polyFillMode;
WORD stretchBltMode;
WORD relAbsMode;
WORD backgroundMode;
COLORREF backgroundColor;
COLORREF textColor;
COLORREF dcBrushColor;
......
......@@ -101,6 +101,7 @@ typedef struct DC_ATTR
POINT cur_pos;
INT graphics_mode;
WORD text_align;
WORD background_mode;
void *emf;
} DC_ATTR;
......
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