Commit 80f9cd1f authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

gdi32: Handle metafiles directly in OffsetWindowOrgEx.

parent b32dd7bd
......@@ -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;
......
......@@ -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;
......
......@@ -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 */
......
......@@ -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,
......
......@@ -502,6 +502,23 @@ BOOL WINAPI SetWindowOrgEx( HDC hdc, INT x, INT y, POINT *point )
}
/***********************************************************************
* 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.@)
*/
BOOL WINAPI GetViewportExtEx( HDC hdc, SIZE *size )
......
......@@ -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;
}
......@@ -337,24 +329,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.@)
*/
BOOL WINAPI NtGdiScaleViewportExtEx( HDC hdc, INT x_num, INT x_denom,
......
......@@ -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 )
......
......@@ -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 */
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment