gdi32: Handle metafiles directly in OffsetViewportOrgEx.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2021-08-10 07:37:44 +01:00 committed by Alexandre Julliard
parent 64e74f26aa
commit b32dd7bdb9
9 changed files with 22 additions and 53 deletions

View file

@ -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 );

View file

@ -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,

View file

@ -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 */

View file

@ -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,

View file

@ -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.@)
*/

View file

@ -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.@)
*/

View file

@ -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 )

View file

@ -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 */

View file

@ -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;