gdi32: Move common SetLayout() code to nulldrv_SetLayout().

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zhiyi Zhang 2021-04-20 09:09:21 +01:00 committed by Alexandre Julliard
parent aadf11fb4f
commit 1543be811d
3 changed files with 16 additions and 13 deletions

View File

@ -1922,17 +1922,7 @@ DWORD WINAPI SetLayout(HDC hdc, DWORD layout)
if (dc)
{
PHYSDEV physdev = GET_DC_PHYSDEV( dc, pSetLayout );
layout = physdev->funcs->pSetLayout( physdev, layout );
if (layout != GDI_ERROR)
{
oldlayout = dc->layout;
dc->layout = layout;
if (layout != oldlayout)
{
if (layout & LAYOUT_RTL) dc->MapMode = MM_ANISOTROPIC;
DC_UpdateXforms( dc );
}
}
oldlayout = physdev->funcs->pSetLayout( physdev, layout );
release_dc_ptr( dc );
}

View File

@ -795,7 +795,18 @@ static void CDECL nulldrv_SetDeviceClipping( PHYSDEV dev, HRGN rgn )
static DWORD CDECL nulldrv_SetLayout( PHYSDEV dev, DWORD layout )
{
return layout;
DC *dc = get_nulldrv_dc( dev );
DWORD old_layout;
old_layout = dc->layout;
dc->layout = layout;
if (layout != old_layout)
{
if (layout & LAYOUT_RTL) dc->MapMode = MM_ANISOTROPIC;
DC_UpdateXforms( dc );
}
return old_layout;
}
static BOOL CDECL nulldrv_SetDeviceGammaRamp( PHYSDEV dev, void *ramp )

View File

@ -334,12 +334,14 @@ BOOL CDECL EMFDRV_ScaleWindowExtEx( PHYSDEV dev, INT xNum, INT xDenom, INT yNum,
DWORD CDECL EMFDRV_SetLayout( PHYSDEV dev, DWORD layout )
{
PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSetMapMode );
EMRSETLAYOUT emr;
emr.emr.iType = EMR_SETLAYOUT;
emr.emr.nSize = sizeof(emr);
emr.iMode = layout;
return EMFDRV_WriteRecord( dev, &emr.emr ) ? layout : GDI_ERROR;
if (!EMFDRV_WriteRecord( dev, &emr.emr )) return GDI_ERROR;
return next->funcs->pSetLayout( next, layout );
}
BOOL CDECL EMFDRV_SetWorldTransform( PHYSDEV dev, const XFORM *xform)