Commit e7abb54f authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

gdi32: Store DC brush color in DC_ATTR.

parent 600ed80b
......@@ -88,7 +88,7 @@ static void set_initial_dc_state( DC *dc )
dc->attr->rel_abs_mode = ABSOLUTE;
dc->attr->background_mode = OPAQUE;
dc->attr->background_color = RGB( 255, 255, 255 );
dc->dcBrushColor = RGB( 255, 255, 255 );
dc->attr->brush_color = RGB( 255, 255, 255 );
dc->dcPenColor = RGB( 0, 0, 0 );
dc->attr->text_color = RGB( 0, 0, 0 );
dc->brush_org.x = 0;
......@@ -398,7 +398,6 @@ INT CDECL nulldrv_SaveDC( PHYSDEV dev )
newdc->hFont = dc->hFont;
newdc->hBitmap = dc->hBitmap;
newdc->hPalette = dc->hPalette;
newdc->dcBrushColor = dc->dcBrushColor;
newdc->dcPenColor = dc->dcPenColor;
newdc->brush_org = dc->brush_org;
newdc->mapperFlags = dc->mapperFlags;
......@@ -470,7 +469,7 @@ BOOL CDECL nulldrv_RestoreDC( PHYSDEV dev, INT level )
dc->attr->background_mode = dcs->attr->background_mode;
dc->attr->background_color = dcs->attr->background_color;
dc->attr->text_color = dcs->attr->text_color;
dc->dcBrushColor = dcs->dcBrushColor;
dc->attr->brush_color = dcs->attr->brush_color;
dc->dcPenColor = dcs->dcPenColor;
dc->brush_org = dcs->brush_org;
dc->mapperFlags = dcs->mapperFlags;
......@@ -1480,26 +1479,6 @@ DWORD WINAPI SetLayout(HDC hdc, DWORD layout)
}
/***********************************************************************
* GetDCBrushColor (GDI32.@)
*/
COLORREF WINAPI GetDCBrushColor(HDC hdc)
{
DC *dc;
COLORREF dcBrushColor = CLR_INVALID;
TRACE("hdc(%p)\n", hdc);
dc = get_dc_ptr( hdc );
if (dc)
{
dcBrushColor = dc->dcBrushColor;
release_dc_ptr( dc );
}
return dcBrushColor;
}
/***********************************************************************
* SetDCBrushColor (GDI32.@)
*/
COLORREF WINAPI SetDCBrushColor(HDC hdc, COLORREF crColor)
......@@ -1516,8 +1495,8 @@ COLORREF WINAPI SetDCBrushColor(HDC hdc, COLORREF crColor)
crColor = physdev->funcs->pSetDCBrushColor( physdev, crColor );
if (crColor != CLR_INVALID)
{
oldClr = dc->dcBrushColor;
dc->dcBrushColor = crColor;
oldClr = dc->attr->brush_color;
dc->attr->brush_color = crColor;
}
release_dc_ptr( dc );
}
......
......@@ -2137,7 +2137,7 @@ HBRUSH CDECL dibdrv_SelectBrush( PHYSDEV dev, HBRUSH hbrush, const struct brush_
GetObjectW( hbrush, sizeof(logbrush), &logbrush );
if (hbrush == GetStockObject( DC_BRUSH ))
logbrush.lbColor = dc->dcBrushColor;
logbrush.lbColor = dc->attr->brush_color;
select_brush( pdev, &pdev->brush, &logbrush, pattern, TRUE );
return hbrush;
......
......@@ -75,6 +75,15 @@ COLORREF WINAPI GetBkColor( HDC hdc )
}
/***********************************************************************
* GetDCBrushColor (GDI32.@)
*/
COLORREF WINAPI GetDCBrushColor( HDC hdc )
{
DC_ATTR *dc_attr = get_dc_attr( hdc );
return dc_attr ? dc_attr->brush_color : CLR_INVALID;
}
/***********************************************************************
* GetTextColor (GDI32.@)
*/
COLORREF WINAPI GetTextColor( HDC hdc )
......
......@@ -116,7 +116,6 @@ typedef struct tagDC
const struct font_gamma_ramp *font_gamma_ramp;
UINT font_code_page;
COLORREF dcBrushColor;
COLORREF dcPenColor;
POINT brush_org;
......
......@@ -100,6 +100,7 @@ typedef struct DC_ATTR
{
LONG disabled; /* disabled flag, controled by DCHF_(DISABLE|ENABLE)DC */
COLORREF background_color;
COLORREF brush_color;
COLORREF text_color;
POINT cur_pos;
INT graphics_mode;
......
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