From 90a7e79c1168e0a4b9f072ff958d7d9768af5ee4 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Thu, 29 Jul 2021 13:21:58 +0100 Subject: [PATCH] gdi32: Store rel abs mode in DC_ATTR. Signed-off-by: Jacek Caban Signed-off-by: Huw Davies Signed-off-by: Alexandre Julliard --- dlls/gdi32/dc.c | 25 ++++--------------------- dlls/gdi32/gdidc.c | 9 +++++++++ dlls/gdi32/ntgdi_private.h | 1 - include/ntgdi.h | 1 + 4 files changed, 14 insertions(+), 22 deletions(-) diff --git a/dlls/gdi32/dc.c b/dlls/gdi32/dc.c index efc3231ae27..db1c63ec62c 100644 --- a/dlls/gdi32/dc.c +++ b/dlls/gdi32/dc.c @@ -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 ); } diff --git a/dlls/gdi32/gdidc.c b/dlls/gdi32/gdidc.c index f8ec6083ccf..1523cb5e929 100644 --- a/dlls/gdi32/gdidc.c +++ b/dlls/gdi32/gdidc.c @@ -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.@) */ diff --git a/dlls/gdi32/ntgdi_private.h b/dlls/gdi32/ntgdi_private.h index 0f01102ed9d..21a6f6bbc01 100644 --- a/dlls/gdi32/ntgdi_private.h +++ b/dlls/gdi32/ntgdi_private.h @@ -118,7 +118,6 @@ typedef struct tagDC UINT font_code_page; WORD polyFillMode; WORD stretchBltMode; - WORD relAbsMode; COLORREF dcBrushColor; COLORREF dcPenColor; POINT brush_org; diff --git a/include/ntgdi.h b/include/ntgdi.h index ba9d1fe7a00..19c31cd3190 100644 --- a/include/ntgdi.h +++ b/include/ntgdi.h @@ -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;