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 | 22 ---------------------- dlls/gdi32/enhmfdrv/enhmetafiledrv.h | 1 - dlls/gdi32/enhmfdrv/init.c | 2 +- dlls/gdi32/gdi_private.h | 1 + dlls/gdi32/gdidc.c | 17 +++++++++++++++++ dlls/gdi32/mapping.c | 25 ------------------------- dlls/gdi32/mfdrv/dc.c | 4 ++-- dlls/gdi32/mfdrv/init.c | 2 +- dlls/gdi32/mfdrv/metafiledrv.h | 1 - 9 files changed, 22 insertions(+), 53 deletions(-)
diff --git a/dlls/gdi32/enhmfdrv/dc.c b/dlls/gdi32/enhmfdrv/dc.c index e67380d7766..4db80ceb9cd 100644 --- a/dlls/gdi32/enhmfdrv/dc.c +++ b/dlls/gdi32/enhmfdrv/dc.c @@ -349,28 +349,6 @@ BOOL CDECL EMFDRV_ModifyWorldTransform( PHYSDEV dev, const XFORM *xform, DWORD m return ret; }
-BOOL CDECL EMFDRV_OffsetViewportOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) -{ - PHYSDEV next = GET_NEXT_PHYSDEV( dev, pOffsetViewportOrgEx ); - EMFDRV_PDEVICE *physDev = get_emf_physdev( dev ); - EMRSETVIEWPORTORGEX emr; - POINT prev; - BOOL ret; - - GetViewportOrgEx( dev->hdc, &prev ); - - emr.emr.iType = EMR_SETVIEWPORTORGEX; - emr.emr.nSize = sizeof(emr); - emr.ptlOrigin.x = prev.x + x; - emr.ptlOrigin.y = prev.y + y; - - if (!EMFDRV_WriteRecord( dev, &emr.emr )) return FALSE; - physDev->modifying_transform++; - ret = next->funcs->pOffsetViewportOrgEx( next, x, y, pt ); - physDev->modifying_transform--; - return ret; -} - BOOL CDECL EMFDRV_OffsetWindowOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) { PHYSDEV next = GET_NEXT_PHYSDEV( dev, pOffsetWindowOrgEx ); diff --git a/dlls/gdi32/enhmfdrv/enhmetafiledrv.h b/dlls/gdi32/enhmfdrv/enhmetafiledrv.h index 3af92286d1f..23a46ebfc55 100644 --- a/dlls/gdi32/enhmfdrv/enhmetafiledrv.h +++ b/dlls/gdi32/enhmfdrv/enhmetafiledrv.h @@ -82,7 +82,6 @@ extern BOOL CDECL EMFDRV_GradientFill( PHYSDEV dev, TRIVERTEX *vert_array, U extern BOOL CDECL EMFDRV_InvertRgn( PHYSDEV dev, HRGN hrgn ) DECLSPEC_HIDDEN; extern BOOL CDECL EMFDRV_LineTo( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN; extern BOOL CDECL EMFDRV_ModifyWorldTransform( PHYSDEV dev, const XFORM *xform, DWORD mode ) DECLSPEC_HIDDEN; -extern BOOL CDECL EMFDRV_OffsetViewportOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) DECLSPEC_HIDDEN; extern BOOL CDECL EMFDRV_OffsetWindowOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) DECLSPEC_HIDDEN; extern BOOL CDECL EMFDRV_PatBlt( PHYSDEV dev, struct bitblt_coords *dst, DWORD rop ) DECLSPEC_HIDDEN; extern BOOL CDECL EMFDRV_Pie( PHYSDEV dev, INT left, INT top, INT right, INT bottom, diff --git a/dlls/gdi32/enhmfdrv/init.c b/dlls/gdi32/enhmfdrv/init.c index 0b1d2fbb1cf..c8d68fbc782 100644 --- a/dlls/gdi32/enhmfdrv/init.c +++ b/dlls/gdi32/enhmfdrv/init.c @@ -96,7 +96,7 @@ static const struct gdi_dc_funcs emfdrv_driver = EMFDRV_LineTo, /* pLineTo */ EMFDRV_ModifyWorldTransform, /* pModifyWorldTransform */ NULL, /* pMoveTo */ - EMFDRV_OffsetViewportOrgEx, /* pOffsetViewportOrgEx */ + NULL, /* pOffsetViewportOrgEx */ EMFDRV_OffsetWindowOrgEx, /* pOffsetWindowOrgEx */ NULL, /* pPaintRgn */ EMFDRV_PatBlt, /* pPatBlt */ diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h index f3ce7b910fa..700632c803d 100644 --- a/dlls/gdi32/gdi_private.h +++ b/dlls/gdi32/gdi_private.h @@ -67,6 +67,7 @@ extern BOOL METADC_InvertRgn( HDC hdc, HRGN hrgn ) DECLSPEC_HIDDEN; extern BOOL METADC_LineTo( HDC hdc, INT x, INT y ) DECLSPEC_HIDDEN; extern BOOL METADC_MoveTo( HDC hdc, INT x, INT y ) DECLSPEC_HIDDEN; extern BOOL METADC_OffsetClipRgn( HDC hdc, INT x, INT y ) DECLSPEC_HIDDEN; +extern BOOL METADC_OffsetViewportOrgEx( HDC hdc, INT x, INT y ) DECLSPEC_HIDDEN; extern BOOL METADC_PaintRgn( HDC hdc, HRGN hrgn ) DECLSPEC_HIDDEN; extern BOOL METADC_PatBlt( HDC hdc, INT left, INT top, INT width, INT height, DWORD rop ); extern BOOL METADC_Pie( HDC hdc, INT left, INT top, INT right, INT bottom, diff --git a/dlls/gdi32/gdidc.c b/dlls/gdi32/gdidc.c index f58f93d036d..a0a07bb97be 100644 --- a/dlls/gdi32/gdidc.c +++ b/dlls/gdi32/gdidc.c @@ -559,6 +559,23 @@ BOOL WINAPI SetViewportOrgEx( HDC hdc, INT x, INT y, POINT *point ) return NtGdiComputeXformCoefficients( hdc ); }
+/*********************************************************************** + * OffsetViewportOrgEx (GDI32.@) + */ +BOOL WINAPI OffsetViewportOrgEx( HDC hdc, INT x, INT y, POINT *point ) +{ + DC_ATTR *dc_attr; + + if (is_meta_dc( hdc )) return METADC_OffsetViewportOrgEx( hdc, x, y ); + if (!(dc_attr = get_dc_attr( hdc ))) return FALSE; + if (point) *point = dc_attr->vport_org; + dc_attr->vport_org.x += x; + dc_attr->vport_org.y += y; + if (dc_attr->emf && !EMFDC_SetViewportOrgEx( dc_attr, dc_attr->vport_org.x, + dc_attr->vport_org.y )) return FALSE; + return NtGdiComputeXformCoefficients( hdc ); +} + /*********************************************************************** * GetWorldTransform (GDI32.@) */ diff --git a/dlls/gdi32/mapping.c b/dlls/gdi32/mapping.c index 6c22349a371..452d0597835 100644 --- a/dlls/gdi32/mapping.c +++ b/dlls/gdi32/mapping.c @@ -88,13 +88,6 @@ static void MAPPING_FixIsotropic( DC * dc )
BOOL CDECL nulldrv_OffsetViewportOrgEx( 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; }
@@ -343,24 +336,6 @@ BOOL WINAPI NtGdiComputeXformCoefficients( HDC hdc ) }
-/*********************************************************************** - * OffsetViewportOrgEx (GDI32.@) - */ -BOOL WINAPI OffsetViewportOrgEx( 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, pOffsetViewportOrgEx ); - ret = physdev->funcs->pOffsetViewportOrgEx( physdev, x, y, pt ); - release_dc_ptr( dc ); - } - return ret; -} - - /*********************************************************************** * OffsetWindowOrgEx (GDI32.@) */ diff --git a/dlls/gdi32/mfdrv/dc.c b/dlls/gdi32/mfdrv/dc.c index 9818dc0d9d9..a9147fc9354 100644 --- a/dlls/gdi32/mfdrv/dc.c +++ b/dlls/gdi32/mfdrv/dc.c @@ -115,9 +115,9 @@ BOOL METADC_SetWindowOrgEx( HDC hdc, INT x, INT y ) return metadc_param2( hdc, META_SETWINDOWORG, x, y ); }
-BOOL CDECL MFDRV_OffsetViewportOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) +BOOL METADC_OffsetViewportOrgEx( HDC hdc, INT x, INT y ) { - return MFDRV_MetaParam2( dev, META_OFFSETVIEWPORTORG, x, y ); + return metadc_param2( hdc, META_OFFSETVIEWPORTORG, x, y ); }
BOOL CDECL MFDRV_OffsetWindowOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) diff --git a/dlls/gdi32/mfdrv/init.c b/dlls/gdi32/mfdrv/init.c index d0c277f791d..dbdbc92bd11 100644 --- a/dlls/gdi32/mfdrv/init.c +++ b/dlls/gdi32/mfdrv/init.c @@ -161,7 +161,7 @@ static const struct gdi_dc_funcs MFDRV_Funcs = NULL, /* pLineTo */ NULL, /* pModifyWorldTransform */ NULL, /* pMoveTo */ - MFDRV_OffsetViewportOrgEx, /* pOffsetViewportOrgEx */ + NULL, /* pOffsetViewportOrgEx */ MFDRV_OffsetWindowOrgEx, /* pOffsetWindowOrgEx */ NULL, /* pPaintRgn */ NULL, /* pPatBlt */ diff --git a/dlls/gdi32/mfdrv/metafiledrv.h b/dlls/gdi32/mfdrv/metafiledrv.h index 2d218f89787..7650c8d54e9 100644 --- a/dlls/gdi32/mfdrv/metafiledrv.h +++ b/dlls/gdi32/mfdrv/metafiledrv.h @@ -88,7 +88,6 @@ extern BOOL CDECL MFDRV_EndPath( PHYSDEV dev ) DECLSPEC_HIDDEN; extern BOOL CDECL MFDRV_FillPath( PHYSDEV dev ) DECLSPEC_HIDDEN; extern BOOL CDECL MFDRV_FillRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush ) DECLSPEC_HIDDEN; extern BOOL CDECL MFDRV_FlattenPath( PHYSDEV dev ) DECLSPEC_HIDDEN; -extern BOOL CDECL MFDRV_OffsetViewportOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) DECLSPEC_HIDDEN; extern BOOL CDECL MFDRV_OffsetWindowOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) DECLSPEC_HIDDEN; extern BOOL CDECL MFDRV_PolyBezier( PHYSDEV dev, const POINT* pt, DWORD count ) DECLSPEC_HIDDEN; extern BOOL CDECL MFDRV_PolyBezierTo( PHYSDEV dev, const POINT* pt, DWORD count ) DECLSPEC_HIDDEN;