From: Piotr Caban piotr@codeweavers.com
--- dlls/wineps.drv/graphics.c | 61 ++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 35 deletions(-)
diff --git a/dlls/wineps.drv/graphics.c b/dlls/wineps.drv/graphics.c index 45f20728183..3ea663ccb2d 100644 --- a/dlls/wineps.drv/graphics.c +++ b/dlls/wineps.drv/graphics.c @@ -375,58 +375,49 @@ BOOL CDECL PSDRV_PolyPolygon( PHYSDEV dev, const POINT* pts, const INT* counts, return TRUE; }
- -/*********************************************************************** - * PSDRV_PolyBezier - */ -BOOL CDECL PSDRV_PolyBezier( PHYSDEV dev, const POINT *pts, DWORD count ) +static BOOL poly_bezier( PHYSDEV dev, const POINT *pt0, const POINT *pts, DWORD count) { + POINT dev_pts[3]; DWORD i; - POINT *dev_pts;
- TRACE("\n"); + TRACE( "\n" );
- if (!(dev_pts = HeapAlloc( GetProcessHeap(), 0, count * sizeof(*dev_pts) ))) return FALSE; - memcpy( dev_pts, pts, count * sizeof(*dev_pts) ); - LPtoDP( dev->hdc, dev_pts, count ); + dev_pts[0] = *pt0; + LPtoDP( dev->hdc, dev_pts, 1 );
- PSDRV_WriteSpool(dev, "%PolyBezier\n",12); - PSDRV_SetPen(dev); - PSDRV_SetClip(dev); - PSDRV_WriteMoveTo(dev, dev_pts[0].x, dev_pts[0].y ); - for (i = 1; i < count; i += 3) PSDRV_WriteCurveTo( dev, dev_pts + i ); + PSDRV_WriteSpool( dev, "%PolyBezier\n", 12 ); + PSDRV_SetPen( dev ); + PSDRV_SetClip( dev ); + PSDRV_WriteMoveTo( dev, dev_pts[0].x, dev_pts[0].y ); + for (i = 0; i < count; i += 3) + { + memcpy( dev_pts, pts, sizeof(dev_pts) ); + LPtoDP( dev->hdc, dev_pts, 3 ); + PSDRV_WriteCurveTo( dev, dev_pts ); + } PSDRV_DrawLine(dev); PSDRV_ResetClip(dev); - HeapFree( GetProcessHeap(), 0, dev_pts ); return TRUE; }
+/*********************************************************************** + * PSDRV_PolyBezier + */ +BOOL CDECL PSDRV_PolyBezier( PHYSDEV dev, const POINT *pts, DWORD count ) +{ + return poly_bezier( dev, pts, pts + 1, count - 1 ); +} +
/*********************************************************************** * PSDRV_PolyBezierTo */ BOOL CDECL PSDRV_PolyBezierTo( PHYSDEV dev, const POINT *pts, DWORD count ) { - DWORD i; - POINT *dev_pts; - - TRACE("\n"); + POINT pt0;
- count++; /* add initial position */ - if (!(dev_pts = HeapAlloc( GetProcessHeap(), 0, count * sizeof(*dev_pts) ))) return FALSE; - GetCurrentPositionEx( dev->hdc, dev_pts ); - memcpy( dev_pts + 1, pts, (count - 1) * sizeof(*dev_pts) ); - LPtoDP( dev->hdc, dev_pts, count ); - - PSDRV_WriteSpool(dev, "%PolyBezier\n",12); - PSDRV_SetPen(dev); - PSDRV_SetClip(dev); - PSDRV_WriteMoveTo(dev, dev_pts[0].x, dev_pts[0].y ); - for (i = 1; i < count; i += 3) PSDRV_WriteCurveTo( dev, dev_pts + i ); - PSDRV_DrawLine(dev); - PSDRV_ResetClip(dev); - HeapFree( GetProcessHeap(), 0, dev_pts ); - return TRUE; + GetCurrentPositionEx( dev->hdc, &pt0 ); + return poly_bezier( dev, &pt0, pts, count ); }
From: Piotr Caban piotr@codeweavers.com
--- dlls/wineps.drv/printproc.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/dlls/wineps.drv/printproc.c b/dlls/wineps.drv/printproc.c index 31312610c50..9663b3b3730 100644 --- a/dlls/wineps.drv/printproc.c +++ b/dlls/wineps.drv/printproc.c @@ -151,6 +151,13 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable,
return PSDRV_PolyBezier(&data->pdev->dev, (const POINT *)p->aptl, p->cptl); } + case EMR_POLYGON: + { + const EMRPOLYGON *p = (const EMRPOLYGON *)rec; + + return PSDRV_PolyPolygon(&data->pdev->dev, (const POINT *)p->aptl, + (const INT *)&p->cptl, 1); + } case EMR_POLYPOLYLINE: { const EMRPOLYPOLYLINE *p = (const EMRPOLYPOLYLINE *)rec;
From: Piotr Caban piotr@codeweavers.com
--- dlls/wineps.drv/printproc.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/dlls/wineps.drv/printproc.c b/dlls/wineps.drv/printproc.c index 9663b3b3730..98f820e6811 100644 --- a/dlls/wineps.drv/printproc.c +++ b/dlls/wineps.drv/printproc.c @@ -158,6 +158,13 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, return PSDRV_PolyPolygon(&data->pdev->dev, (const POINT *)p->aptl, (const INT *)&p->cptl, 1); } + case EMR_POLYLINE: + { + const EMRPOLYLINE *p = (const EMRPOLYLINE *)rec; + + return PSDRV_PolyPolyline(&data->pdev->dev, + (const POINT *)p->aptl, &p->cptl, 1); + } case EMR_POLYPOLYLINE: { const EMRPOLYPOLYLINE *p = (const EMRPOLYPOLYLINE *)rec;
From: Piotr Caban piotr@codeweavers.com
--- dlls/wineps.drv/printproc.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/dlls/wineps.drv/printproc.c b/dlls/wineps.drv/printproc.c index 98f820e6811..67099365032 100644 --- a/dlls/wineps.drv/printproc.c +++ b/dlls/wineps.drv/printproc.c @@ -165,6 +165,13 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, return PSDRV_PolyPolyline(&data->pdev->dev, (const POINT *)p->aptl, &p->cptl, 1); } + case EMR_POLYBEZIERTO: + { + const EMRPOLYBEZIERTO *p = (const EMRPOLYBEZIERTO *)rec; + + return PSDRV_PolyBezierTo(&data->pdev->dev, (const POINT *)p->aptl, p->cptl) && + MoveToEx(data->pdev->dev.hdc, p->aptl[p->cptl - 1].x, p->aptl[p->cptl - 1].y, NULL); + } case EMR_POLYPOLYLINE: { const EMRPOLYPOLYLINE *p = (const EMRPOLYPOLYLINE *)rec;
From: Piotr Caban piotr@codeweavers.com
--- dlls/wineps.drv/printproc.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
diff --git a/dlls/wineps.drv/printproc.c b/dlls/wineps.drv/printproc.c index 67099365032..2b7ffaa5e4c 100644 --- a/dlls/wineps.drv/printproc.c +++ b/dlls/wineps.drv/printproc.c @@ -172,6 +172,24 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, return PSDRV_PolyBezierTo(&data->pdev->dev, (const POINT *)p->aptl, p->cptl) && MoveToEx(data->pdev->dev.hdc, p->aptl[p->cptl - 1].x, p->aptl[p->cptl - 1].y, NULL); } + case EMR_POLYLINETO: + { + const EMRPOLYLINETO *p = (const EMRPOLYLINETO *)rec; + POINT *pts; + DWORD cnt; + int ret; + + cnt = p->cptl + 1; + pts = malloc(sizeof(*pts) * cnt); + if (!pts) return 0; + + GetCurrentPositionEx(data->pdev->dev.hdc, pts); + memcpy(pts + 1, p->aptl, sizeof(*pts) * p->cptl); + ret = PSDRV_PolyPolyline(&data->pdev->dev, pts, &cnt, 1) && + MoveToEx(data->pdev->dev.hdc, pts[cnt - 1].x, pts[cnt - 1].y, NULL); + free(pts); + return ret; + } case EMR_POLYPOLYLINE: { const EMRPOLYPOLYLINE *p = (const EMRPOLYPOLYLINE *)rec;
From: Piotr Caban piotr@codeweavers.com
--- dlls/wineps.drv/printproc.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+)
diff --git a/dlls/wineps.drv/printproc.c b/dlls/wineps.drv/printproc.c index 2b7ffaa5e4c..4c13801b580 100644 --- a/dlls/wineps.drv/printproc.c +++ b/dlls/wineps.drv/printproc.c @@ -295,6 +295,35 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, return PSDRV_LineTo(&data->pdev->dev, line->ptl.x, line->ptl.y) && MoveToEx(data->pdev->dev.hdc, line->ptl.x, line->ptl.y, NULL); } + case EMR_ARCTO: + { + const EMRARCTO *p = (const EMRARCTO *)rec; + POINT pt; + BOOL ret; + + ret = GetCurrentPositionEx(data->pdev->dev.hdc, &pt); + if (ret) + { + ret = ArcTo(data->pdev->dev.hdc, p->rclBox.left, p->rclBox.top, + p->rclBox.right, p->rclBox.bottom, p->ptlStart.x, + p->ptlStart.y, p->ptlStart.x, p->ptlStart.y); + } + if (ret) + ret = PSDRV_LineTo(&data->pdev->dev, pt.x, pt.y); + if (ret) + { + ret = PSDRV_Arc(&data->pdev->dev, p->rclBox.left, p->rclBox.top, + p->rclBox.right, p->rclBox.bottom, p->ptlStart.x, + p->ptlStart.y, p->ptlEnd.x, p->ptlEnd.y); + } + if (ret) + { + ret = ArcTo(data->pdev->dev.hdc, p->rclBox.left, p->rclBox.top, + p->rclBox.right, p->rclBox.bottom, p->ptlEnd.x, + p->ptlEnd.y, p->ptlEnd.x, p->ptlEnd.y); + } + return ret; + } case EMR_CREATEMONOBRUSH: { const EMRCREATEMONOBRUSH *p = (const EMRCREATEMONOBRUSH *)rec;
From: Piotr Caban piotr@codeweavers.com
--- dlls/wineps.drv/printproc.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
diff --git a/dlls/wineps.drv/printproc.c b/dlls/wineps.drv/printproc.c index 4c13801b580..116d540b303 100644 --- a/dlls/wineps.drv/printproc.c +++ b/dlls/wineps.drv/printproc.c @@ -324,6 +324,23 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, } return ret; } + case EMR_POLYBEZIER16: + { + const EMRPOLYBEZIER16 *p = (const EMRPOLYBEZIER16 *)rec; + POINT *pts; + int i; + + pts = malloc(sizeof(*pts) * p->cpts); + if (!pts) return 0; + for (i = 0; i < p->cpts; i++) + { + pts[i].x = p->apts[i].x; + pts[i].y = p->apts[i].y; + } + i = PSDRV_PolyBezier(&data->pdev->dev, pts, p->cpts); + free(pts); + return i; + } case EMR_CREATEMONOBRUSH: { const EMRCREATEMONOBRUSH *p = (const EMRCREATEMONOBRUSH *)rec;
From: Piotr Caban piotr@codeweavers.com
--- dlls/wineps.drv/printproc.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
diff --git a/dlls/wineps.drv/printproc.c b/dlls/wineps.drv/printproc.c index 116d540b303..4475da96560 100644 --- a/dlls/wineps.drv/printproc.c +++ b/dlls/wineps.drv/printproc.c @@ -341,6 +341,23 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, free(pts); return i; } + case EMR_POLYGON16: + { + const EMRPOLYGON16 *p = (const EMRPOLYGON16 *)rec; + POINT *pts; + int i; + + pts = malloc(sizeof(*pts) * p->cpts); + if (!pts) return 0; + for (i = 0; i < p->cpts; i++) + { + pts[i].x = p->apts[i].x; + pts[i].y = p->apts[i].y; + } + i = PSDRV_PolyPolygon(&data->pdev->dev, pts, (const INT *)&p->cpts, 1); + free(pts); + return i; + } case EMR_CREATEMONOBRUSH: { const EMRCREATEMONOBRUSH *p = (const EMRCREATEMONOBRUSH *)rec;
From: Piotr Caban piotr@codeweavers.com
--- dlls/wineps.drv/printproc.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
diff --git a/dlls/wineps.drv/printproc.c b/dlls/wineps.drv/printproc.c index 4475da96560..5b088650409 100644 --- a/dlls/wineps.drv/printproc.c +++ b/dlls/wineps.drv/printproc.c @@ -358,6 +358,23 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, free(pts); return i; } + case EMR_POLYLINE16: + { + const EMRPOLYLINE16 *p = (const EMRPOLYLINE16 *)rec; + POINT *pts; + int i; + + pts = malloc(sizeof(*pts) * p->cpts); + if (!pts) return 0; + for (i = 0; i < p->cpts; i++) + { + pts[i].x = p->apts[i].x; + pts[i].y = p->apts[i].y; + } + i = PSDRV_PolyPolyline(&data->pdev->dev, pts, &p->cpts, 1); + free(pts); + return i; + } case EMR_CREATEMONOBRUSH: { const EMRCREATEMONOBRUSH *p = (const EMRCREATEMONOBRUSH *)rec;
From: Piotr Caban piotr@codeweavers.com
--- dlls/wineps.drv/printproc.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
diff --git a/dlls/wineps.drv/printproc.c b/dlls/wineps.drv/printproc.c index 5b088650409..ac09623b56e 100644 --- a/dlls/wineps.drv/printproc.c +++ b/dlls/wineps.drv/printproc.c @@ -375,6 +375,24 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, free(pts); return i; } + case EMR_POLYBEZIERTO16: + { + const EMRPOLYBEZIERTO16 *p = (const EMRPOLYBEZIERTO16 *)rec; + POINT *pts; + int i; + + pts = malloc(sizeof(*pts) * p->cpts); + if (!pts) return 0; + for (i = 0; i < p->cpts; i++) + { + pts[i].x = p->apts[i].x; + pts[i].y = p->apts[i].y; + } + i = PSDRV_PolyBezierTo(&data->pdev->dev, pts, p->cpts) && + MoveToEx(data->pdev->dev.hdc, pts[p->cpts - 1].x, pts[p->cpts - 1].y, NULL); + free(pts); + return i; + } case EMR_CREATEMONOBRUSH: { const EMRCREATEMONOBRUSH *p = (const EMRCREATEMONOBRUSH *)rec;
From: Piotr Caban piotr@codeweavers.com
--- dlls/wineps.drv/printproc.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
diff --git a/dlls/wineps.drv/printproc.c b/dlls/wineps.drv/printproc.c index ac09623b56e..a4a9debe1e0 100644 --- a/dlls/wineps.drv/printproc.c +++ b/dlls/wineps.drv/printproc.c @@ -393,6 +393,27 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, free(pts); return i; } + case EMR_POLYLINETO16: + { + const EMRPOLYLINETO16 *p = (const EMRPOLYLINETO16 *)rec; + POINT *pts; + DWORD cnt; + int i; + + cnt = p->cpts + 1; + pts = malloc(sizeof(*pts) * cnt); + if (!pts) return 0; + GetCurrentPositionEx(data->pdev->dev.hdc, pts); + for (i = 0; i < p->cpts; i++) + { + pts[i + 1].x = p->apts[i].x; + pts[i + 1].y = p->apts[i].y; + } + i = PSDRV_PolyPolyline(&data->pdev->dev, pts, &cnt, 1) && + MoveToEx(data->pdev->dev.hdc, pts[cnt - 1].x, pts[cnt - 1].y, NULL); + free(pts); + return i; + } case EMR_CREATEMONOBRUSH: { const EMRCREATEMONOBRUSH *p = (const EMRCREATEMONOBRUSH *)rec;
From: Piotr Caban piotr@codeweavers.com
--- dlls/wineps.drv/printproc.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
diff --git a/dlls/wineps.drv/printproc.c b/dlls/wineps.drv/printproc.c index a4a9debe1e0..f153226d06f 100644 --- a/dlls/wineps.drv/printproc.c +++ b/dlls/wineps.drv/printproc.c @@ -414,6 +414,23 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, free(pts); return i; } + case EMR_POLYPOLYLINE16: + { + const EMRPOLYPOLYLINE16 *p = (const EMRPOLYPOLYLINE16 *)rec; + POINT *pts; + int i; + + pts = malloc(sizeof(*pts) * p->cpts); + if (!pts) return 0; + for (i = 0; i < p->cpts; i++) + { + pts[i].x = ((const POINTS *)(p->aPolyCounts + p->nPolys))[i].x; + pts[i].y = ((const POINTS *)(p->aPolyCounts + p->nPolys))[i].y; + } + i = PSDRV_PolyPolyline(&data->pdev->dev, pts, p->aPolyCounts, p->nPolys); + free(pts); + return i; + } case EMR_CREATEMONOBRUSH: { const EMRCREATEMONOBRUSH *p = (const EMRCREATEMONOBRUSH *)rec;
From: Piotr Caban piotr@codeweavers.com
--- dlls/wineps.drv/printproc.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
diff --git a/dlls/wineps.drv/printproc.c b/dlls/wineps.drv/printproc.c index f153226d06f..71db4488b41 100644 --- a/dlls/wineps.drv/printproc.c +++ b/dlls/wineps.drv/printproc.c @@ -431,6 +431,23 @@ static int WINAPI hmf_proc(HDC hdc, HANDLETABLE *htable, free(pts); return i; } + case EMR_POLYPOLYGON16: + { + const EMRPOLYPOLYGON16 *p = (const EMRPOLYPOLYGON16 *)rec; + POINT *pts; + int i; + + pts = malloc(sizeof(*pts) * p->cpts); + if (!pts) return 0; + for (i = 0; i < p->cpts; i++) + { + pts[i].x = ((const POINTS *)(p->aPolyCounts + p->nPolys))[i].x; + pts[i].y = ((const POINTS *)(p->aPolyCounts + p->nPolys))[i].y; + } + i = PSDRV_PolyPolygon(&data->pdev->dev, pts, (const INT *)p->aPolyCounts, p->nPolys); + free(pts); + return i; + } case EMR_CREATEMONOBRUSH: { const EMRCREATEMONOBRUSH *p = (const EMRCREATEMONOBRUSH *)rec;
This merge request was approved by Huw Davies.