gdi32: Store DC brush color in DC_ATTR.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Huw Davies <huw@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
600ed80b9b
commit
e7abb54f43
|
@ -88,7 +88,7 @@ static void set_initial_dc_state( DC *dc )
|
||||||
dc->attr->rel_abs_mode = ABSOLUTE;
|
dc->attr->rel_abs_mode = ABSOLUTE;
|
||||||
dc->attr->background_mode = OPAQUE;
|
dc->attr->background_mode = OPAQUE;
|
||||||
dc->attr->background_color = RGB( 255, 255, 255 );
|
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->dcPenColor = RGB( 0, 0, 0 );
|
||||||
dc->attr->text_color = RGB( 0, 0, 0 );
|
dc->attr->text_color = RGB( 0, 0, 0 );
|
||||||
dc->brush_org.x = 0;
|
dc->brush_org.x = 0;
|
||||||
|
@ -398,7 +398,6 @@ INT CDECL nulldrv_SaveDC( PHYSDEV dev )
|
||||||
newdc->hFont = dc->hFont;
|
newdc->hFont = dc->hFont;
|
||||||
newdc->hBitmap = dc->hBitmap;
|
newdc->hBitmap = dc->hBitmap;
|
||||||
newdc->hPalette = dc->hPalette;
|
newdc->hPalette = dc->hPalette;
|
||||||
newdc->dcBrushColor = dc->dcBrushColor;
|
|
||||||
newdc->dcPenColor = dc->dcPenColor;
|
newdc->dcPenColor = dc->dcPenColor;
|
||||||
newdc->brush_org = dc->brush_org;
|
newdc->brush_org = dc->brush_org;
|
||||||
newdc->mapperFlags = dc->mapperFlags;
|
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_mode = dcs->attr->background_mode;
|
||||||
dc->attr->background_color = dcs->attr->background_color;
|
dc->attr->background_color = dcs->attr->background_color;
|
||||||
dc->attr->text_color = dcs->attr->text_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->dcPenColor = dcs->dcPenColor;
|
||||||
dc->brush_org = dcs->brush_org;
|
dc->brush_org = dcs->brush_org;
|
||||||
dc->mapperFlags = dcs->mapperFlags;
|
dc->mapperFlags = dcs->mapperFlags;
|
||||||
|
@ -1479,26 +1478,6 @@ DWORD WINAPI SetLayout(HDC hdc, DWORD layout)
|
||||||
return oldlayout;
|
return oldlayout;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
* 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.@)
|
* SetDCBrushColor (GDI32.@)
|
||||||
*/
|
*/
|
||||||
|
@ -1516,8 +1495,8 @@ COLORREF WINAPI SetDCBrushColor(HDC hdc, COLORREF crColor)
|
||||||
crColor = physdev->funcs->pSetDCBrushColor( physdev, crColor );
|
crColor = physdev->funcs->pSetDCBrushColor( physdev, crColor );
|
||||||
if (crColor != CLR_INVALID)
|
if (crColor != CLR_INVALID)
|
||||||
{
|
{
|
||||||
oldClr = dc->dcBrushColor;
|
oldClr = dc->attr->brush_color;
|
||||||
dc->dcBrushColor = crColor;
|
dc->attr->brush_color = crColor;
|
||||||
}
|
}
|
||||||
release_dc_ptr( dc );
|
release_dc_ptr( dc );
|
||||||
}
|
}
|
||||||
|
|
|
@ -2137,7 +2137,7 @@ HBRUSH CDECL dibdrv_SelectBrush( PHYSDEV dev, HBRUSH hbrush, const struct brush_
|
||||||
GetObjectW( hbrush, sizeof(logbrush), &logbrush );
|
GetObjectW( hbrush, sizeof(logbrush), &logbrush );
|
||||||
|
|
||||||
if (hbrush == GetStockObject( DC_BRUSH ))
|
if (hbrush == GetStockObject( DC_BRUSH ))
|
||||||
logbrush.lbColor = dc->dcBrushColor;
|
logbrush.lbColor = dc->attr->brush_color;
|
||||||
|
|
||||||
select_brush( pdev, &pdev->brush, &logbrush, pattern, TRUE );
|
select_brush( pdev, &pdev->brush, &logbrush, pattern, TRUE );
|
||||||
return hbrush;
|
return hbrush;
|
||||||
|
|
|
@ -74,6 +74,15 @@ COLORREF WINAPI GetBkColor( HDC hdc )
|
||||||
return dc_attr ? dc_attr->background_color : CLR_INVALID;
|
return dc_attr ? dc_attr->background_color : CLR_INVALID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* 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.@)
|
* GetTextColor (GDI32.@)
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -116,7 +116,6 @@ typedef struct tagDC
|
||||||
const struct font_gamma_ramp *font_gamma_ramp;
|
const struct font_gamma_ramp *font_gamma_ramp;
|
||||||
|
|
||||||
UINT font_code_page;
|
UINT font_code_page;
|
||||||
COLORREF dcBrushColor;
|
|
||||||
COLORREF dcPenColor;
|
COLORREF dcPenColor;
|
||||||
POINT brush_org;
|
POINT brush_org;
|
||||||
|
|
||||||
|
|
|
@ -100,6 +100,7 @@ typedef struct DC_ATTR
|
||||||
{
|
{
|
||||||
LONG disabled; /* disabled flag, controled by DCHF_(DISABLE|ENABLE)DC */
|
LONG disabled; /* disabled flag, controled by DCHF_(DISABLE|ENABLE)DC */
|
||||||
COLORREF background_color;
|
COLORREF background_color;
|
||||||
|
COLORREF brush_color;
|
||||||
COLORREF text_color;
|
COLORREF text_color;
|
||||||
POINT cur_pos;
|
POINT cur_pos;
|
||||||
INT graphics_mode;
|
INT graphics_mode;
|
||||||
|
|
Loading…
Reference in New Issue