gdi32: Use NtGdiTransformPoints for LPtoDP.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2021-08-05 11:25:45 +02:00 committed by Alexandre Julliard
parent d57865a032
commit 32317fb1e5
2 changed files with 24 additions and 15 deletions

View File

@ -1155,6 +1155,15 @@ BOOL WINAPI DPtoLP( HDC hdc, POINT *points, INT count )
return NtGdiTransformPoints( hdc, points, points, count, NtGdiDPtoLP ); return NtGdiTransformPoints( hdc, points, points, count, NtGdiDPtoLP );
} }
/***********************************************************************
* LPtoDP (GDI32.@)
*/
BOOL WINAPI LPtoDP( HDC hdc, POINT *points, INT count )
{
return NtGdiTransformPoints( hdc, points, points, count, NtGdiLPtoDP );
}
/*********************************************************************** /***********************************************************************
* GdiSetPixelFormat (GDI32.@) * GdiSetPixelFormat (GDI32.@)
*/ */

View File

@ -345,6 +345,21 @@ BOOL WINAPI NtGdiTransformPoints( HDC hdc, const POINT *points_in, POINT *points
switch (mode) switch (mode)
{ {
case NtGdiLPtoDP:
for (i = 0; i < count; i++)
{
double x = points_in[i].x;
double y = points_in[i].y;
points_out[i].x = floor( x * dc->xformWorld2Vport.eM11 +
y * dc->xformWorld2Vport.eM21 +
dc->xformWorld2Vport.eDx + 0.5 );
points_out[i].y = floor( x * dc->xformWorld2Vport.eM12 +
y * dc->xformWorld2Vport.eM22 +
dc->xformWorld2Vport.eDy + 0.5 );
}
ret = TRUE;
break;
case NtGdiDPtoLP: case NtGdiDPtoLP:
if (!dc->vport2WorldValid) break; if (!dc->vport2WorldValid) break;
for (i = 0; i < count; i++) for (i = 0; i < count; i++)
@ -392,21 +407,6 @@ void lp_to_dp( DC *dc, POINT *points, INT count )
} }
} }
/***********************************************************************
* LPtoDP (GDI32.@)
*/
BOOL WINAPI LPtoDP( HDC hdc, POINT *points, INT count )
{
DC * dc = get_dc_ptr( hdc );
if (!dc) return FALSE;
lp_to_dp( dc, points, count );
release_dc_ptr( dc );
return TRUE;
}
/*********************************************************************** /***********************************************************************
* SetMapMode (GDI32.@) * SetMapMode (GDI32.@)
*/ */