Module: wine Branch: master Commit: 88b9ae1ec2d1930b8453f6d7f74f654228bdf353 URL: http://source.winehq.org/git/wine.git/?a=commit;h=88b9ae1ec2d1930b8453f6d7f7...
Author: Dmitry Timoshkov dmitry@baikal.ru Date: Thu Feb 14 13:38:31 2013 +0800
gdi32: ExcludeClipRect should update actual clipping region for a EMF DC.
---
dlls/gdi32/enhmfdrv/dc.c | 6 +++++- dlls/gdi32/tests/metafile.c | 4 +--- 2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/dlls/gdi32/enhmfdrv/dc.c b/dlls/gdi32/enhmfdrv/dc.c index 8a06ad4..3af7ef4 100644 --- a/dlls/gdi32/enhmfdrv/dc.c +++ b/dlls/gdi32/enhmfdrv/dc.c @@ -157,14 +157,18 @@ INT EMFDRV_SetArcDirection(PHYSDEV dev, INT arcDirection)
INT EMFDRV_ExcludeClipRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom ) { + PHYSDEV next = GET_NEXT_PHYSDEV( dev, pExcludeClipRect ); EMREXCLUDECLIPRECT emr; + BOOL ret; + emr.emr.iType = EMR_EXCLUDECLIPRECT; emr.emr.nSize = sizeof(emr); emr.rclClip.left = left; emr.rclClip.top = top; emr.rclClip.right = right; emr.rclClip.bottom = bottom; - return EMFDRV_WriteRecord( dev, &emr.emr ); + ret = EMFDRV_WriteRecord( dev, &emr.emr ); + return ret ? next->funcs->pExcludeClipRect( next, left, top, right, bottom ) : ERROR; }
INT EMFDRV_IntersectClipRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom) diff --git a/dlls/gdi32/tests/metafile.c b/dlls/gdi32/tests/metafile.c index 86fa373..53ec7ac 100644 --- a/dlls/gdi32/tests/metafile.c +++ b/dlls/gdi32/tests/metafile.c @@ -2530,7 +2530,6 @@ static void test_emf_clipping(void)
SetRect(&rc_sclip, 0, 0, 100, 50); ret = ExcludeClipRect(hdc, 0, 50, 100, 100); -todo_wine ok(ret == SIMPLEREGION || broken(ret == COMPLEXREGION) /* XP */, "got %d\n", ret); if (ret == COMPLEXREGION) { @@ -2543,10 +2542,9 @@ todo_wine SetRect(&rc_res, -1, -1, -1, -1); ret = GetClipBox(hdc, &rc_res); ok(ret == SIMPLEREGION, "got %d\n", ret); -todo_wine ok(EqualRect(&rc_res, &rc_sclip), "expected (%d,%d)-(%d,%d), got (%d,%d)-(%d,%d)\n", - rc.left, rc.top, rc.right, rc.bottom, + rc_sclip.left, rc_sclip.top, rc_sclip.right, rc_sclip.bottom, rc_res.left, rc_res.top, rc_res.right, rc_res.bottom);
hemf = CloseEnhMetaFile(hdc);