Commit b32dd7bd authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

gdi32: Handle metafiles directly in OffsetViewportOrgEx.

parent 64e74f26
......@@ -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 );
......
......@@ -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,
......
......@@ -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 */
......
......@@ -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,
......
......@@ -560,6 +560,23 @@ BOOL WINAPI SetViewportOrgEx( HDC hdc, INT x, INT y, POINT *point )
}
/***********************************************************************
* 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.@)
*/
BOOL WINAPI GetWorldTransform( HDC hdc, XFORM *xform )
......
......@@ -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;
}
......@@ -344,24 +337,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.@)
*/
BOOL WINAPI OffsetWindowOrgEx( HDC hdc, INT x, INT y, LPPOINT pt )
......
......@@ -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 )
......
......@@ -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 */
......
......@@ -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;
......
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