gdi32: Map all the points at once in PolyPolyline, similarly to what PolyPolygon does.

This commit is contained in:
Alexandre Julliard 2012-04-13 13:39:06 +02:00
parent 568afc210e
commit ea5fa7ddbe
1 changed files with 9 additions and 10 deletions

View File

@ -949,19 +949,21 @@ BOOL dibdrv_PolyPolygon( PHYSDEV dev, const POINT *pt, const INT *counts, DWORD
BOOL dibdrv_PolyPolyline( PHYSDEV dev, const POINT* pt, const DWORD* counts, DWORD polylines )
{
dibdrv_physdev *pdev = get_dibdrv_pdev(dev);
DWORD max_points = 0, i;
DWORD total, pos, i;
POINT *points;
BOOL ret = TRUE;
HRGN outline = 0;
for (i = 0; i < polylines; i++)
for (i = total = 0; i < polylines; i++)
{
if (counts[i] < 2) return FALSE;
max_points = max( counts[i], max_points );
total += counts[i];
}
points = HeapAlloc( GetProcessHeap(), 0, max_points * sizeof(*pt) );
points = HeapAlloc( GetProcessHeap(), 0, total * sizeof(*pt) );
if (!points) return FALSE;
memcpy( points, pt, total * sizeof(*pt) );
LPtoDP( dev->hdc, points, total );
if (pdev->pen_uses_region && !(outline = CreateRectRgn( 0, 0, 0, 0 )))
{
@ -969,14 +971,11 @@ BOOL dibdrv_PolyPolyline( PHYSDEV dev, const POINT* pt, const DWORD* counts, DWO
return FALSE;
}
for (i = 0; i < polylines; i++)
for (i = pos = 0; i < polylines; i++)
{
memcpy( points, pt, counts[i] * sizeof(*pt) );
pt += counts[i];
LPtoDP( dev->hdc, points, counts[i] );
reset_dash_origin( pdev );
pdev->pen_lines( pdev, counts[i], points, FALSE, outline );
pdev->pen_lines( pdev, counts[i], points + pos, FALSE, outline );
pos += counts[i];
}
if (outline)