gdi32: Direcly use ntgdi functions in dib driver.
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:
parent
a222f974c3
commit
c165a83478
|
@ -30,8 +30,6 @@
|
|||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(dib);
|
||||
|
||||
extern BOOL WINAPI GdiSetPixelFormat( HDC hdc, INT fmt, const PIXELFORMATDESCRIPTOR *pfd );
|
||||
|
||||
static const struct osmesa_funcs *osmesa_funcs;
|
||||
|
||||
static const DWORD bit_fields_888[3] = {0xff0000, 0x00ff00, 0x0000ff};
|
||||
|
@ -564,7 +562,7 @@ static BOOL WINAPI dibdrv_wglMakeCurrent( HDC hdc, struct wgl_context *context )
|
|||
static BOOL WINAPI dibdrv_wglSetPixelFormat( HDC hdc, int fmt, const PIXELFORMATDESCRIPTOR *descr )
|
||||
{
|
||||
if (fmt <= 0 || fmt > ARRAY_SIZE( pixel_formats )) return FALSE;
|
||||
return GdiSetPixelFormat( hdc, fmt, descr );
|
||||
return NtGdiSetPixelFormat( hdc, fmt );
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
|
|
@ -558,7 +558,7 @@ static struct cached_font *add_cached_font( DC *dc, HFONT hfont, UINT aa_flags )
|
|||
struct cached_font font, *ptr, *last_unused = NULL;
|
||||
UINT i = 0, j, k;
|
||||
|
||||
GetObjectW( hfont, sizeof(font.lf), &font.lf );
|
||||
NtGdiExtGetObjectW( hfont, sizeof(font.lf), &font.lf );
|
||||
font.xform = dc->xformWorld2Vport;
|
||||
font.xform.eDx = font.xform.eDy = 0; /* unused, would break hashing */
|
||||
if (dc->attr->graphics_mode == GM_COMPATIBLE)
|
||||
|
@ -761,7 +761,8 @@ static struct cached_glyph *cache_glyph_bitmap( DC *dc, struct cached_font *font
|
|||
for (i = 0; i < ARRAY_SIZE( indices ); i++)
|
||||
{
|
||||
index = indices[i];
|
||||
ret = GetGlyphOutlineW( dc->hSelf, index, ggo_flags, &metrics, 0, NULL, &identity );
|
||||
ret = NtGdiGetGlyphOutline( dc->hSelf, index, ggo_flags, &metrics, 0, NULL,
|
||||
&identity, FALSE );
|
||||
if (ret != GDI_ERROR) break;
|
||||
}
|
||||
if (ret == GDI_ERROR) return NULL;
|
||||
|
@ -776,7 +777,8 @@ static struct cached_glyph *cache_glyph_bitmap( DC *dc, struct cached_font *font
|
|||
|
||||
if (bit_count == 8) pad = padding[ metrics.gmBlackBoxX % 4 ];
|
||||
|
||||
ret = GetGlyphOutlineW( dc->hSelf, index, ggo_flags, &metrics, size, glyph->bits, &identity );
|
||||
ret = NtGdiGetGlyphOutline( dc->hSelf, index, ggo_flags, &metrics, size, glyph->bits,
|
||||
&identity, FALSE );
|
||||
if (ret == GDI_ERROR)
|
||||
{
|
||||
HeapFree( GetProcessHeap(), 0, glyph );
|
||||
|
@ -1421,7 +1423,7 @@ BOOL CDECL dibdrv_Rectangle( PHYSDEV dev, INT left, INT top, INT right, INT bott
|
|||
{
|
||||
if (pdev->brush.style != BS_NULL)
|
||||
{
|
||||
HRGN interior = CreateRectRgnIndirect( &rect );
|
||||
HRGN interior = NtGdiCreateRectRgn( rect.left, rect.top, rect.right, rect.bottom );
|
||||
|
||||
NtGdiCombineRgn( interior, interior, outline, RGN_DIFF );
|
||||
brush_region( pdev, interior );
|
||||
|
|
|
@ -1272,6 +1272,11 @@ static void add_cap( dibdrv_physdev *pdev, HRGN region, HRGN round_cap, const PO
|
|||
|
||||
#define round( f ) (((f) > 0) ? (f) + 0.5 : (f) - 0.5)
|
||||
|
||||
static HRGN create_polygon_region( const POINT *points, INT count, INT mode )
|
||||
{
|
||||
return create_polypolygon_region( points, &count, 1, mode, NULL );
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* create_miter_region
|
||||
*
|
||||
|
@ -1326,7 +1331,7 @@ static HRGN create_miter_region( dibdrv_physdev *pdev, const POINT *pt,
|
|||
pts[3] = face_2->end;
|
||||
pts[4] = face_1->end;
|
||||
|
||||
return CreatePolygonRgn( pts, 5, ALTERNATE );
|
||||
return create_polygon_region( pts, 5, ALTERNATE );
|
||||
}
|
||||
|
||||
static void add_join( dibdrv_physdev *pdev, HRGN region, HRGN round_cap, const POINT *pt,
|
||||
|
@ -1360,7 +1365,7 @@ static void add_join( dibdrv_physdev *pdev, HRGN region, HRGN round_cap, const P
|
|||
pts[1] = face_2->end;
|
||||
pts[2] = face_1->end;
|
||||
pts[3] = face_2->start;
|
||||
join = CreatePolygonRgn( pts, 4, ALTERNATE );
|
||||
join = create_polygon_region( pts, 4, ALTERNATE );
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1497,7 +1502,7 @@ static BOOL wide_line_segment( dibdrv_physdev *pdev, HRGN total,
|
|||
set_rect( &clip_rect, seg_pts[2].x, seg_pts[3].y, seg_pts[0].x, seg_pts[1].y );
|
||||
if (clip_rect_to_dib( &pdev->dib, &clip_rect ))
|
||||
{
|
||||
segment = CreatePolygonRgn( seg_pts, 4, ALTERNATE );
|
||||
segment = create_polygon_region( seg_pts, 4, ALTERNATE );
|
||||
NtGdiCombineRgn( total, total, segment, RGN_OR );
|
||||
NtGdiDeleteObjectApp( segment );
|
||||
}
|
||||
|
@ -2134,7 +2139,7 @@ HBRUSH CDECL dibdrv_SelectBrush( PHYSDEV dev, HBRUSH hbrush, const struct brush_
|
|||
|
||||
TRACE("(%p, %p)\n", dev, hbrush);
|
||||
|
||||
GetObjectW( hbrush, sizeof(logbrush), &logbrush );
|
||||
NtGdiExtGetObjectW( hbrush, sizeof(logbrush), &logbrush );
|
||||
|
||||
if (hbrush == get_stock_object( DC_BRUSH ))
|
||||
logbrush.lbColor = dc->attr->brush_color;
|
||||
|
@ -2157,16 +2162,16 @@ HPEN CDECL dibdrv_SelectPen( PHYSDEV dev, HPEN hpen, const struct brush_pattern
|
|||
|
||||
TRACE("(%p, %p)\n", dev, hpen);
|
||||
|
||||
if (!GetObjectW( hpen, sizeof(logpen), &logpen ))
|
||||
if (!NtGdiExtGetObjectW( hpen, sizeof(logpen), &logpen ))
|
||||
{
|
||||
/* must be an extended pen */
|
||||
INT size = GetObjectW( hpen, 0, NULL );
|
||||
INT size = NtGdiExtGetObjectW( hpen, 0, NULL );
|
||||
|
||||
if (!size) return 0;
|
||||
|
||||
elp = HeapAlloc( GetProcessHeap(), 0, size );
|
||||
|
||||
GetObjectW( hpen, size, elp );
|
||||
NtGdiExtGetObjectW( hpen, size, elp );
|
||||
logpen.lopnStyle = elp->elpPenStyle;
|
||||
logpen.lopnWidth.x = elp->elpWidth;
|
||||
/* cosmetic ext pens are always 1-pixel wide */
|
||||
|
|
Loading…
Reference in New Issue