Commit 36bfd7cd authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

gdi32: Use NtGdiModifyWorldTransform for ModifyWorldTransform.

parent a67ac02d
...@@ -318,12 +318,9 @@ BOOL CDECL EMFDRV_SetWorldTransform( PHYSDEV dev, const XFORM *xform) ...@@ -318,12 +318,9 @@ BOOL CDECL EMFDRV_SetWorldTransform( PHYSDEV dev, const XFORM *xform)
return ret; return ret;
} }
BOOL CDECL EMFDRV_ModifyWorldTransform( PHYSDEV dev, const XFORM *xform, DWORD mode) BOOL EMFDC_ModifyWorldTransform( DC_ATTR *dc_attr, const XFORM *xform, DWORD mode )
{ {
PHYSDEV next = GET_NEXT_PHYSDEV( dev, pModifyWorldTransform );
EMFDRV_PDEVICE *physDev = get_emf_physdev( dev );
EMRMODIFYWORLDTRANSFORM emr; EMRMODIFYWORLDTRANSFORM emr;
BOOL ret;
emr.emr.iType = EMR_MODIFYWORLDTRANSFORM; emr.emr.iType = EMR_MODIFYWORLDTRANSFORM;
emr.emr.nSize = sizeof(emr); emr.emr.nSize = sizeof(emr);
...@@ -341,12 +338,7 @@ BOOL CDECL EMFDRV_ModifyWorldTransform( PHYSDEV dev, const XFORM *xform, DWORD m ...@@ -341,12 +338,7 @@ BOOL CDECL EMFDRV_ModifyWorldTransform( PHYSDEV dev, const XFORM *xform, DWORD m
emr.xform = *xform; emr.xform = *xform;
} }
emr.iMode = mode; emr.iMode = mode;
return EMFDRV_WriteRecord( dc_attr->emf, &emr.emr );
if (!EMFDRV_WriteRecord( dev, &emr.emr )) return FALSE;
physDev->modifying_transform++;
ret = next->funcs->pModifyWorldTransform( next, xform, mode );
physDev->modifying_transform--;
return ret;
} }
BOOL EMFDC_SetMapperFlags( DC_ATTR *dc_attr, DWORD flags ) BOOL EMFDC_SetMapperFlags( DC_ATTR *dc_attr, DWORD flags )
......
...@@ -81,7 +81,6 @@ extern BOOL CDECL EMFDRV_GradientFill( PHYSDEV dev, TRIVERTEX *vert_array, U ...@@ -81,7 +81,6 @@ extern BOOL CDECL EMFDRV_GradientFill( PHYSDEV dev, TRIVERTEX *vert_array, U
void *grad_array, ULONG ngrad, ULONG mode ) DECLSPEC_HIDDEN; void *grad_array, ULONG ngrad, ULONG mode ) DECLSPEC_HIDDEN;
extern BOOL CDECL EMFDRV_InvertRgn( PHYSDEV dev, HRGN hrgn ) DECLSPEC_HIDDEN; 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_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_PatBlt( PHYSDEV dev, struct bitblt_coords *dst, DWORD rop ) 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, 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; INT xstart, INT ystart, INT xend, INT yend ) DECLSPEC_HIDDEN;
......
...@@ -94,7 +94,7 @@ static const struct gdi_dc_funcs emfdrv_driver = ...@@ -94,7 +94,7 @@ static const struct gdi_dc_funcs emfdrv_driver =
EMFDRV_GradientFill, /* pGradientFill */ EMFDRV_GradientFill, /* pGradientFill */
EMFDRV_InvertRgn, /* pInvertRgn */ EMFDRV_InvertRgn, /* pInvertRgn */
EMFDRV_LineTo, /* pLineTo */ EMFDRV_LineTo, /* pLineTo */
EMFDRV_ModifyWorldTransform, /* pModifyWorldTransform */ NULL, /* pModifyWorldTransform */
NULL, /* pMoveTo */ NULL, /* pMoveTo */
NULL, /* pPaintRgn */ NULL, /* pPaintRgn */
EMFDRV_PatBlt, /* pPatBlt */ EMFDRV_PatBlt, /* pPatBlt */
......
...@@ -143,6 +143,8 @@ extern BOOL EMFDC_IntersectClipRect( DC_ATTR *dc_attr, INT left, INT top, INT ri ...@@ -143,6 +143,8 @@ extern BOOL EMFDC_IntersectClipRect( DC_ATTR *dc_attr, INT left, INT top, INT ri
INT bottom ) DECLSPEC_HIDDEN; INT bottom ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_InvertRgn( DC_ATTR *dc_attr, HRGN hrgn ) DECLSPEC_HIDDEN; extern BOOL EMFDC_InvertRgn( DC_ATTR *dc_attr, HRGN hrgn ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_LineTo( DC_ATTR *dc_attr, INT x, INT y ) DECLSPEC_HIDDEN; extern BOOL EMFDC_LineTo( DC_ATTR *dc_attr, INT x, INT y ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_ModifyWorldTransform( DC_ATTR *dc_attr, const XFORM *xform,
DWORD mode ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_MoveTo( DC_ATTR *dc_attr, INT x, INT y ) DECLSPEC_HIDDEN; extern BOOL EMFDC_MoveTo( DC_ATTR *dc_attr, INT x, INT y ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_OffsetClipRgn( DC_ATTR *dc_attr, INT x, INT y ) DECLSPEC_HIDDEN; extern BOOL EMFDC_OffsetClipRgn( DC_ATTR *dc_attr, INT x, INT y ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_PaintRgn( DC_ATTR *dc_attr, HRGN hrgn ) DECLSPEC_HIDDEN; extern BOOL EMFDC_PaintRgn( DC_ATTR *dc_attr, HRGN hrgn ) DECLSPEC_HIDDEN;
......
...@@ -601,6 +601,18 @@ BOOL WINAPI GetWorldTransform( HDC hdc, XFORM *xform ) ...@@ -601,6 +601,18 @@ BOOL WINAPI GetWorldTransform( HDC hdc, XFORM *xform )
return NtGdiGetTransform( hdc, 0x203, xform ); return NtGdiGetTransform( hdc, 0x203, xform );
} }
/****************************************************************************
* ModifyWorldTransform (GDI32.@)
*/
BOOL WINAPI ModifyWorldTransform( HDC hdc, const XFORM *xform, DWORD mode )
{
DC_ATTR *dc_attr;
if (!(dc_attr = get_dc_attr( hdc ))) return FALSE;
if (dc_attr->emf && !EMFDC_ModifyWorldTransform( dc_attr, xform, mode )) return FALSE;
return NtGdiModifyWorldTransform( hdc, xform, mode );
}
/*********************************************************************** /***********************************************************************
* SetStretchBltMode (GDI32.@) * SetStretchBltMode (GDI32.@)
*/ */
......
...@@ -143,28 +143,6 @@ BOOL set_map_mode( DC *dc, int mode ) ...@@ -143,28 +143,6 @@ BOOL set_map_mode( DC *dc, int mode )
BOOL CDECL nulldrv_ModifyWorldTransform( PHYSDEV dev, const XFORM *xform, DWORD mode ) BOOL CDECL nulldrv_ModifyWorldTransform( PHYSDEV dev, const XFORM *xform, DWORD mode )
{ {
DC *dc = get_nulldrv_dc( dev );
switch (mode)
{
case MWT_IDENTITY:
dc->xformWorld2Wnd.eM11 = 1.0f;
dc->xformWorld2Wnd.eM12 = 0.0f;
dc->xformWorld2Wnd.eM21 = 0.0f;
dc->xformWorld2Wnd.eM22 = 1.0f;
dc->xformWorld2Wnd.eDx = 0.0f;
dc->xformWorld2Wnd.eDy = 0.0f;
break;
case MWT_LEFTMULTIPLY:
CombineTransform( &dc->xformWorld2Wnd, xform, &dc->xformWorld2Wnd );
break;
case MWT_RIGHTMULTIPLY:
CombineTransform( &dc->xformWorld2Wnd, &dc->xformWorld2Wnd, xform );
break;
default:
return FALSE;
}
DC_UpdateXforms( dc );
return TRUE; return TRUE;
} }
...@@ -361,9 +339,9 @@ BOOL WINAPI NtGdiScaleWindowExtEx( HDC hdc, INT x_num, INT x_denom, ...@@ -361,9 +339,9 @@ BOOL WINAPI NtGdiScaleWindowExtEx( HDC hdc, INT x_num, INT x_denom,
/**************************************************************************** /****************************************************************************
* ModifyWorldTransform (GDI32.@) * NtGdiModifyWorldTransform (win32u.@)
*/ */
BOOL WINAPI ModifyWorldTransform( HDC hdc, const XFORM *xform, DWORD mode ) BOOL WINAPI NtGdiModifyWorldTransform( HDC hdc, const XFORM *xform, DWORD mode )
{ {
BOOL ret = FALSE; BOOL ret = FALSE;
DC *dc; DC *dc;
...@@ -371,9 +349,25 @@ BOOL WINAPI ModifyWorldTransform( HDC hdc, const XFORM *xform, DWORD mode ) ...@@ -371,9 +349,25 @@ BOOL WINAPI ModifyWorldTransform( HDC hdc, const XFORM *xform, DWORD mode )
if (!xform && mode != MWT_IDENTITY) return FALSE; if (!xform && mode != MWT_IDENTITY) return FALSE;
if ((dc = get_dc_ptr( hdc ))) if ((dc = get_dc_ptr( hdc )))
{ {
PHYSDEV physdev = GET_DC_PHYSDEV( dc, pModifyWorldTransform ); switch (mode)
if (dc->attr->graphics_mode == GM_ADVANCED) {
ret = physdev->funcs->pModifyWorldTransform( physdev, xform, mode ); case MWT_IDENTITY:
dc->xformWorld2Wnd.eM11 = 1.0f;
dc->xformWorld2Wnd.eM12 = 0.0f;
dc->xformWorld2Wnd.eM21 = 0.0f;
dc->xformWorld2Wnd.eM22 = 1.0f;
dc->xformWorld2Wnd.eDx = 0.0f;
dc->xformWorld2Wnd.eDy = 0.0f;
ret = TRUE;
break;
case MWT_LEFTMULTIPLY:
ret = CombineTransform( &dc->xformWorld2Wnd, xform, &dc->xformWorld2Wnd );
break;
case MWT_RIGHTMULTIPLY:
ret = CombineTransform( &dc->xformWorld2Wnd, &dc->xformWorld2Wnd, xform );
break;
}
if (ret) DC_UpdateXforms( dc );
release_dc_ptr( dc ); release_dc_ptr( dc );
} }
return ret; return ret;
......
...@@ -229,6 +229,7 @@ BOOL WINAPI NtGdiFontIsLinked( HDC hdc ); ...@@ -229,6 +229,7 @@ BOOL WINAPI NtGdiFontIsLinked( HDC hdc );
INT WINAPI NtGdiIntersectClipRect( HDC hdc, INT left, INT top, INT right, INT bottom ); INT WINAPI NtGdiIntersectClipRect( HDC hdc, INT left, INT top, INT right, INT bottom );
BOOL WINAPI NtGdiInvertRgn( HDC hdc, HRGN hrgn ); BOOL WINAPI NtGdiInvertRgn( HDC hdc, HRGN hrgn );
BOOL WINAPI NtGdiLineTo( HDC hdc, INT x, INT y ); BOOL WINAPI NtGdiLineTo( HDC hdc, INT x, INT y );
BOOL WINAPI NtGdiModifyWorldTransform( HDC hdc, const XFORM *xform, DWORD mode );
BOOL WINAPI NtGdiMoveTo( HDC hdc, INT x, INT y, POINT *pt ); BOOL WINAPI NtGdiMoveTo( HDC hdc, INT x, INT y, POINT *pt );
INT WINAPI NtGdiOffsetClipRgn( HDC hdc, INT x, INT y ); INT WINAPI NtGdiOffsetClipRgn( HDC hdc, INT x, INT y );
INT WINAPI NtGdiOffsetRgn( HRGN hrgn, INT x, INT y ); INT WINAPI NtGdiOffsetRgn( HRGN hrgn, INT x, INT y );
......
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