Commit 57460dbb authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

gdi32: Avoid calling gdi32 functions from ntgdi functions.

parent 6b1cdd1b
......@@ -133,7 +133,7 @@ static inline void create_default_clip_region( DC * dc )
rect.right = NtGdiGetDeviceCaps( dc->hSelf, DESKTOPHORZRES );
rect.bottom = NtGdiGetDeviceCaps( dc->hSelf, DESKTOPVERTRES );
}
dc->hClipRgn = CreateRectRgnIndirect( &rect );
dc->hClipRgn = NtGdiCreateRectRgn( rect.left, rect.top, rect.right, rect.bottom );
}
......@@ -265,7 +265,7 @@ INT WINAPI NtGdiExcludeClipRect( HDC hdc, INT left, INT top, INT right, INT bott
rect = get_clip_rect( dc, left, top, right, bottom );
if ((rgn = CreateRectRgnIndirect( &rect )))
if ((rgn = NtGdiCreateRectRgn( rect.left, rect.top, rect.right, rect.bottom )))
{
if (!dc->hClipRgn) create_default_clip_region( dc );
ret = NtGdiCombineRgn( dc->hClipRgn, dc->hClipRgn, rgn, RGN_DIFF );
......@@ -293,10 +293,10 @@ INT WINAPI NtGdiIntersectClipRect( HDC hdc, INT left, INT top, INT right, INT bo
rect = get_clip_rect( dc, left, top, right, bottom );
if (!dc->hClipRgn)
{
if ((dc->hClipRgn = CreateRectRgnIndirect( &rect )))
if ((dc->hClipRgn = NtGdiCreateRectRgn( rect.left, rect.top, rect.right, rect.bottom )))
ret = SIMPLEREGION;
}
else if ((rgn = CreateRectRgnIndirect( &rect )))
else if ((rgn = NtGdiCreateRectRgn( rect.left, rect.top, rect.right, rect.bottom )))
{
ret = NtGdiCombineRgn( dc->hClipRgn, dc->hClipRgn, rgn, RGN_AND );
NtGdiDeleteObjectApp( rgn );
......
......@@ -936,8 +936,8 @@ UINT set_dib_dc_color_table( HDC hdc, UINT startpos, UINT entries, const RGBQUAD
if (result) /* update colors of selected objects */
{
SetTextColor( hdc, dc->attr->text_color );
SetBkColor( hdc, dc->attr->background_color );
NtGdiGetAndSetDCDword( hdc, NtGdiSetTextColor, dc->attr->text_color, NULL );
NtGdiGetAndSetDCDword( hdc, NtGdiSetBkColor, dc->attr->background_color, NULL );
NtGdiSelectPen( hdc, dc->hPen );
NtGdiSelectBrush( hdc, dc->hBrush );
}
......
......@@ -608,7 +608,7 @@ static INT CDECL nulldrv_GetTextFace( PHYSDEV dev, INT size, LPWSTR name )
LOGFONTW font;
DC *dc = get_nulldrv_dc( dev );
if (GetObjectW( dc->hFont, sizeof(font), &font ))
if (NtGdiExtGetObjectW( dc->hFont, sizeof(font), &font ))
{
ret = lstrlenW( font.lfFaceName ) + 1;
if (name)
......
......@@ -158,7 +158,7 @@ HPALETTE WINAPI NtGdiCreateHalftonePalette( HDC hdc )
pal->palPalEntry[i].peBlue = entries[i].rgbBlue;
pal->palPalEntry[i].peFlags = 0;
}
return CreatePalette( pal );
return NtGdiCreatePaletteInternal( pal, pal->palNumEntries );
}
......
......@@ -348,7 +348,7 @@ static HRGN path_to_region( const struct gdi_path *path, int mode )
if (i > pos + 1) counts[polygons++] = i - pos;
assert( polygons <= path->count / 2 );
hrgn = CreatePolyPolygonRgn( path->points, counts, polygons, mode );
hrgn = create_polypolygon_region( path->points, counts, polygons, mode, NULL );
HeapFree( GetProcessHeap(), 0, counts );
return hrgn;
}
......@@ -1535,7 +1535,7 @@ static BOOL CDECL pathdrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, con
DWORD dwSize;
void *outline;
dwSize = GetGlyphOutlineW(dev->hdc, str[idx], ggo_flags, &gm, 0, NULL, &identity);
dwSize = NtGdiGetGlyphOutline( dev->hdc, str[idx], ggo_flags, &gm, 0, NULL, &identity, FALSE );
if (dwSize == GDI_ERROR) continue;
/* add outline only if char is printable */
......@@ -1544,7 +1544,7 @@ static BOOL CDECL pathdrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, con
outline = HeapAlloc(GetProcessHeap(), 0, dwSize);
if (!outline) return FALSE;
GetGlyphOutlineW(dev->hdc, str[idx], ggo_flags, &gm, dwSize, outline, &identity);
NtGdiGetGlyphOutline( dev->hdc, str[idx], ggo_flags, &gm, dwSize, outline, &identity, FALSE );
PATH_add_outline(physdev, x + offset.x, y + offset.y, outline, dwSize);
HeapFree(GetProcessHeap(), 0, outline);
......@@ -1618,14 +1618,14 @@ static struct gdi_path *PATH_WidenPath(DC *dc)
BYTE *type;
DWORD obj_type, joint, endcap, penType;
size = GetObjectW( dc->hPen, 0, NULL );
size = NtGdiExtGetObjectW( dc->hPen, 0, NULL );
if (!size) {
SetLastError(ERROR_CAN_NOT_COMPLETE);
return NULL;
}
elp = HeapAlloc( GetProcessHeap(), 0, size );
GetObjectW( dc->hPen, size, elp );
NtGdiExtGetObjectW( dc->hPen, size, elp );
obj_type = get_gdi_object_type(dc->hPen);
switch (obj_type)
......
......@@ -927,7 +927,7 @@ HRGN WINAPI NtGdiExtCreateRegion( const XFORM *xform, DWORD count, const RGNDATA
pt[3].y = pCurRect->bottom;
translate( pt, 4, xform );
poly_hrgn = CreatePolyPolygonRgn( pt, &count, 1, WINDING );
poly_hrgn = create_polypolygon_region( pt, &count, 1, WINDING, NULL );
NtGdiCombineRgn( hrgn, hrgn, poly_hrgn, RGN_OR );
NtGdiDeleteObjectApp( poly_hrgn );
}
......
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