Commit 7659c6ff authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

gdi32: Don't use bitblt_coords in emfdrv_stretchblt.

parent 77c97174
...@@ -28,8 +28,9 @@ ...@@ -28,8 +28,9 @@
#include "enhmetafiledrv.h" #include "enhmetafiledrv.h"
/* Generate an EMRBITBLT, EMRSTRETCHBLT or EMRALPHABLEND record depending on the type parameter */ /* Generate an EMRBITBLT, EMRSTRETCHBLT or EMRALPHABLEND record depending on the type parameter */
static BOOL emfdrv_stretchblt( PHYSDEV dev_dst, struct bitblt_coords *dst, HDC hdc_src, static BOOL emfdrv_stretchblt( PHYSDEV dev_dst, INT x_dst, INT y_dst, INT width_dst, INT height_dst,
struct bitblt_coords *src, DWORD rop, DWORD type ) HDC hdc_src, INT x_src, INT y_src, INT width_src, INT height_src,
DWORD rop, DWORD type )
{ {
BITMAPINFO src_info = {{ sizeof( src_info.bmiHeader ) }}; BITMAPINFO src_info = {{ sizeof( src_info.bmiHeader ) }};
UINT bmi_size, emr_size, size, bpp; UINT bmi_size, emr_size, size, bpp;
...@@ -115,21 +116,21 @@ static BOOL emfdrv_stretchblt( PHYSDEV dev_dst, struct bitblt_coords *dst, HDC h ...@@ -115,21 +116,21 @@ static BOOL emfdrv_stretchblt( PHYSDEV dev_dst, struct bitblt_coords *dst, HDC h
emr->emr.iType = type; emr->emr.iType = type;
emr->emr.nSize = size; emr->emr.nSize = size;
emr->rclBounds.left = dst->log_x; emr->rclBounds.left = x_dst;
emr->rclBounds.top = dst->log_y; emr->rclBounds.top = y_dst;
emr->rclBounds.right = dst->log_x + dst->log_width - 1; emr->rclBounds.right = x_dst + width_dst - 1;
emr->rclBounds.bottom = dst->log_y + dst->log_height - 1; emr->rclBounds.bottom = y_dst + height_dst - 1;
emr->xDest = dst->log_x; emr->xDest = x_dst;
emr->yDest = dst->log_y; emr->yDest = y_dst;
emr->cxDest = dst->log_width; emr->cxDest = width_dst;
emr->cyDest = dst->log_height; emr->cyDest = height_dst;
emr->xSrc = src->log_x; emr->xSrc = x_src;
emr->ySrc = src->log_y; emr->ySrc = y_src;
if (type == EMR_STRETCHBLT || type == EMR_ALPHABLEND) if (type == EMR_STRETCHBLT || type == EMR_ALPHABLEND)
{ {
EMRSTRETCHBLT *emr_stretchblt = (EMRSTRETCHBLT *)emr; EMRSTRETCHBLT *emr_stretchblt = (EMRSTRETCHBLT *)emr;
emr_stretchblt->cxSrc = src->log_width; emr_stretchblt->cxSrc = width_src;
emr_stretchblt->cySrc = src->log_height; emr_stretchblt->cySrc = height_src;
} }
emr->dwRop = rop; emr->dwRop = rop;
NtGdiGetTransform( hdc_src, 0x204, &emr->xformSrc ); NtGdiGetTransform( hdc_src, 0x204, &emr->xformSrc );
...@@ -160,7 +161,9 @@ err: ...@@ -160,7 +161,9 @@ err:
BOOL CDECL EMFDRV_AlphaBlend( PHYSDEV dev_dst, struct bitblt_coords *dst, BOOL CDECL EMFDRV_AlphaBlend( PHYSDEV dev_dst, struct bitblt_coords *dst,
PHYSDEV dev_src, struct bitblt_coords *src, BLENDFUNCTION func ) PHYSDEV dev_src, struct bitblt_coords *src, BLENDFUNCTION func )
{ {
return emfdrv_stretchblt( dev_dst, dst, dev_src->hdc, src, *(DWORD *)&func, EMR_ALPHABLEND ); 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 );
} }
BOOL CDECL EMFDRV_PatBlt( PHYSDEV dev, struct bitblt_coords *dst, DWORD rop ) BOOL CDECL EMFDRV_PatBlt( PHYSDEV dev, struct bitblt_coords *dst, DWORD rop )
...@@ -207,13 +210,16 @@ BOOL EMFDC_PatBlt( DC_ATTR *dc_attr, INT left, INT top, INT width, INT height, D ...@@ -207,13 +210,16 @@ BOOL EMFDC_PatBlt( DC_ATTR *dc_attr, INT left, INT top, INT width, INT height, D
return ret; return ret;
} }
BOOL CDECL EMFDRV_StretchBlt( PHYSDEV devDst, struct bitblt_coords *dst, BOOL CDECL EMFDRV_StretchBlt( PHYSDEV dev_dst, struct bitblt_coords *dst,
PHYSDEV devSrc, struct bitblt_coords *src, DWORD rop ) PHYSDEV dev_src, struct bitblt_coords *src, DWORD rop )
{ {
if (src->log_width == dst->log_width && src->log_height == dst->log_height) if (src->log_width == dst->log_width && src->log_height == dst->log_height)
return emfdrv_stretchblt( devDst, dst, devSrc->hdc, src, rop, EMR_BITBLT ); return emfdrv_stretchblt( dev_dst, dst->log_x, dst->log_y, dst->log_width, dst->log_height,
else dev_src->hdc, src->log_x, src->log_y, src->log_width, src->log_height,
return emfdrv_stretchblt( devDst, dst, devSrc->hdc, src, rop, EMR_STRETCHBLT ); rop, EMR_BITBLT );
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,
rop, EMR_STRETCHBLT );
} }
INT CDECL EMFDRV_StretchDIBits( PHYSDEV dev, INT xDst, INT yDst, INT widthDst, INT heightDst, INT CDECL EMFDRV_StretchDIBits( PHYSDEV dev, INT xDst, INT yDst, INT widthDst, INT heightDst,
......
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