gdi32: Handle metafiles directly in SetWindowOrgEx.

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:43 +01:00 committed by Alexandre Julliard
parent 1cbd3307f7
commit 64e74f26aa
9 changed files with 25 additions and 42 deletions

View File

@ -253,23 +253,15 @@ BOOL EMFDC_SetViewportOrgEx( DC_ATTR *dc_attr, INT x, INT y )
return EMFDRV_WriteRecord( dc_attr->emf, &emr.emr );
}
BOOL CDECL EMFDRV_SetWindowOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt )
BOOL EMFDC_SetWindowOrgEx( DC_ATTR *dc_attr, INT x, INT y )
{
PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSetWindowOrgEx );
EMFDRV_PDEVICE *physDev = get_emf_physdev( dev );
EMRSETWINDOWORGEX emr;
BOOL ret;
emr.emr.iType = EMR_SETWINDOWORGEX;
emr.emr.nSize = sizeof(emr);
emr.ptlOrigin.x = x;
emr.ptlOrigin.y = y;
if (!EMFDRV_WriteRecord( dev, &emr.emr )) return FALSE;
physDev->modifying_transform++;
ret = next->funcs->pSetWindowOrgEx( next, x, y, pt );
physDev->modifying_transform--;
return ret;
return EMFDRV_WriteRecord( dc_attr->emf, &emr.emr );
}
BOOL EMFDC_ScaleViewportExtEx( DC_ATTR *dc_attr, INT x_num, INT x_denom, INT y_num, INT y_denom )

View File

@ -110,7 +110,6 @@ extern INT CDECL EMFDRV_SetDIBitsToDevice( PHYSDEV dev, INT xDest, INT yDes
BITMAPINFO *info, UINT coloruse ) DECLSPEC_HIDDEN;
extern COLORREF CDECL EMFDRV_SetPixel( PHYSDEV dev, INT x, INT y, COLORREF color ) DECLSPEC_HIDDEN;
extern COLORREF CDECL EMFDRV_SetTextColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN;
extern BOOL CDECL EMFDRV_SetWindowOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) DECLSPEC_HIDDEN;
extern BOOL CDECL EMFDRV_SetWorldTransform( PHYSDEV dev, const XFORM *xform ) DECLSPEC_HIDDEN;
extern BOOL CDECL EMFDRV_StretchBlt( PHYSDEV devDst, struct bitblt_coords *dst,
PHYSDEV devSrc, struct bitblt_coords *src, DWORD rop ) DECLSPEC_HIDDEN;

View File

@ -132,7 +132,7 @@ static const struct gdi_dc_funcs emfdrv_driver =
NULL, /* pSetViewportExtEx */
NULL, /* pSetViewportOrgEx */
NULL, /* pSetWindowExtEx */
EMFDRV_SetWindowOrgEx, /* pSetWindowOrgEx */
NULL, /* pSetWindowOrgEx */
EMFDRV_SetWorldTransform, /* pSetWorldTransform */
NULL, /* pStartDoc */
NULL, /* pStartPage */

View File

