gdi32: Store rel abs mode 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:
Jacek Caban 2021-07-29 13:21:58 +01:00 committed by Alexandre Julliard
parent 6502ce7add
commit 90a7e79c11
4 changed files with 14 additions and 22 deletions

View File

@ -85,7 +85,7 @@ static void set_initial_dc_state( DC *dc )
dc->attr->rop_mode = R2_COPYPEN;
dc->polyFillMode = ALTERNATE;
dc->stretchBltMode = BLACKONWHITE;
dc->relAbsMode = ABSOLUTE;
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 );
@ -400,7 +400,6 @@ INT CDECL nulldrv_SaveDC( PHYSDEV dev )
newdc->hPalette = dc->hPalette;
newdc->polyFillMode = dc->polyFillMode;
newdc->stretchBltMode = dc->stretchBltMode;
newdc->relAbsMode = dc->relAbsMode;
newdc->dcBrushColor = dc->dcBrushColor;
newdc->dcPenColor = dc->dcPenColor;
newdc->brush_org = dc->brush_org;
@ -470,7 +469,7 @@ BOOL CDECL nulldrv_RestoreDC( PHYSDEV dev, INT level )
dc->attr->rop_mode = dcs->attr->rop_mode;
dc->polyFillMode = dcs->polyFillMode;
dc->stretchBltMode = dcs->stretchBltMode;
dc->relAbsMode = dcs->relAbsMode;
dc->attr->rel_abs_mode = dcs->attr->rel_abs_mode;
dc->attr->background_mode = dcs->attr->background_mode;
dc->attr->background_color = dcs->attr->background_color;
dc->attr->text_color = dcs->attr->text_color;
@ -1395,22 +1394,6 @@ UINT WINAPI SetBoundsRect(HDC hdc, const RECT* rect, UINT flags)
}
/***********************************************************************
* GetRelAbs (GDI32.@)
*/
INT WINAPI GetRelAbs( HDC hdc, DWORD dwIgnore )
{
INT ret = 0;
DC *dc = get_dc_ptr( hdc );
if (dc)
{
ret = dc->relAbsMode;
release_dc_ptr( dc );
}
return ret;
}
/***********************************************************************
* SetRelAbs (GDI32.@)
*/
@ -1430,8 +1413,8 @@ INT WINAPI SetRelAbs( HDC hdc, INT mode )
mode = physdev->funcs->pSetRelAbs( physdev, mode );
if (mode)
{
ret = dc->relAbsMode;
dc->relAbsMode = mode;
ret = dc->attr->rel_abs_mode;
dc->attr->rel_abs_mode = mode;
}
release_dc_ptr( dc );
}

View File

@ -184,6 +184,15 @@ INT WINAPI GetROP2( HDC hdc )
return dc_attr ? dc_attr->rop_mode : 0;
}
/***********************************************************************
* GetRelAbs (GDI32.@)
*/
INT WINAPI GetRelAbs( HDC hdc, DWORD ignore )
{
DC_ATTR *dc_attr = get_dc_attr( hdc );
return dc_attr ? dc_attr->rel_abs_mode : 0;
}
/***********************************************************************
* SetROP2 (GDI32.@)
*/

View File

@ -118,7 +118,6 @@ typedef struct tagDC
UINT font_code_page;
WORD polyFillMode;
WORD stretchBltMode;
WORD relAbsMode;
COLORREF dcBrushColor;
COLORREF dcPenColor;
POINT brush_org;

View File

@ -108,6 +108,7 @@ typedef struct DC_ATTR
WORD text_align;
WORD background_mode;
WORD rop_mode;
WORD rel_abs_mode;
void *emf;
} DC_ATTR;