Rebase against 9c1fbe509576d7cbaada3af9736888cfa1d02847.

This commit is contained in:
Sebastian Lackner
2016-06-22 20:12:41 +02:00
parent 2f3baafeca
commit e27647e4d5
14 changed files with 788 additions and 1612 deletions

View File

@@ -1,18 +1,18 @@
From e9e959a5ad7964f0f7546d0306b46342f46be4bd Mon Sep 17 00:00:00 2001
From 49a870429b6f911dccca036e9622497074c6b6bb Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Sat, 20 Feb 2016 15:21:00 +0800
Subject: gdi32/tests: Add some additional tests for ExtExtOut on a path for an
EMF DC.
EMF DC. (v2)
---
dlls/gdi32/tests/metafile.c | 119 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 119 insertions(+)
dlls/gdi32/tests/metafile.c | 118 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 118 insertions(+)
diff --git a/dlls/gdi32/tests/metafile.c b/dlls/gdi32/tests/metafile.c
index f464720..9247ac7 100644
index bcd085c..baeaa63 100644
--- a/dlls/gdi32/tests/metafile.c
+++ b/dlls/gdi32/tests/metafile.c
@@ -1101,6 +1101,44 @@ static const unsigned char EMF_TEXTOUT_ON_PATH_BITS[] =
@@ -1122,6 +1122,44 @@ static const unsigned char EMF_TEXTOUT_ON_PATH_BITS[] =
0x14, 0x00, 0x00, 0x00
};
@@ -57,7 +57,7 @@ index f464720..9247ac7 100644
static const unsigned char MF_LINETO_BITS[] = {
0x01, 0x00, 0x09, 0x00, 0x00, 0x03, 0x11, 0x00,
0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
@@ -2224,6 +2262,8 @@ static void test_emf_ExtTextOut_on_path(void)
@@ -2384,6 +2422,8 @@ static void test_emf_ExtTextOut_on_path(void)
HDC hdcDisplay, hdcMetafile;
HENHMETAFILE hMetafile;
BOOL ret;
@@ -66,7 +66,7 @@ index f464720..9247ac7 100644
static const INT dx[4] = { 3, 5, 8, 12 };
/* Win9x doesn't play EMFs on invisible windows */
@@ -2234,6 +2274,20 @@ static void test_emf_ExtTextOut_on_path(void)
@@ -2394,6 +2434,20 @@ static void test_emf_ExtTextOut_on_path(void)
hdcDisplay = GetDC(hwnd);
ok(hdcDisplay != 0, "GetDC error %d\n", GetLastError());
@@ -87,18 +87,17 @@ index f464720..9247ac7 100644
hdcMetafile = CreateEnhMetaFileA(hdcDisplay, NULL, NULL, NULL);
ok(hdcMetafile != 0, "CreateEnhMetaFileA error %d\n", GetLastError());
@@ -2246,6 +2300,10 @@ static void test_emf_ExtTextOut_on_path(void)
@@ -2406,6 +2460,9 @@ static void test_emf_ExtTextOut_on_path(void)
ret = EndPath(hdcMetafile);
ok(ret, "EndPath error %d\n", GetLastError());
+ ret = GetPath(hdcMetafile, NULL, NULL, 0);
+todo_wine
+ ok(!ret, "expected 0, got %d\n", ret);
+
hMetafile = CloseEnhMetaFile(hdcMetafile);
ok(hMetafile != 0, "CloseEnhMetaFile error %d\n", GetLastError());
@@ -2261,6 +2319,67 @@ static void test_emf_ExtTextOut_on_path(void)
@@ -2421,6 +2478,67 @@ static void test_emf_ExtTextOut_on_path(void)
ret = DeleteEnhMetaFile(hMetafile);
ok(ret, "DeleteEnhMetaFile error %d\n", GetLastError());
@@ -138,13 +137,13 @@ index f464720..9247ac7 100644
+ ok(ret, "BeginPath error %d\n", GetLastError());
+
+ ret = ExtTextOutA(hdcMetafile, 11, 22, 0, NULL, "Test", 4, dx);
+todo_wine
+ ok(ret, "ExtTextOut error %d\n", GetLastError());
+
+ ret = EndPath(hdcMetafile);
+ ok(ret, "EndPath error %d\n", GetLastError());
+
+ ret = GetPath(hdcMetafile, NULL, NULL, 0);
+todo_wine
+ ok(!ret, "expected 0, got %d\n", ret);
+
+ hFont = SelectObject(hdcMetafile, hFont);
@@ -167,5 +166,5 @@ index f464720..9247ac7 100644
ok(ret, "ReleaseDC error %d\n", GetLastError());
DestroyWindow(hwnd);
--
2.7.0
2.8.0

View File

@@ -1,4 +1,4 @@
From 69c95a9f1db5c3e9d6958c0a994897bc5a51105d Mon Sep 17 00:00:00 2001
From 9d6023646b9d6ee4958d2de3a35d300f2f349ea2 Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Sat, 20 Feb 2016 15:28:36 +0800
Subject: gdi32: ExtTextOut on a path with bitmap font selected shouldn't fail.
@@ -6,14 +6,14 @@ Subject: gdi32: ExtTextOut on a path with bitmap font selected shouldn't fail.
This just leads to empty path generated.
---
dlls/gdi32/path.c | 2 +-
dlls/gdi32/tests/metafile.c | 1 -
2 files changed, 1 insertion(+), 2 deletions(-)
dlls/gdi32/tests/metafile.c | 4 +---
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/dlls/gdi32/path.c b/dlls/gdi32/path.c
index e09cd0b..8856d49 100644
index c6b87d4..9b8c9db 100644
--- a/dlls/gdi32/path.c
+++ b/dlls/gdi32/path.c
@@ -1525,7 +1525,7 @@ static BOOL pathdrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, const REC
@@ -1481,7 +1481,7 @@ static BOOL pathdrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, const REC
void *outline;
dwSize = GetGlyphOutlineW(dev->hdc, str[idx], ggo_flags, &gm, 0, NULL, &identity);
@@ -23,10 +23,10 @@ index e09cd0b..8856d49 100644
/* add outline only if char is printable */
if(dwSize)
diff --git a/dlls/gdi32/tests/metafile.c b/dlls/gdi32/tests/metafile.c
index 9247ac7..e247db9 100644
index baeaa63..9d01ba8 100644
--- a/dlls/gdi32/tests/metafile.c
+++ b/dlls/gdi32/tests/metafile.c
@@ -2279,7 +2279,6 @@ static void test_emf_ExtTextOut_on_path(void)
@@ -2439,7 +2439,6 @@ static void test_emf_ExtTextOut_on_path(void)
ok(ret, "BeginPath error %d\n", GetLastError());
ret = ExtTextOutA(hdcDisplay, 11, 22, 0, NULL, "Test", 4, dx);
@@ -34,6 +34,23 @@ index 9247ac7..e247db9 100644
ok(ret, "ExtTextOut error %d\n", GetLastError());
ret = EndPath(hdcDisplay);
@@ -2455,7 +2454,7 @@ todo_wine
ok(ret, "BeginPath error %d\n", GetLastError());
ret = ExtTextOutA(hdcMetafile, 11, 22, 0, NULL, "Test", 4, dx);
- todo_wine ok(ret, "ExtTextOut error %d\n", GetLastError());
+ ok(ret, "ExtTextOut error %d\n", GetLastError());
ret = EndPath(hdcMetafile);
ok(ret, "EndPath error %d\n", GetLastError());
@@ -2514,7 +2513,6 @@ todo_wine
ok(ret, "BeginPath error %d\n", GetLastError());
ret = ExtTextOutA(hdcMetafile, 11, 22, 0, NULL, "Test", 4, dx);
-todo_wine
ok(ret, "ExtTextOut error %d\n", GetLastError());
ret = EndPath(hdcMetafile);
--
2.7.0
2.8.0

View File

@@ -1,4 +1,4 @@
From a141c787d896d28487556ef6808e7124c0c1e618 Mon Sep 17 00:00:00 2001
From 74903a2f465f98862457553f9d921db857a824ae Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Wed, 24 Feb 2016 11:58:41 +0800
Subject: gdi32/tests: Explicitly test BeginPath() return value in the metafile
@@ -9,10 +9,10 @@ Subject: gdi32/tests: Explicitly test BeginPath() return value in the metafile
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/dlls/gdi32/tests/metafile.c b/dlls/gdi32/tests/metafile.c
index ce524f7..fd9893a 100644
index 9d01ba8..7781013 100644
--- a/dlls/gdi32/tests/metafile.c
+++ b/dlls/gdi32/tests/metafile.c
@@ -2805,7 +2805,8 @@ static void test_mf_GetPath(void)
@@ -2950,7 +2950,8 @@ static void test_mf_GetPath(void)
hdc = CreateMetaFileA(NULL);
ok(hdc != 0, "CreateMetaFileA error %d\n", GetLastError());
@@ -22,7 +22,7 @@ index ce524f7..fd9893a 100644
ret = MoveToEx(hdc, 50, 50, NULL);
ok( ret, "MoveToEx error %d.\n", GetLastError());
ret = LineTo(hdc, 50, 150);
@@ -3581,7 +3582,8 @@ static void test_emf_GetPath(void)
@@ -3839,7 +3840,8 @@ static void test_emf_paths(void)
hdcMetafile = CreateEnhMetaFileA(GetDC(0), NULL, NULL, NULL);
ok(hdcMetafile != 0, "CreateEnhMetaFileA error %d\n", GetLastError());
@@ -33,5 +33,5 @@ index ce524f7..fd9893a 100644
ok( ret, "MoveToEx error %d.\n", GetLastError());
ret = LineTo(hdcMetafile, 50, 150);
--
2.7.1
2.8.0

View File

@@ -1,392 +0,0 @@
From aad8c5691d2fd196c3f6f7f84d56e002f1a6ce0e Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Tue, 21 Jun 2016 11:39:41 +0800
Subject: gdi32: Add support for paths on a metafile HDC. (v5)
---
dlls/gdi32/enhmfdrv/dc.c | 4 +-
dlls/gdi32/path.c | 170 +++++++++++++++++++++++++++++++++++++++++---
dlls/gdi32/tests/metafile.c | 2 -
3 files changed, 164 insertions(+), 12 deletions(-)
diff --git a/dlls/gdi32/enhmfdrv/dc.c b/dlls/gdi32/enhmfdrv/dc.c
index 8525067..7a31224 100644
--- a/dlls/gdi32/enhmfdrv/dc.c
+++ b/dlls/gdi32/enhmfdrv/dc.c
@@ -420,6 +420,7 @@ BOOL EMFDRV_AbortPath( PHYSDEV dev )
BOOL EMFDRV_BeginPath( PHYSDEV dev )
{
+ PHYSDEV next = GET_NEXT_PHYSDEV( dev, pBeginPath );
EMFDRV_PDEVICE *physDev = (EMFDRV_PDEVICE*) dev;
EMRBEGINPATH emr;
@@ -428,7 +429,8 @@ BOOL EMFDRV_BeginPath( PHYSDEV dev )
emr.emr.iType = EMR_BEGINPATH;
emr.emr.nSize = sizeof(emr);
- return EMFDRV_WriteRecord( dev, &emr.emr );
+ if (!EMFDRV_WriteRecord( dev, &emr.emr )) return FALSE;
+ return next->funcs->pBeginPath( next );
}
BOOL EMFDRV_CloseFigure( PHYSDEV dev )
diff --git a/dlls/gdi32/path.c b/dlls/gdi32/path.c
index f3dc79b..65d79db 100644
--- a/dlls/gdi32/path.c
+++ b/dlls/gdi32/path.c
@@ -752,13 +752,21 @@ static BOOL pathdrv_AbortPath( PHYSDEV dev )
{
struct path_physdev *physdev = get_path_physdev( dev );
DC *dc = get_dc_ptr( dev->hdc );
+ BOOL ret = TRUE;
if (!dc) return FALSE;
+
+ if (GdiIsMetaFileDC(dev->hdc))
+ {
+ PHYSDEV next = GET_NEXT_PHYSDEV( dev, pAbortPath );
+ ret = next->funcs->pAbortPath( next );
+ }
+
free_gdi_path( physdev->path );
pop_dc_driver( dc, &path_driver );
HeapFree( GetProcessHeap(), 0, physdev );
release_dc_ptr( dc );
- return TRUE;
+ return ret;
}
@@ -769,13 +777,21 @@ static BOOL pathdrv_EndPath( PHYSDEV dev )
{
struct path_physdev *physdev = get_path_physdev( dev );
DC *dc = get_dc_ptr( dev->hdc );
+ BOOL ret = TRUE;
if (!dc) return FALSE;
+
+ if (GdiIsMetaFileDC(dev->hdc))
+ {
+ PHYSDEV next = GET_NEXT_PHYSDEV( dev, pEndPath );
+ ret = next->funcs->pEndPath( next );
+ }
+
dc->path = physdev->path;
pop_dc_driver( dc, &path_driver );
HeapFree( GetProcessHeap(), 0, physdev );
release_dc_ptr( dc );
- return TRUE;
+ return ret;
}
@@ -858,6 +874,13 @@ BOOL PATH_RestorePath( DC *dst, DC *src )
static BOOL pathdrv_MoveTo( PHYSDEV dev, INT x, INT y )
{
struct path_physdev *physdev = get_path_physdev( dev );
+
+ if (GdiIsMetaFileDC(dev->hdc))
+ {
+ PHYSDEV next = GET_NEXT_PHYSDEV( dev, pMoveTo );
+ if (!next->funcs->pMoveTo( next, x, y )) return FALSE;
+ }
+
physdev->path->newStroke = TRUE;
physdev->path->pos.x = x;
physdev->path->pos.y = y;
@@ -874,6 +897,12 @@ static BOOL pathdrv_LineTo( PHYSDEV dev, INT x, INT y )
struct path_physdev *physdev = get_path_physdev( dev );
POINT point;
+ if (GdiIsMetaFileDC(dev->hdc))
+ {
+ PHYSDEV next = GET_NEXT_PHYSDEV( dev, pLineTo );
+ if (!next->funcs->pLineTo( next, x, y )) return FALSE;
+ }
+
point.x = x;
point.y = y;
return add_log_points_new_stroke( physdev, &point, 1, PT_LINETO );
@@ -893,6 +922,13 @@ static BOOL pathdrv_RoundRect( PHYSDEV dev, INT x1, INT y1, INT x2, INT y2, INT
POINT corners[2], pointTemp;
FLOAT_POINT ellCorners[2];
+ if (GdiIsMetaFileDC(dev->hdc))
+ {
+ PHYSDEV next = GET_NEXT_PHYSDEV( dev, pRoundRect );
+ if (!next->funcs->pRoundRect( next, x1, y1, x2, y2, ell_width, ell_height ))
+ return FALSE;
+ }
+
PATH_CheckCorners(dev->hdc,corners,x1,y1,x2,y2);
/* Add points to the roundrect path */
@@ -942,6 +978,12 @@ static BOOL pathdrv_Rectangle( PHYSDEV dev, INT x1, INT y1, INT x2, INT y2 )
POINT corners[2], points[4];
BYTE *type;
+ if (GdiIsMetaFileDC(dev->hdc))
+ {
+ PHYSDEV next = GET_NEXT_PHYSDEV( dev, pRectangle );
+ if (!next->funcs->pRectangle( next, x1, y1, x2, y2 )) return FALSE;
+ }
+
PATH_CheckCorners(dev->hdc,corners,x1,y1,x2,y2);
points[0].x = corners[1].x;
@@ -1111,10 +1153,19 @@ static BOOL PATH_Arc( PHYSDEV dev, INT x1, INT y1, INT x2, INT y2,
*/
static BOOL pathdrv_AngleArc( PHYSDEV dev, INT x, INT y, DWORD radius, FLOAT eStartAngle, FLOAT eSweepAngle)
{
- int x1 = GDI_ROUND( x + cos(eStartAngle*M_PI/180) * radius );
- int y1 = GDI_ROUND( y - sin(eStartAngle*M_PI/180) * radius );
- int x2 = GDI_ROUND( x + cos((eStartAngle+eSweepAngle)*M_PI/180) * radius );
- int y2 = GDI_ROUND( y - sin((eStartAngle+eSweepAngle)*M_PI/180) * radius );
+ int x1, x2, y1, y2;
+
+ if (GdiIsMetaFileDC(dev->hdc))
+ {
+ PHYSDEV next = GET_NEXT_PHYSDEV( dev, pAngleArc );
+ if (!next->funcs->pAngleArc( next, x, y, radius, eStartAngle, eSweepAngle ))
+ return FALSE;
+ }
+
+ x1 = GDI_ROUND( x + cos(eStartAngle*M_PI/180) * radius );
+ y1 = GDI_ROUND( y - sin(eStartAngle*M_PI/180) * radius );
+ x2 = GDI_ROUND( x + cos((eStartAngle+eSweepAngle)*M_PI/180) * radius );
+ y2 = GDI_ROUND( y - sin((eStartAngle+eSweepAngle)*M_PI/180) * radius );
return PATH_Arc( dev, x-radius, y-radius, x+radius, y+radius, x1, y1, x2, y2,
eSweepAngle >= 0 ? AD_COUNTERCLOCKWISE : AD_CLOCKWISE, -1 );
}
@@ -1126,6 +1177,13 @@ static BOOL pathdrv_AngleArc( PHYSDEV dev, INT x, INT y, DWORD radius, FLOAT eSt
static BOOL pathdrv_Arc( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
INT xstart, INT ystart, INT xend, INT yend )
{
+ if (GdiIsMetaFileDC(dev->hdc))
+ {
+ PHYSDEV next = GET_NEXT_PHYSDEV( dev, pArc );
+ if (!next->funcs->pArc( next, left, top, right, bottom, xstart, ystart, xend, yend ))
+ return FALSE;
+ }
+
return PATH_Arc( dev, left, top, right, bottom, xstart, ystart, xend, yend,
GetArcDirection( dev->hdc ), 0 );
}
@@ -1137,6 +1195,13 @@ static BOOL pathdrv_Arc( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
static BOOL pathdrv_ArcTo( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
INT xstart, INT ystart, INT xend, INT yend )
{
+ if (GdiIsMetaFileDC(dev->hdc))
+ {
+ PHYSDEV next = GET_NEXT_PHYSDEV( dev, pArcTo );
+ if (!next->funcs->pArcTo( next, left, top, right, bottom, xstart, ystart, xend, yend ))
+ return FALSE;
+ }
+
return PATH_Arc( dev, left, top, right, bottom, xstart, ystart, xend, yend,
GetArcDirection( dev->hdc ), -1 );
}
@@ -1148,6 +1213,13 @@ static BOOL pathdrv_ArcTo( PHYSDEV dev, INT left, INT top, INT right, INT bottom
static BOOL pathdrv_Chord( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
INT xstart, INT ystart, INT xend, INT yend )
{
+ if (GdiIsMetaFileDC(dev->hdc))
+ {
+ PHYSDEV next = GET_NEXT_PHYSDEV( dev, pChord );
+ if (!next->funcs->pChord( next, left, top, right, bottom, xstart, ystart, xend, yend ))
+ return FALSE;
+ }
+
return PATH_Arc( dev, left, top, right, bottom, xstart, ystart, xend, yend,
GetArcDirection( dev->hdc ), 1 );
}
@@ -1159,6 +1231,13 @@ static BOOL pathdrv_Chord( PHYSDEV dev, INT left, INT top, INT right, INT bottom
static BOOL pathdrv_Pie( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
INT xstart, INT ystart, INT xend, INT yend )
{
+ if (GdiIsMetaFileDC(dev->hdc))
+ {
+ PHYSDEV next = GET_NEXT_PHYSDEV( dev, pPie );
+ if (!next->funcs->pPie( next, left, top, right, bottom, xstart, ystart, xend, yend ))
+ return FALSE;
+ }
+
return PATH_Arc( dev, left, top, right, bottom, xstart, ystart, xend, yend,
GetArcDirection( dev->hdc ), 2 );
}
@@ -1169,6 +1248,13 @@ static BOOL pathdrv_Pie( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
*/
static BOOL pathdrv_Ellipse( PHYSDEV dev, INT x1, INT y1, INT x2, INT y2 )
{
+ if (GdiIsMetaFileDC(dev->hdc))
+ {
+ PHYSDEV next = GET_NEXT_PHYSDEV( dev, pEllipse );
+ if (!next->funcs->pEllipse( next, x1, y1, x2, y2 ))
+ return FALSE;
+ }
+
return PATH_Arc( dev, x1, y1, x2, y2, x1, (y1+y2)/2, x1, (y1+y2)/2, GetArcDirection( dev->hdc ), 1 );
}
@@ -1180,6 +1266,13 @@ static BOOL pathdrv_PolyBezierTo( PHYSDEV dev, const POINT *pts, DWORD cbPoints
{
struct path_physdev *physdev = get_path_physdev( dev );
+ if (GdiIsMetaFileDC(dev->hdc))
+ {
+ PHYSDEV next = GET_NEXT_PHYSDEV( dev, pPolyBezierTo );
+ if (!next->funcs->pPolyBezierTo( next, pts, cbPoints ))
+ return FALSE;
+ }
+
return add_log_points_new_stroke( physdev, pts, cbPoints, PT_BEZIERTO );
}
@@ -1190,8 +1283,16 @@ static BOOL pathdrv_PolyBezierTo( PHYSDEV dev, const POINT *pts, DWORD cbPoints
static BOOL pathdrv_PolyBezier( PHYSDEV dev, const POINT *pts, DWORD cbPoints )
{
struct path_physdev *physdev = get_path_physdev( dev );
- BYTE *type = add_log_points( physdev, pts, cbPoints, PT_BEZIERTO );
+ BYTE *type;
+ if (GdiIsMetaFileDC(dev->hdc))
+ {
+ PHYSDEV next = GET_NEXT_PHYSDEV( dev, pPolyBezier );
+ if (!next->funcs->pPolyBezier( next, pts, cbPoints ))
+ return FALSE;
+ }
+
+ type = add_log_points( physdev, pts, cbPoints, PT_BEZIERTO );
if (!type) return FALSE;
type[0] = PT_MOVETO;
return TRUE;
@@ -1208,6 +1309,13 @@ static BOOL pathdrv_PolyDraw( PHYSDEV dev, const POINT *pts, const BYTE *types,
POINT orig_pos;
INT i, lastmove = 0;
+ if (GdiIsMetaFileDC(dev->hdc))
+ {
+ PHYSDEV next = GET_NEXT_PHYSDEV( dev, pPolyDraw );
+ if (!next->funcs->pPolyDraw( next, pts, types, cbPoints ))
+ return FALSE;
+ }
+
for (i = 0; i < path->count; i++) if (path->flags[i] == PT_MOVETO) lastmove = i;
orig_pos = path->pos;
@@ -1260,8 +1368,16 @@ static BOOL pathdrv_PolyDraw( PHYSDEV dev, const POINT *pts, const BYTE *types,
static BOOL pathdrv_Polyline( PHYSDEV dev, const POINT *pts, INT cbPoints )
{
struct path_physdev *physdev = get_path_physdev( dev );
- BYTE *type = add_log_points( physdev, pts, cbPoints, PT_LINETO );
+ BYTE *type;
+ if (GdiIsMetaFileDC(dev->hdc))
+ {
+ PHYSDEV next = GET_NEXT_PHYSDEV( dev, pPolyline );
+ if (!next->funcs->pPolyline( next, pts, cbPoints ))
+ return FALSE;
+ }
+
+ type = add_log_points( physdev, pts, cbPoints, PT_LINETO );
if (!type) return FALSE;
if (cbPoints) type[0] = PT_MOVETO;
return TRUE;
@@ -1275,6 +1391,13 @@ static BOOL pathdrv_PolylineTo( PHYSDEV dev, const POINT *pts, INT cbPoints )
{
struct path_physdev *physdev = get_path_physdev( dev );
+ if (GdiIsMetaFileDC(dev->hdc))
+ {
+ PHYSDEV next = GET_NEXT_PHYSDEV( dev, pPolylineTo );
+ if (!next->funcs->pPolylineTo( next, pts, cbPoints ))
+ return FALSE;
+ }
+
return add_log_points_new_stroke( physdev, pts, cbPoints, PT_LINETO );
}
@@ -1285,8 +1408,16 @@ static BOOL pathdrv_PolylineTo( PHYSDEV dev, const POINT *pts, INT cbPoints )
static BOOL pathdrv_Polygon( PHYSDEV dev, const POINT *pts, INT cbPoints )
{
struct path_physdev *physdev = get_path_physdev( dev );
- BYTE *type = add_log_points( physdev, pts, cbPoints, PT_LINETO );
+ BYTE *type;
+ if (GdiIsMetaFileDC(dev->hdc))
+ {
+ PHYSDEV next = GET_NEXT_PHYSDEV( dev, pPolygon );
+ if (!next->funcs->pPolygon( next, pts, cbPoints ))
+ return FALSE;
+ }
+
+ type = add_log_points( physdev, pts, cbPoints, PT_LINETO );
if (!type) return FALSE;
if (cbPoints) type[0] = PT_MOVETO;
if (cbPoints > 1) type[cbPoints - 1] = PT_LINETO | PT_CLOSEFIGURE;
@@ -1303,6 +1434,13 @@ static BOOL pathdrv_PolyPolygon( PHYSDEV dev, const POINT* pts, const INT* count
UINT poly;
BYTE *type;
+ if (GdiIsMetaFileDC(dev->hdc))
+ {
+ PHYSDEV next = GET_NEXT_PHYSDEV( dev, pPolyPolygon );
+ if (!next->funcs->pPolyPolygon( next, pts, counts, polygons ))
+ return FALSE;
+ }
+
for(poly = 0; poly < polygons; poly++) {
type = add_log_points( physdev, pts, counts[poly], PT_LINETO );
if (!type) return FALSE;
@@ -1324,6 +1462,13 @@ static BOOL pathdrv_PolyPolyline( PHYSDEV dev, const POINT* pts, const DWORD* co
UINT poly, count;
BYTE *type;
+ if (GdiIsMetaFileDC(dev->hdc))
+ {
+ PHYSDEV next = GET_NEXT_PHYSDEV( dev, pPolyPolyline );
+ if (!next->funcs->pPolyPolyline( next, pts, counts, polylines ))
+ return FALSE;
+ }
+
for (poly = count = 0; poly < polylines; poly++) count += counts[poly];
type = add_log_points( physdev, pts, count, PT_LINETO );
@@ -1472,6 +1617,13 @@ static BOOL pathdrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, const REC
unsigned int idx, ggo_flags = GGO_NATIVE;
POINT offset = {0, 0};
+ if (GdiIsMetaFileDC(dev->hdc))
+ {
+ PHYSDEV next = GET_NEXT_PHYSDEV( dev, pExtTextOut );
+ if (!next->funcs->pExtTextOut( next, x, y, flags, lprc, str, count, dx ))
+ return FALSE;
+ }
+
if (!count) return TRUE;
if (flags & ETO_GLYPH_INDEX) ggo_flags |= GGO_GLYPH_INDEX;
diff --git a/dlls/gdi32/tests/metafile.c b/dlls/gdi32/tests/metafile.c
index 4bd4778..d3848b0 100644
--- a/dlls/gdi32/tests/metafile.c
+++ b/dlls/gdi32/tests/metafile.c
@@ -2460,7 +2460,6 @@ static void test_emf_ExtTextOut_on_path(void)
ok(ret, "EndPath error %d\n", GetLastError());
ret = GetPath(hdcMetafile, NULL, NULL, 0);
-todo_wine
ok(!ret, "expected 0, got %d\n", ret);
hMetafile = CloseEnhMetaFile(hdcMetafile);
@@ -2520,7 +2519,6 @@ todo_wine
ok(ret, "EndPath error %d\n", GetLastError());
ret = GetPath(hdcMetafile, NULL, NULL, 0);
-todo_wine
ok(!ret, "expected 0, got %d\n", ret);
hFont = SelectObject(hdcMetafile, hFont);
--
2.8.0

View File

@@ -1 +0,0 @@
Fixes: [39185] Add support for paths on a metafile HDC