@ -101,6 +101,7 @@ extern BOOL METADC_SetTextJustification( HDC hdc, INT extra, INT breaks ) DECLSP
extern BOOL METADC_SetViewportExtEx( HDC hdc, INT x, INT y ) DECLSPEC_HIDDEN;
extern BOOL METADC_SetViewportOrgEx( HDC hdc, INT x, INT y ) DECLSPEC_HIDDEN;
extern BOOL METADC_SetWindowExtEx( HDC hdc, INT x, INT y ) DECLSPEC_HIDDEN;
extern BOOL METADC_SetWindowOrgEx( HDC, INT x, INT y ) DECLSPEC_HIDDEN;
/* enhanced metafiles */
extern BOOL EMFDC_AbortPath( DC_ATTR *dc_attr ) DECLSPEC_HIDDEN;
@ -170,5 +171,6 @@ extern BOOL EMFDC_SetTextJustification( DC_ATTR *dc_attr, INT extra, INT breaks
extern BOOL EMFDC_SetViewportExtEx( DC_ATTR *dc_attr, INT x, INT y ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_SetViewportOrgEx( DC_ATTR *dc_attr, INT x, INT y ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_SetWindowExtEx( DC_ATTR *dc_attr, INT x, INT y ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_SetWindowOrgEx( DC_ATTR *dc_attr, INT x, INT y ) DECLSPEC_HIDDEN;
#endif /* __WINE_GDI_PRIVATE_H */

View File

@ -484,6 +484,23 @@ BOOL WINAPI GetWindowOrgEx( HDC hdc, POINT *point )
return TRUE;
}
/***********************************************************************
* SetWindowOrgEx (GDI32.@)
*/
BOOL WINAPI SetWindowOrgEx( HDC hdc, INT x, INT y, POINT *point )
{
DC_ATTR *dc_attr;
if (is_meta_dc( hdc )) return METADC_SetWindowOrgEx( hdc, x, y );
if (!(dc_attr = get_dc_attr( hdc ))) return FALSE;
if (dc_attr->emf && !EMFDC_SetWindowOrgEx( dc_attr, x, y )) return FALSE;
if (point) *point = dc_attr->wnd_org;
dc_attr->wnd_org.x = x;
dc_attr->wnd_org.y = y;
return NtGdiComputeXformCoefficients( hdc );
}
/***********************************************************************
* GetViewportExtEx (GDI32.@)
*/

View File

@ -187,14 +187,6 @@ BOOL CDECL nulldrv_SetWindowExtEx( PHYSDEV dev, INT cx, INT cy, SIZE *size )
BOOL CDECL nulldrv_SetWindowOrgEx( 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;
}
@ -351,24 +343,6 @@ BOOL WINAPI NtGdiComputeXformCoefficients( HDC hdc )
}
/***********************************************************************
* SetWindowOrgEx (GDI32.@)
*/
BOOL WINAPI SetWindowOrgEx( 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, pSetWindowOrgEx );
ret = physdev->funcs->pSetWindowOrgEx( physdev, x, y, pt );
release_dc_ptr( dc );
}
return ret;
}
/***********************************************************************
* OffsetViewportOrgEx (GDI32.@)
*/

View File

@ -110,9 +110,9 @@ BOOL METADC_SetWindowExtEx( HDC hdc, INT x, INT y )
return metadc_param2( hdc, META_SETWINDOWEXT, x, y );
}
BOOL CDECL MFDRV_SetWindowOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt )
BOOL METADC_SetWindowOrgEx( HDC hdc, INT x, INT y )
{
return MFDRV_MetaParam2( dev, META_SETWINDOWORG, x, y );
return metadc_param2( hdc, META_SETWINDOWORG, x, y );
}
BOOL CDECL MFDRV_OffsetViewportOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt )

View File

@ -197,7 +197,7 @@ static const struct gdi_dc_funcs MFDRV_Funcs =
NULL, /* pSetViewportExtEx */
NULL, /* pSetViewportOrgEx */
NULL, /* pSetWindowExtEx */
MFDRV_SetWindowOrgEx, /* pSetWindowOrgEx */
NULL, /* pSetWindowOrgEx */
NULL, /* pSetWorldTransform */
NULL, /* pStartDoc */
NULL, /* pStartPage */

View File

@ -99,7 +99,6 @@ extern COLORREF CDECL MFDRV_SetBkColor( PHYSDEV dev, COLORREF color ) DECLSPEC_H
extern COLORREF CDECL MFDRV_SetDCBrushColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN;
extern COLORREF CDECL MFDRV_SetDCPenColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN;
extern COLORREF CDECL MFDRV_SetTextColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_SetWindowOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_StretchBlt( PHYSDEV devDst, struct bitblt_coords *dst,
PHYSDEV devSrc, struct bitblt_coords *src, DWORD rop ) DECLSPEC_HIDDEN;
extern INT CDECL MFDRV_SetDIBitsToDevice( PHYSDEV dev, INT xDest, INT yDest, DWORD cx,