diff --git a/dlls/gdi32/bitblt.c b/dlls/gdi32/bitblt.c index fd505b13407..0024234ac2d 100644 --- a/dlls/gdi32/bitblt.c +++ b/dlls/gdi32/bitblt.c @@ -935,11 +935,11 @@ error: } /****************************************************************************** - * GdiAlphaBlend [GDI32.@] + * NtGdiAlphaBlend (win32u.@) */ -BOOL WINAPI GdiAlphaBlend(HDC hdcDst, int xDst, int yDst, int widthDst, int heightDst, - HDC hdcSrc, int xSrc, int ySrc, int widthSrc, int heightSrc, - BLENDFUNCTION blendFunction) +BOOL WINAPI NtGdiAlphaBlend( HDC hdcDst, int xDst, int yDst, int widthDst, int heightDst, + HDC hdcSrc, int xSrc, int ySrc, int widthSrc, int heightSrc, + BLENDFUNCTION blendFunction, HANDLE xform ) { BOOL ret = FALSE; DC *dcDst, *dcSrc; diff --git a/dlls/gdi32/enhmfdrv/bitblt.c b/dlls/gdi32/enhmfdrv/bitblt.c index 9d930d17591..73959da2ec4 100644 --- a/dlls/gdi32/enhmfdrv/bitblt.c +++ b/dlls/gdi32/enhmfdrv/bitblt.c @@ -158,12 +158,19 @@ err: return ret; } +BOOL EMFDC_AlphaBlend( DC_ATTR *dc_attr, INT x_dst, INT y_dst, INT width_dst, INT height_dst, + HDC hdc_src, INT x_src, INT y_src, INT width_src, INT height_src, + BLENDFUNCTION blend_function ) +{ + return emfdrv_stretchblt( dc_attr->emf, x_dst, y_dst, width_dst, height_dst, hdc_src, x_src, y_src, + width_src, height_src, *(DWORD *)&blend_function, EMR_ALPHABLEND ); +} + BOOL CDECL EMFDRV_AlphaBlend( PHYSDEV dev_dst, struct bitblt_coords *dst, PHYSDEV dev_src, struct bitblt_coords *src, BLENDFUNCTION func ) { - return emfdrv_stretchblt( dev_dst, dst->log_x, dst->log_y, dst->log_width, dst->log_height, - dev_src->hdc, src->log_x, src->log_y, src->log_width, src->log_height, - *(DWORD *)&func, EMR_ALPHABLEND ); + /* FIXME: update bound rect */ + return TRUE; } BOOL CDECL EMFDRV_PatBlt( PHYSDEV dev, struct bitblt_coords *dst, DWORD rop ) diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h index 3b99eb49d5d..305dec43c7f 100644 --- a/dlls/gdi32/gdi_private.h +++ b/dlls/gdi32/gdi_private.h @@ -112,6 +112,9 @@ extern BOOL METADC_StretchBlt( HDC hdc_dst, INT x_dst, INT y_dst, INT width_dst, /* enhanced metafiles */ extern BOOL EMFDC_AbortPath( DC_ATTR *dc_attr ) DECLSPEC_HIDDEN; +extern BOOL EMFDC_AlphaBlend( DC_ATTR *dc_attr, INT x_dst, INT y_dst, INT width_dst, INT height_dst, + HDC hdc_src, INT x_src, INT y_src, INT width_src, INT height_src, + BLENDFUNCTION blend_function ); extern BOOL EMFDC_AngleArc( DC_ATTR *dc_attr, INT x, INT y, DWORD radius, FLOAT start, FLOAT sweep ) DECLSPEC_HIDDEN; extern BOOL EMFDC_ArcChordPie( DC_ATTR *dc_attr, INT left, INT top, INT right, diff --git a/dlls/gdi32/gdidc.c b/dlls/gdi32/gdidc.c index 685396f6893..b8faf9fb58c 100644 --- a/dlls/gdi32/gdidc.c +++ b/dlls/gdi32/gdidc.c @@ -1235,6 +1235,25 @@ BOOL WINAPI StretchBlt( HDC hdc, INT x_dst, INT y_dst, INT width_dst, INT height height_src, rop, 0 /* FIXME */ ); } +/****************************************************************************** + * GdiAlphaBlend (GDI32.@) + */ +BOOL WINAPI GdiAlphaBlend( HDC hdc_dst, int x_dst, int y_dst, int width_dst, int height_dst, + HDC hdc_src, int x_src, int y_src, int width_src, int height_src, + BLENDFUNCTION blend_function) +{ + DC_ATTR *dc_attr; + + if (!(dc_attr = get_dc_attr( hdc_dst ))) return FALSE; + if (dc_attr->emf && !EMFDC_AlphaBlend( dc_attr, x_dst, y_dst, width_dst, height_dst, + hdc_src, x_src, y_src, width_src, + height_src, blend_function )) + return FALSE; + return NtGdiAlphaBlend( hdc_dst, x_dst, y_dst, width_dst, height_dst, + hdc_src, x_src, y_src, width_src, height_src, + blend_function, 0 /* FIXME */ ); +} + /*********************************************************************** * BeginPath (GDI32.@) */ diff --git a/include/ntgdi.h b/include/ntgdi.h index 63547f5bd4a..5d67798052a 100644 --- a/include/ntgdi.h +++ b/include/ntgdi.h @@ -145,6 +145,9 @@ typedef struct DC_ATTR INT WINAPI NtGdiAbortDoc( HDC hdc ); BOOL WINAPI NtGdiAbortPath( HDC hdc ); +BOOL WINAPI NtGdiAlphaBlend( HDC hdc_dst, int x_dst, int y_dst, int width_dst, int height_dst, + HDC hdc_src, int x_src, int y_src, int width_src, int height_src, + BLENDFUNCTION blend_function, HANDLE xform ); BOOL WINAPI NtGdiAngleArc( HDC hdc, INT x, INT y, DWORD radius, FLOAT start_angle, FLOAT sweep_angle ); BOOL WINAPI NtGdiArcInternal( UINT type, HDC hdc, INT left, INT top, INT right, INT bottom,