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

gdi32: Direcly use ntgdi functions in dib driver.

parent a222f974
...@@ -30,8 +30,6 @@ ...@@ -30,8 +30,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(dib); 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 struct osmesa_funcs *osmesa_funcs;
static const DWORD bit_fields_888[3] = {0xff0000, 0x00ff00, 0x0000ff}; 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 ) ...@@ -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 ) static BOOL WINAPI dibdrv_wglSetPixelFormat( HDC hdc, int fmt, const PIXELFORMATDESCRIPTOR *descr )
{ {
if (fmt <= 0 || fmt > ARRAY_SIZE( pixel_formats )) return FALSE; 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 ) ...@@ -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; struct cached_font font, *ptr, *last_unused = NULL;
UINT i = 0, j, k; 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 = dc->xformWorld2Vport;
font.xform.eDx = font.xform.eDy = 0; /* unused, would break hashing */ font.xform.eDx = font.xform.eDy = 0; /* unused, would break hashing */
if (dc->attr->graphics_mode == GM_COMPATIBLE) if (dc->attr->graphics_mode == GM_COMPATIBLE)
...@@ -761,7 +761,8 @@ static struct cached_glyph *cache_glyph_bitmap( DC *dc, struct cached_font *font ...@@ -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++) for (i = 0; i < ARRAY_SIZE( indices ); i++)
{ {
index = 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) break;
} }
if (ret == GDI_ERROR) return NULL; if (ret == GDI_ERROR) return NULL;
...@@ -776,7 +777,8 @@ static struct cached_glyph *cache_glyph_bitmap( DC *dc, struct cached_font *font ...@@ -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 ]; 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) if (ret == GDI_ERROR)
{ {
HeapFree( GetProcessHeap(), 0, glyph ); HeapFree( GetProcessHeap(), 0, glyph );
...@@ -1421,7 +1423,7 @@ BOOL CDECL dibdrv_Rectangle( PHYSDEV dev, INT left, INT top, INT right, INT bott ...@@ -1421,7 +1423,7 @@ BOOL CDECL dibdrv_Rectangle( PHYSDEV dev, INT left, INT top, INT right, INT bott
{ {
if (pdev->brush.style != BS_NULL) 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 ); NtGdiCombineRgn( interior, interior, outline, RGN_DIFF );
brush_region( pdev, interior ); brush_region( pdev, interior );
......
...@@ -1272,6 +1272,11 @@ static void add_cap( dibdrv_physdev *pdev, HRGN region, HRGN round_cap, const PO ...@@ -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) #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 * create_miter_region
* *
...@@ -1326,7 +1331,7 @@ static HRGN create_miter_region( dibdrv_physdev *pdev, const POINT *pt, ...@@ -1326,7 +1331,7 @@ static HRGN create_miter_region( dibdrv_physdev *pdev, const POINT *pt,
pts[3] = face_2->end; pts[3] = face_2->end;
pts[4] = face_1->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, 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 ...@@ -1360,7 +1365,7 @@ static void add_join( dibdrv_physdev *pdev, HRGN region, HRGN round_cap, const P
pts[1] = face_2->end; pts[1] = face_2->end;
pts[2] = face_1->end; pts[2] = face_1->end;
pts[3] = face_2->start; pts[3] = face_2->start;
join = CreatePolygonRgn( pts, 4, ALTERNATE ); join = create_polygon_region( pts, 4, ALTERNATE );
break; break;
} }
...@@ -1497,7 +1502,7 @@ static BOOL wide_line_segment( dibdrv_physdev *pdev, HRGN total, ...@@ -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 ); 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 )) 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 ); NtGdiCombineRgn( total, total, segment, RGN_OR );
NtGdiDeleteObjectApp( segment ); NtGdiDeleteObjectApp( segment );
} }
...@@ -2134,7 +2139,7 @@ HBRUSH CDECL dibdrv_SelectBrush( PHYSDEV dev, HBRUSH hbrush, const struct brush_ ...@@ -2134,7 +2139,7 @@ HBRUSH CDECL dibdrv_SelectBrush( PHYSDEV dev, HBRUSH hbrush, const struct brush_
TRACE("(%p, %p)\n", dev, hbrush); TRACE("(%p, %p)\n", dev, hbrush);
GetObjectW( hbrush, sizeof(logbrush), &logbrush ); NtGdiExtGetObjectW( hbrush, sizeof(logbrush), &logbrush );
if (hbrush == get_stock_object( DC_BRUSH )) if (hbrush == get_stock_object( DC_BRUSH ))
logbrush.lbColor = dc->attr->brush_color; logbrush.lbColor = dc->attr->brush_color;
...@@ -2157,16 +2162,16 @@ HPEN CDECL dibdrv_SelectPen( PHYSDEV dev, HPEN hpen, const struct brush_pattern ...@@ -2157,16 +2162,16 @@ HPEN CDECL dibdrv_SelectPen( PHYSDEV dev, HPEN hpen, const struct brush_pattern
TRACE("(%p, %p)\n", dev, hpen); TRACE("(%p, %p)\n", dev, hpen);
if (!GetObjectW( hpen, sizeof(logpen), &logpen )) if (!NtGdiExtGetObjectW( hpen, sizeof(logpen), &logpen ))
{ {
/* must be an extended pen */ /* must be an extended pen */
INT size = GetObjectW( hpen, 0, NULL ); INT size = NtGdiExtGetObjectW( hpen, 0, NULL );
if (!size) return 0; if (!size) return 0;
elp = HeapAlloc( GetProcessHeap(), 0, size ); elp = HeapAlloc( GetProcessHeap(), 0, size );
GetObjectW( hpen, size, elp ); NtGdiExtGetObjectW( hpen, size, elp );
logpen.lopnStyle = elp->elpPenStyle; logpen.lopnStyle = elp->elpPenStyle;
logpen.lopnWidth.x = elp->elpWidth; logpen.lopnWidth.x = elp->elpWidth;
/* cosmetic ext pens are always 1-pixel wide */ /* cosmetic ext pens are always 1-pixel wide */
......
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