From: Jacek Caban jacek@codeweavers.com
Signed-off-by: Jacek Caban jacek@codeweavers.com Signed-off-by: Huw Davies huw@codeweavers.com --- dlls/gdi32/enhmfdrv/dc.c | 12 ++---------- dlls/gdi32/enhmfdrv/enhmetafiledrv.h | 1 - dlls/gdi32/enhmfdrv/init.c | 2 +- dlls/gdi32/gdi_private.h | 2 ++ dlls/gdi32/gdidc.c | 17 +++++++++++++++++ dlls/gdi32/mapping.c | 26 -------------------------- dlls/gdi32/mfdrv/dc.c | 4 ++-- dlls/gdi32/mfdrv/init.c | 2 +- dlls/gdi32/mfdrv/metafiledrv.h | 1 - 9 files changed, 25 insertions(+), 42 deletions(-)
diff --git a/dlls/gdi32/enhmfdrv/dc.c b/dlls/gdi32/enhmfdrv/dc.c index 13d4a491faa..5c4440afc17 100644 --- a/dlls/gdi32/enhmfdrv/dc.c +++ b/dlls/gdi32/enhmfdrv/dc.c @@ -250,23 +250,15 @@ BOOL CDECL EMFDRV_SetWindowExtEx( PHYSDEV dev, INT cx, INT cy, SIZE *size ) return ret; }
-BOOL CDECL EMFDRV_SetViewportOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) +BOOL EMFDC_SetViewportOrgEx( DC_ATTR *dc_attr, INT x, INT y ) { - PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSetViewportOrgEx ); - EMFDRV_PDEVICE *physDev = get_emf_physdev( dev ); EMRSETVIEWPORTORGEX emr; - BOOL ret;
emr.emr.iType = EMR_SETVIEWPORTORGEX; emr.emr.nSize = sizeof(emr); emr.ptlOrigin.x = x; emr.ptlOrigin.y = y; - - if (!EMFDRV_WriteRecord( dev, &emr.emr )) return FALSE; - physDev->modifying_transform++; - ret = next->funcs->pSetViewportOrgEx( next, x, y, pt ); - physDev->modifying_transform--; - return ret; + return EMFDRV_WriteRecord( dc_attr->emf, &emr.emr ); }
BOOL CDECL EMFDRV_SetWindowOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) diff --git a/dlls/gdi32/enhmfdrv/enhmetafiledrv.h b/dlls/gdi32/enhmfdrv/enhmetafiledrv.h index b77c538aa75..a5e310787a1 100644 --- a/dlls/gdi32/enhmfdrv/enhmetafiledrv.h +++ b/dlls/gdi32/enhmfdrv/enhmetafiledrv.h @@ -110,7 +110,6 @@ extern INT CDECL EMFDRV_SetDIBitsToDevice( PHYSDEV dev, INT xDest, INT yDes BITMAPINFO *info, UINT coloruse ) DECLSPEC_HIDDEN; extern COLORREF CDECL EMFDRV_SetPixel( PHYSDEV dev, INT x, INT y, COLORREF color ) DECLSPEC_HIDDEN; extern COLORREF CDECL EMFDRV_SetTextColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN; -extern BOOL CDECL EMFDRV_SetViewportOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) DECLSPEC_HIDDEN; extern BOOL CDECL EMFDRV_SetWindowExtEx( PHYSDEV dev, INT x, INT y, SIZE *size ) DECLSPEC_HIDDEN; extern BOOL CDECL EMFDRV_SetWindowOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) DECLSPEC_HIDDEN; extern BOOL CDECL EMFDRV_SetWorldTransform( PHYSDEV dev, const XFORM *xform ) DECLSPEC_HIDDEN; diff --git a/dlls/gdi32/enhmfdrv/init.c b/dlls/gdi32/enhmfdrv/init.c index 6918dd76c9b..c70af9f7cf5 100644 --- a/dlls/gdi32/enhmfdrv/init.c +++ b/dlls/gdi32/enhmfdrv/init.c @@ -130,7 +130,7 @@ static const struct gdi_dc_funcs emfdrv_driver = EMFDRV_SetPixel, /* pSetPixel */ EMFDRV_SetTextColor, /* pSetTextColor */ NULL, /* pSetViewportExtEx */ - EMFDRV_SetViewportOrgEx, /* pSetViewportOrgEx */ + NULL, /* pSetViewportOrgEx */ EMFDRV_SetWindowExtEx, /* pSetWindowExtEx */ EMFDRV_SetWindowOrgEx, /* pSetWindowOrgEx */ EMFDRV_SetWorldTransform, /* pSetWorldTransform */ diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h index f74b45a6f98..5d6b308e85c 100644 --- a/dlls/gdi32/gdi_private.h +++ b/dlls/gdi32/gdi_private.h @@ -99,6 +99,7 @@ extern BOOL METADC_SetStretchBltMode( HDC hdc, INT mode ) DECLSPEC_HIDDEN; extern BOOL METADC_SetTextAlign( HDC hdc, UINT align ) DECLSPEC_HIDDEN; extern BOOL METADC_SetTextJustification( HDC hdc, INT extra, INT breaks ) DECLSPEC_HIDDEN; extern BOOL METADC_SetViewportExtEx( HDC hdc, INT x, INT y ) DECLSPEC_HIDDEN; +extern BOOL METADC_SetViewportOrgEx( HDC hdc, INT x, INT y ) DECLSPEC_HIDDEN;
/* enhanced metafiles */ extern BOOL EMFDC_AbortPath( DC_ATTR *dc_attr ) DECLSPEC_HIDDEN; @@ -166,5 +167,6 @@ extern BOOL EMFDC_SetStretchBltMode( DC_ATTR *dc_attr, INT mode ) DECLSPEC_HIDDE extern BOOL EMFDC_SetTextAlign( DC_ATTR *dc_attr, UINT align ) DECLSPEC_HIDDEN; extern BOOL EMFDC_SetTextJustification( DC_ATTR *dc_attr, INT extra, INT breaks ) DECLSPEC_HIDDEN; extern BOOL EMFDC_SetViewportExtEx( DC_ATTR *dc_attr, INT x, INT y ) DECLSPEC_HIDDEN; +extern BOOL EMFDC_SetViewportOrgEx( DC_ATTR *dc_attr, INT x, INT y ) DECLSPEC_HIDDEN;
#endif /* __WINE_GDI_PRIVATE_H */ diff --git a/dlls/gdi32/gdidc.c b/dlls/gdi32/gdidc.c index 52258a4f71f..026fde6a028 100644 --- a/dlls/gdi32/gdidc.c +++ b/dlls/gdi32/gdidc.c @@ -506,6 +506,23 @@ BOOL WINAPI GetViewportOrgEx( HDC hdc, POINT *point ) return TRUE; }
+/*********************************************************************** + * SetViewportOrgEx (GDI32.@) + */ +BOOL WINAPI SetViewportOrgEx( HDC hdc, INT x, INT y, POINT *point ) +{ + DC_ATTR *dc_attr; + + if (is_meta_dc( hdc )) return METADC_SetViewportOrgEx( hdc, x, y ); + if (!(dc_attr = get_dc_attr( hdc ))) return FALSE; + if (dc_attr->emf && !EMFDC_SetViewportOrgEx( dc_attr, x, y )) return FALSE; + + if (point) *point = dc_attr->vport_org; + dc_attr->vport_org.x = x; + dc_attr->vport_org.y = y; + return NtGdiComputeXformCoefficients( hdc ); +} + /*********************************************************************** * GetWorldTransform (GDI32.@) */ diff --git a/dlls/gdi32/mapping.c b/dlls/gdi32/mapping.c index 29eed8da843..65e47f8e998 100644 --- a/dlls/gdi32/mapping.c +++ b/dlls/gdi32/mapping.c @@ -177,14 +177,6 @@ BOOL CDECL nulldrv_SetViewportExtEx( PHYSDEV dev, INT cx, INT cy, SIZE *size )
BOOL CDECL nulldrv_SetViewportOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) { - DC *dc = get_nulldrv_dc( dev ); - - if (pt) - *pt = dc->attr->vport_org; - - dc->attr->vport_org.x = x; - dc->attr->vport_org.y = y; - DC_UpdateXforms( dc ); return TRUE; }
@@ -373,24 +365,6 @@ BOOL WINAPI NtGdiComputeXformCoefficients( HDC hdc ) }
-/*********************************************************************** - * SetViewportOrgEx (GDI32.@) - */ -BOOL WINAPI SetViewportOrgEx( HDC hdc, INT x, INT y, LPPOINT pt ) -{ - BOOL ret = FALSE; - DC * dc = get_dc_ptr( hdc ); - - if (dc) - { - PHYSDEV physdev = GET_DC_PHYSDEV( dc, pSetViewportOrgEx ); - ret = physdev->funcs->pSetViewportOrgEx( physdev, x, y, pt ); - release_dc_ptr( dc ); - } - return ret; -} - - /*********************************************************************** * SetWindowExtEx (GDI32.@) */ diff --git a/dlls/gdi32/mfdrv/dc.c b/dlls/gdi32/mfdrv/dc.c index 20d12a5ada6..16184129b7d 100644 --- a/dlls/gdi32/mfdrv/dc.c +++ b/dlls/gdi32/mfdrv/dc.c @@ -100,9 +100,9 @@ BOOL METADC_SetViewportExtEx( HDC hdc, INT x, INT y ) return metadc_param2( hdc, META_SETVIEWPORTEXT, x, y ); }
-BOOL CDECL MFDRV_SetViewportOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) +BOOL METADC_SetViewportOrgEx( HDC hdc, INT x, INT y ) { - return MFDRV_MetaParam2( dev, META_SETVIEWPORTORG, x, y ); + return metadc_param2( hdc, META_SETVIEWPORTORG, x, y ); }
BOOL CDECL MFDRV_SetWindowExtEx( PHYSDEV dev, INT x, INT y, SIZE *size ) diff --git a/dlls/gdi32/mfdrv/init.c b/dlls/gdi32/mfdrv/init.c index 7eec8eb9d70..959ea48c9e0 100644 --- a/dlls/gdi32/mfdrv/init.c +++ b/dlls/gdi32/mfdrv/init.c @@ -195,7 +195,7 @@ static const struct gdi_dc_funcs MFDRV_Funcs = NULL, /* pSetPixel */ MFDRV_SetTextColor, /* pSetTextColor */ NULL, /* pSetViewportExtEx */ - MFDRV_SetViewportOrgEx, /* pSetViewportOrgEx */ + NULL, /* pSetViewportOrgEx */ MFDRV_SetWindowExtEx, /* pSetWindowExtEx */ MFDRV_SetWindowOrgEx, /* pSetWindowOrgEx */ NULL, /* pSetWorldTransform */ diff --git a/dlls/gdi32/mfdrv/metafiledrv.h b/dlls/gdi32/mfdrv/metafiledrv.h index f478508bc4b..4c9c5534597 100644 --- a/dlls/gdi32/mfdrv/metafiledrv.h +++ b/dlls/gdi32/mfdrv/metafiledrv.h @@ -99,7 +99,6 @@ extern COLORREF CDECL MFDRV_SetBkColor( PHYSDEV dev, COLORREF color ) DECLSPEC_H extern COLORREF CDECL MFDRV_SetDCBrushColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN; extern COLORREF CDECL MFDRV_SetDCPenColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN; extern COLORREF CDECL MFDRV_SetTextColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN; -extern BOOL CDECL MFDRV_SetViewportOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) DECLSPEC_HIDDEN; extern BOOL CDECL MFDRV_SetWindowExtEx( PHYSDEV dev, INT x, INT y, SIZE *size ) DECLSPEC_HIDDEN; extern BOOL CDECL MFDRV_SetWindowOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) DECLSPEC_HIDDEN; extern BOOL CDECL MFDRV_StretchBlt( PHYSDEV devDst, struct bitblt_coords *dst,