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 | 26 -------------------------- dlls/gdi32/mfdrv/dc.c | 4 ++-- dlls/gdi32/mfdrv/init.c | 2 +- dlls/gdi32/mfdrv/metafiledrv.h | 1 - 9 files changed, 22 insertions(+), 54 deletions(-)
diff --git a/dlls/gdi32/enhmfdrv/dc.c b/dlls/gdi32/enhmfdrv/dc.c index 4db80ceb9cd..4e7602f1f38 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_OffsetWindowOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) -{ - PHYSDEV next = GET_NEXT_PHYSDEV( dev, pOffsetWindowOrgEx ); - EMFDRV_PDEVICE *physDev = get_emf_physdev( dev ); - EMRSETWINDOWORGEX emr; - POINT prev; - BOOL ret; - - GetWindowOrgEx( dev->hdc, &prev ); - - emr.emr.iType = EMR_SETWINDOWORGEX; - 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->pOffsetWindowOrgEx( next, x, y, pt ); - physDev->modifying_transform--; - return ret; -} - BOOL EMFDC_SetMapperFlags( DC_ATTR *dc_attr, DWORD flags ) { EMRSETMAPPERFLAGS emr; diff --git a/dlls/gdi32/enhmfdrv/enhmetafiledrv.h b/dlls/gdi32/enhmfdrv/enhmetafiledrv.h index 23a46ebfc55..7e289dd04c5 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_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, INT xstart, INT ystart, INT xend, INT yend ) DECLSPEC_HIDDEN; diff --git a/dlls/gdi32/enhmfdrv/init.c b/dlls/gdi32/enhmfdrv/init.c index c8d68fbc782..424f69cd9b4 100644 --- a/dlls/gdi32/enhmfdrv/init.c +++ b/dlls/gdi32/enhmfdrv/init.c @@ -97,7 +97,7 @@ static const struct gdi_dc_funcs emfdrv_driver = EMFDRV_ModifyWorldTransform, /* pModifyWorldTransform */ NULL, /* pMoveTo */ NULL, /* pOffsetViewportOrgEx */ - EMFDRV_OffsetWindowOrgEx, /* pOffsetWindowOrgEx */ + NULL, /* pOffsetWindowOrgEx */ NULL, /* pPaintRgn */ EMFDRV_PatBlt, /* pPatBlt */ EMFDRV_Pie, /* pPie */ diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h index 700632c803d..489f4475736 100644 --- a/dlls/gdi32/gdi_private.h +++ b/dlls/gdi32/gdi_private.h @@ -68,6 +68,7 @@ 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_OffsetWindowOrgEx( 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 a0a07bb97be..5e6cd9dbb04 100644 --- a/dlls/gdi32/gdidc.c +++ b/dlls/gdi32/gdidc.c @@ -501,6 +501,23 @@ BOOL WINAPI SetWindowOrgEx( HDC hdc, INT x, INT y, POINT *point ) return NtGdiComputeXformCoefficients( hdc ); }
+/*********************************************************************** + * OffsetWindowOrgEx (GDI32.@) + */ +BOOL WINAPI OffsetWindowOrgEx( HDC hdc, INT x, INT y, POINT *point ) +{ + DC_ATTR *dc_attr; + + if (is_meta_dc( hdc )) return METADC_OffsetWindowOrgEx( hdc, x, y ); + if (!(dc_attr = get_dc_attr( hdc ))) return FALSE; + if (point) *point = dc_attr->wnd_org; + dc_attr->wnd_org.x += x; + dc_attr->wnd_org.y += y; + if (dc_attr->emf && !EMFDC_SetWindowOrgEx( dc_attr, dc_attr->wnd_org.x, + dc_attr->wnd_org.y )) return FALSE; + return NtGdiComputeXformCoefficients( hdc ); +} + /*********************************************************************** * GetViewportExtEx (GDI32.@) */ diff --git a/dlls/gdi32/mapping.c b/dlls/gdi32/mapping.c index 452d0597835..3dcaf3f430f 100644 --- a/dlls/gdi32/mapping.c +++ b/dlls/gdi32/mapping.c @@ -93,14 +93,6 @@ BOOL CDECL nulldrv_OffsetViewportOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt )
BOOL CDECL nulldrv_OffsetWindowOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) { - DC *dc = get_nulldrv_dc( dev ); - - if (pt) - *pt = dc->attr->wnd_org; - - dc->attr->wnd_org.x += x; - dc->attr->wnd_org.y += y; - DC_UpdateXforms( dc ); return TRUE; }
@@ -336,24 +328,6 @@ BOOL WINAPI NtGdiComputeXformCoefficients( HDC hdc ) }
-/*********************************************************************** - * OffsetWindowOrgEx (GDI32.@) - */ -BOOL WINAPI OffsetWindowOrgEx( 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, pOffsetWindowOrgEx ); - ret = physdev->funcs->pOffsetWindowOrgEx( physdev, x, y, pt ); - release_dc_ptr( dc ); - } - return ret; -} - - /*********************************************************************** * NtGdiScaleViewportExtEx (win32u.@) */ diff --git a/dlls/gdi32/mfdrv/dc.c b/dlls/gdi32/mfdrv/dc.c index a9147fc9354..6b7b58070b4 100644 --- a/dlls/gdi32/mfdrv/dc.c +++ b/dlls/gdi32/mfdrv/dc.c @@ -120,9 +120,9 @@ BOOL METADC_OffsetViewportOrgEx( HDC hdc, INT x, INT y ) return metadc_param2( hdc, META_OFFSETVIEWPORTORG, x, y ); }
-BOOL CDECL MFDRV_OffsetWindowOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) +BOOL METADC_OffsetWindowOrgEx( HDC hdc, INT x, INT y ) { - return MFDRV_MetaParam2( dev, META_OFFSETWINDOWORG, x, y ); + return metadc_param2( hdc, META_OFFSETWINDOWORG, x, y ); }
BOOL METADC_ScaleViewportExtEx( HDC hdc, INT x_num, INT x_denom, INT y_num, INT y_denom ) diff --git a/dlls/gdi32/mfdrv/init.c b/dlls/gdi32/mfdrv/init.c index dbdbc92bd11..e6c2a905df8 100644 --- a/dlls/gdi32/mfdrv/init.c +++ b/dlls/gdi32/mfdrv/init.c @@ -162,7 +162,7 @@ static const struct gdi_dc_funcs MFDRV_Funcs = NULL, /* pModifyWorldTransform */ NULL, /* pMoveTo */ NULL, /* pOffsetViewportOrgEx */ - MFDRV_OffsetWindowOrgEx, /* pOffsetWindowOrgEx */ + NULL, /* pOffsetWindowOrgEx */ NULL, /* pPaintRgn */ NULL, /* pPatBlt */ NULL, /* pPie */ diff --git a/dlls/gdi32/mfdrv/metafiledrv.h b/dlls/gdi32/mfdrv/metafiledrv.h index 7650c8d54e9..01f4f618432 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_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; extern BOOL CDECL MFDRV_RestoreDC( PHYSDEV dev, INT level ) DECLSPEC_HIDDEN;