Commit 6f095cea authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

gdi32: Use NtGdiPatBlt for PatBlt implementation.

parent be71f331
......@@ -525,9 +525,9 @@ COLORREF CDECL nulldrv_GetPixel( PHYSDEV dev, INT x, INT y )
/***********************************************************************
* PatBlt (GDI32.@)
* NtGdiPatBlt (win32u.@)
*/
BOOL WINAPI PatBlt( HDC hdc, INT left, INT top, INT width, INT height, DWORD rop)
BOOL WINAPI NtGdiPatBlt( HDC hdc, INT left, INT top, INT width, INT height, DWORD rop )
{
DC * dc;
BOOL ret = FALSE;
......
......@@ -130,19 +130,26 @@ BOOL CDECL EMFDRV_AlphaBlend( PHYSDEV dev_dst, struct bitblt_coords *dst,
BOOL CDECL EMFDRV_PatBlt( PHYSDEV dev, struct bitblt_coords *dst, DWORD rop )
{
/* FIXME: update bound rect */
return TRUE;
}
BOOL EMFDC_PatBlt( DC_ATTR *dc_attr, INT left, INT top, INT width, INT height, DWORD rop )
{
EMFDRV_PDEVICE *emf = dc_attr->emf;
EMRBITBLT emr;
BOOL ret;
emr.emr.iType = EMR_BITBLT;
emr.emr.nSize = sizeof(emr);
emr.rclBounds.left = dst->log_x;
emr.rclBounds.top = dst->log_y;
emr.rclBounds.right = dst->log_x + dst->log_width - 1;
emr.rclBounds.bottom = dst->log_y + dst->log_height - 1;
emr.xDest = dst->log_x;
emr.yDest = dst->log_y;
emr.cxDest = dst->log_width;
emr.cyDest = dst->log_height;
emr.rclBounds.left = left;
emr.rclBounds.top = top;
emr.rclBounds.right = left + width - 1;
emr.rclBounds.bottom = top + height - 1;
emr.xDest = left;
emr.yDest = top;
emr.cxDest = width;
emr.cyDest = height;
emr.dwRop = rop;
emr.xSrc = 0;
emr.ySrc = 0;
......@@ -159,9 +166,9 @@ BOOL CDECL EMFDRV_PatBlt( PHYSDEV dev, struct bitblt_coords *dst, DWORD rop )
emr.offBitsSrc = 0;
emr.cbBitsSrc = 0;
ret = EMFDRV_WriteRecord( dev, &emr.emr );
ret = EMFDRV_WriteRecord( &emf->dev, &emr.emr );
if(ret)
EMFDRV_UpdateBBox( dev, &emr.rclBounds );
EMFDRV_UpdateBBox( &emf->dev, &emr.rclBounds );
return ret;
}
......
......@@ -5693,7 +5693,7 @@ BOOL CDECL nulldrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, const RECT
{
orig = NtGdiSelectBrush( dev->hdc, brush );
dp_to_lp( dc, (POINT *)&rc, 2 );
PatBlt( dev->hdc, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, PATCOPY );
NtGdiPatBlt( dev->hdc, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, PATCOPY );
NtGdiSelectBrush( dev->hdc, orig );
DeleteObject( brush );
}
......
......@@ -58,6 +58,7 @@ extern BOOL METADC_InvertRgn( HDC hdc, HRGN hrgn ) DECLSPEC_HIDDEN;
extern BOOL METADC_LineTo( HDC hdc, INT x, INT y ) DECLSPEC_HIDDEN;
extern BOOL METADC_MoveTo( HDC hdc, INT x, INT y ) DECLSPEC_HIDDEN;
extern BOOL METADC_PaintRgn( HDC hdc, HRGN hrgn ) DECLSPEC_HIDDEN;
extern BOOL METADC_PatBlt( HDC hdc, INT left, INT top, INT width, INT height, DWORD rop );
extern BOOL METADC_Pie( HDC hdc, INT left, INT top, INT right, INT bottom,
INT xstart, INT ystart, INT xend, INT yend ) DECLSPEC_HIDDEN;
extern BOOL METADC_PolyPolygon( HDC hdc, const POINT *points, const INT *counts,
......@@ -101,6 +102,7 @@ extern BOOL EMFDC_InvertRgn( DC_ATTR *dc_attr, HRGN hrgn ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_LineTo( DC_ATTR *dc_attr, INT x, INT y ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_MoveTo( DC_ATTR *dc_attr, INT x, INT y ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_PaintRgn( DC_ATTR *dc_attr, HRGN hrgn ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_PatBlt( DC_ATTR *dc_attr, INT left, INT top, INT width, INT height, DWORD rop );
extern BOOL EMFDC_PolyBezier( DC_ATTR *dc_attr, const POINT *points, DWORD count ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_PolyBezierTo( DC_ATTR *dc_attr, const POINT *points, DWORD count ) DECLSPEC_HIDDEN;
extern BOOL EMFDC_PolyDraw( DC_ATTR *dc_attr, const POINT *points, const BYTE *types,
......
......@@ -985,6 +985,20 @@ BOOL WINAPI ExtTextOutW( HDC hdc, INT x, INT y, UINT flags, const RECT *rect,
}
/***********************************************************************
* PatBlt (GDI32.@)
*/
BOOL WINAPI PatBlt( HDC hdc, INT left, INT top, INT width, INT height, DWORD rop )
{
DC_ATTR *dc_attr;
if (is_meta_dc( hdc )) return METADC_PatBlt( hdc, left, top, width, height, rop );
if (!(dc_attr = get_dc_attr( hdc ))) return FALSE;
if (dc_attr->emf && !EMFDC_PatBlt( dc_attr, left, top, width, height, rop ))
return FALSE;
return NtGdiPatBlt( hdc, left, top, width, height, rop );
}
/***********************************************************************
* BeginPath (GDI32.@)
*/
BOOL WINAPI BeginPath(HDC hdc)
......
......@@ -26,13 +26,12 @@
WINE_DEFAULT_DEBUG_CHANNEL(metafile);
/***********************************************************************
* MFDRV_PatBlt
* METADC_PatBlt
*/
BOOL CDECL MFDRV_PatBlt( PHYSDEV dev, struct bitblt_coords *dst, DWORD rop )
BOOL METADC_PatBlt( HDC hdc, INT left, INT top, INT width, INT height, DWORD rop )
{
MFDRV_MetaParam6( dev, META_PATBLT, dst->log_x, dst->log_y, dst->log_width, dst->log_height,
HIWORD(rop), LOWORD(rop) );
return TRUE;
return metadc_param6( hdc, META_PATBLT, left, top, width, height,
HIWORD(rop), LOWORD(rop) );
}
......
......@@ -168,7 +168,7 @@ static const struct gdi_dc_funcs MFDRV_Funcs =
MFDRV_OffsetViewportOrgEx, /* pOffsetViewportOrgEx */
MFDRV_OffsetWindowOrgEx, /* pOffsetWindowOrgEx */
NULL, /* pPaintRgn */
MFDRV_PatBlt, /* pPatBlt */
NULL, /* pPatBlt */
NULL, /* pPie */
MFDRV_PolyBezier, /* pPolyBezier */
MFDRV_PolyBezierTo, /* pPolyBezierTo */
......
......@@ -92,7 +92,6 @@ extern INT CDECL MFDRV_IntersectClipRect( PHYSDEV dev, INT left, INT top, INT r
extern INT CDECL MFDRV_OffsetClipRgn( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_OffsetViewportOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_OffsetWindowOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_PatBlt( PHYSDEV dev, struct bitblt_coords *dst, DWORD rop ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_PolyBezier( PHYSDEV dev, const POINT* pt, DWORD count ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_PolyBezierTo( PHYSDEV dev, const POINT* pt, DWORD count ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_RestoreDC( PHYSDEV dev, INT level ) DECLSPEC_HIDDEN;
......
......@@ -209,6 +209,7 @@ BOOL WINAPI NtGdiLineTo( HDC hdc, INT x, INT y );
BOOL WINAPI NtGdiMoveTo( HDC hdc, INT x, INT y, POINT *pt );
INT WINAPI NtGdiOffsetClipRgn( HDC hdc, INT x, INT y );
INT WINAPI NtGdiOffsetRgn( HRGN hrgn, INT x, INT y );
BOOL WINAPI NtGdiPatBlt( HDC hdc, INT left, INT top, INT width, INT height, DWORD rop );
HRGN WINAPI NtGdiPathToRegion( HDC hdc );
BOOL WINAPI NtGdiPolyDraw(HDC hdc, const POINT *points, const BYTE *types, DWORD count );
ULONG WINAPI NtGdiPolyPolyDraw( HDC hdc, const POINT *points, const UINT *counts,
......
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