diff --git a/dlls/gdi32/dc.c b/dlls/gdi32/dc.c index bae1e9d21ab..fd4a1d3abd0 100644 --- a/dlls/gdi32/dc.c +++ b/dlls/gdi32/dc.c @@ -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; @@ -1479,26 +1478,6 @@ DWORD WINAPI SetLayout(HDC hdc, DWORD layout) 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.@) */ @@ -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 ); } diff --git a/dlls/gdi32/dibdrv/objects.c b/dlls/gdi32/dibdrv/objects.c index 3a0ea7465a6..9d2c4022759 100644 --- a/dlls/gdi32/dibdrv/objects.c +++ b/dlls/gdi32/dibdrv/objects.c @@ -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; diff --git a/dlls/gdi32/gdidc.c b/dlls/gdi32/gdidc.c index bbd172239cd..9e85143ce0c 100644 --- a/dlls/gdi32/gdidc.c +++ b/dlls/gdi32/gdidc.c @@ -74,6 +74,15 @@ COLORREF WINAPI GetBkColor( HDC hdc ) 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.@) */ diff --git a/dlls/gdi32/ntgdi_private.h b/dlls/gdi32/ntgdi_private.h index 19a5819f031..fb110409357 100644 --- a/dlls/gdi32/ntgdi_private.h +++ b/dlls/gdi32/ntgdi_private.h @@ -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; diff --git a/include/ntgdi.h b/include/ntgdi.h index 08df860a5e6..1f33cfe5143 100644 --- a/include/ntgdi.h +++ b/include/ntgdi.h @@ -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;