Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- dlls/gdi32/dc.c | 12 +----------- dlls/gdi32/driver.c | 13 ++++++++++++- dlls/gdi32/enhmfdrv/dc.c | 4 +++- 3 files changed, 16 insertions(+), 13 deletions(-)
diff --git a/dlls/gdi32/dc.c b/dlls/gdi32/dc.c index 830fabf6e78..eb9dbf85668 100644 --- a/dlls/gdi32/dc.c +++ b/dlls/gdi32/dc.c @@ -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 ); }
diff --git a/dlls/gdi32/driver.c b/dlls/gdi32/driver.c index 09b051cd6fa..a2ebd018bca 100644 --- a/dlls/gdi32/driver.c +++ b/dlls/gdi32/driver.c @@ -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 ) diff --git a/dlls/gdi32/enhmfdrv/dc.c b/dlls/gdi32/enhmfdrv/dc.c index 2a749418829..72b6afeee8b 100644 --- a/dlls/gdi32/enhmfdrv/dc.c +++ b/dlls/gdi32/enhmfdrv/dc.c @@ -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)
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=88935
Your paranoid android.
=== debiant2 (32 bit report) ===
gdi32: metafile.c:1586: Test failed: mf_SetLayout: mfsize=24, bsize=34.
=== debiant2 (32 bit Chinese:China report) ===
gdi32: metafile.c:1586: Test failed: mf_SetLayout: mfsize=24, bsize=34.
=== debiant2 (32 bit WoW report) ===
gdi32: metafile.c:1586: Test failed: mf_SetLayout: mfsize=24, bsize=34.
=== debiant2 (64 bit WoW report) ===
gdi32: metafile.c:1586: Test failed: mf_SetLayout: mfsize=24, bsize=34.