Commit d57865a0 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

gdi32: Use NtGdiTransformPoints for DPtoLP.

parent c4f038ec
......@@ -1148,6 +1148,14 @@ INT WINAPI SetMetaRgn( HDC hdc )
}
/***********************************************************************
* DPtoLP (GDI32.@)
*/
BOOL WINAPI DPtoLP( HDC hdc, POINT *points, INT count )
{
return NtGdiTransformPoints( hdc, points, points, count, NtGdiDPtoLP );
}
/***********************************************************************
* GdiSetPixelFormat (GDI32.@)
*/
BOOL WINAPI GdiSetPixelFormat( HDC hdc, INT format, const PIXELFORMATDESCRIPTOR *descr )
......
......@@ -332,16 +332,39 @@ BOOL dp_to_lp( DC *dc, POINT *points, INT count )
}
/***********************************************************************
* DPtoLP (GDI32.@)
* NtGdiTransformPoints (win32u.@)
*/
BOOL WINAPI DPtoLP( HDC hdc, POINT *points, INT count )
BOOL WINAPI NtGdiTransformPoints( HDC hdc, const POINT *points_in, POINT *points_out,
INT count, UINT mode )
{
DC * dc = get_dc_ptr( hdc );
BOOL ret;
DC *dc = get_dc_ptr( hdc );
int i = 0;
BOOL ret = FALSE;
if (!dc) return FALSE;
ret = dp_to_lp( dc, points, count );
switch (mode)
{
case NtGdiDPtoLP:
if (!dc->vport2WorldValid) break;
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->xformVport2World.eM11 +
y * dc->xformVport2World.eM21 +
dc->xformVport2World.eDx + 0.5 );
points_out[i].y = floor( x * dc->xformVport2World.eM12 +
y * dc->xformVport2World.eM22 +
dc->xformVport2World.eDy + 0.5 );
}
ret = TRUE;
break;
default:
WARN( "invalid mode %x\n", mode );
break;
}
release_dc_ptr( dc );
return ret;
......
......@@ -93,6 +93,12 @@ enum
NtGdiPolyPolygonRgn,
};
enum
{
NtGdiLPtoDP,
NtGdiDPtoLP,
};
/* structs not compatible with native Windows */
#ifdef __WINESRC__
......@@ -251,7 +257,8 @@ INT WINAPI NtGdiStartDoc( HDC hdc, const DOCINFOW *doc );
INT WINAPI NtGdiStartPage( HDC hdc );
BOOL WINAPI NtGdiStrokePath( HDC hdc );
BOOL WINAPI NtGdiStrokeAndFillPath( HDC hdc );
BOOL WINAPI NtGdiTransformPoints( HDC hdc, POINT *points, INT count, UINT mode );
BOOL WINAPI NtGdiTransformPoints( HDC hdc, const POINT *points_in, POINT *points_out,
INT count, UINT mode );
BOOL WINAPI NtGdiUnrealizeObject( HGDIOBJ obj );
BOOL WINAPI NtGdiWidenPath( HDC hdc );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment