Jacek Caban : gdi32: Store virtual resolution and size in DC_ATTR.
Alexandre Julliard
julliard at winehq.org
Tue Aug 10 16:24:07 CDT 2021
Module: wine
Branch: master
Commit: ec4297f1e7eefe74d3e3ec90d243eaebdc285882
URL: https://source.winehq.org/git/wine.git/?a=commit;h=ec4297f1e7eefe74d3e3ec90d243eaebdc285882
Author: Jacek Caban <jacek at codeweavers.com>
Date: Tue Aug 10 07:37:39 2021 +0100
gdi32: Store virtual resolution and size in DC_ATTR.
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/gdi32/dc.c | 6 ++----
dlls/gdi32/mapping.c | 12 ++++++------
dlls/gdi32/ntgdi_private.h | 2 --
include/ntgdi.h | 2 ++
4 files changed, 10 insertions(+), 12 deletions(-)
diff --git a/dlls/gdi32/dc.c b/dlls/gdi32/dc.c
index 3cd3f72d4da..93decc58926 100644
--- a/dlls/gdi32/dc.c
+++ b/dlls/gdi32/dc.c
@@ -428,8 +428,8 @@ BOOL CDECL nulldrv_RestoreDC( PHYSDEV dev, INT level )
dc->attr->wnd_ext = dcs->attr->wnd_ext;
dc->attr->vport_org = dcs->attr->vport_org;
dc->attr->vport_ext = dcs->attr->vport_ext;
- dc->virtual_res = dcs->virtual_res;
- dc->virtual_size = dcs->virtual_size;
+ dc->attr->virtual_res = dcs->attr->virtual_res;
+ dc->attr->virtual_size = dcs->attr->virtual_size;
if (dcs->hClipRgn)
{
@@ -550,8 +550,6 @@ INT WINAPI NtGdiSaveDC( HDC hdc )
newdc->xformWorld2Vport = dc->xformWorld2Vport;
newdc->xformVport2World = dc->xformVport2World;
newdc->vport2WorldValid = dc->vport2WorldValid;
- newdc->virtual_res = dc->virtual_res;
- newdc->virtual_size = dc->virtual_size;
/* Get/SetDCState() don't change hVisRgn field ("Undoc. Windows" p.559). */
diff --git a/dlls/gdi32/mapping.c b/dlls/gdi32/mapping.c
index 0c440908beb..d5d82c8aef9 100644
--- a/dlls/gdi32/mapping.c
+++ b/dlls/gdi32/mapping.c
@@ -31,7 +31,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(dc);
static SIZE get_dc_virtual_size( DC *dc )
{
- SIZE ret = dc->virtual_size;
+ SIZE ret = dc->attr->virtual_size;
if (!ret.cx)
{
@@ -43,7 +43,7 @@ static SIZE get_dc_virtual_size( DC *dc )
static SIZE get_dc_virtual_res( DC *dc )
{
- SIZE ret = dc->virtual_res;
+ SIZE ret = dc->attr->virtual_res;
if (!ret.cx)
{
@@ -630,10 +630,10 @@ BOOL WINAPI NtGdiSetVirtualResolution( HDC hdc, DWORD horz_res, DWORD vert_res,
dc = get_dc_ptr( hdc );
if (!dc) return FALSE;
- dc->virtual_res.cx = horz_res;
- dc->virtual_res.cy = vert_res;
- dc->virtual_size.cx = horz_size;
- dc->virtual_size.cy = vert_size;
+ dc->attr->virtual_res.cx = horz_res;
+ dc->attr->virtual_res.cy = vert_res;
+ dc->attr->virtual_size.cx = horz_size;
+ dc->attr->virtual_size.cy = vert_size;
release_dc_ptr( dc );
return TRUE;
diff --git a/dlls/gdi32/ntgdi_private.h b/dlls/gdi32/ntgdi_private.h
index de7ed17369f..62e6e5101ee 100644
--- a/dlls/gdi32/ntgdi_private.h
+++ b/dlls/gdi32/ntgdi_private.h
@@ -80,8 +80,6 @@ typedef struct tagDC
BOOL bounds_enabled:1; /* bounds tracking is enabled */
BOOL path_open:1; /* path is currently open (only for saved DCs) */
- SIZE virtual_res; /* Initially HORZRES,VERTRES. Changed by SetVirtualResolution */
- SIZE virtual_size; /* Initially HORZSIZE,VERTSIZE. Changed by SetVirtualResolution */
RECT device_rect; /* rectangle for the whole device */
int pixel_format; /* pixel format (for memory DCs) */
UINT aa_flags; /* anti-aliasing flags to pass to GetGlyphOutline for current font */
diff --git a/include/ntgdi.h b/include/ntgdi.h
index a1e9c123799..d2b5576d316 100644
--- a/include/ntgdi.h
+++ b/include/ntgdi.h
@@ -136,6 +136,8 @@ typedef struct DC_ATTR
SIZE wnd_ext; /* window extent */
POINT vport_org; /* viewport origin */
SIZE vport_ext; /* viewport extent */
+ SIZE virtual_res;
+ SIZE virtual_size;
void *emf;
} DC_ATTR;
More information about the wine-cvs
mailing list