On Mon, Apr 19, 2021 at 05:41:47PM +0800, Zhiyi Zhang wrote:
Fix a bug that Tally produces a blank print preview when images have to be scaled.
Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com
dlls/gdi32/enhmfdrv/bitblt.c | 101 +++++++++++++++++++++++++++ dlls/gdi32/enhmfdrv/enhmetafiledrv.h | 2 + dlls/gdi32/enhmfdrv/init.c | 2 +- dlls/gdi32/tests/metafile.c | 4 +- 4 files changed, 105 insertions(+), 4 deletions(-)
diff --git a/dlls/gdi32/enhmfdrv/bitblt.c b/dlls/gdi32/enhmfdrv/bitblt.c index 1fc5c0b1040..794bb416dfa 100644 --- a/dlls/gdi32/enhmfdrv/bitblt.c +++ b/dlls/gdi32/enhmfdrv/bitblt.c @@ -27,6 +27,107 @@ #include "enhmetafiledrv.h" #include "wine/debug.h"
+BOOL CDECL EMFDRV_AlphaBlend( PHYSDEV dev_dst, struct bitblt_coords *dst, PHYSDEV dev_src,
struct bitblt_coords *src, BLENDFUNCTION func )
+{
- unsigned char src_buffer[FIELD_OFFSET(BITMAPINFO, bmiColors[256])];
- BITMAPINFO *src_info = (BITMAPINFO *)src_buffer;
- UINT bits_size, bmi_size, emr_size, size, bpp;
- struct gdi_image_bits bits;
- EMRALPHABLEND *emr;
- BITMAPINFO *bmi;
- DC *dc_src;
- DWORD err;
- BOOL ret;
- /* can't use a metafile DC as source */
- if (dev_src->funcs == dev_dst->funcs)
return FALSE;
There's no need for this hack now since GetImage() will not succeed in this case. I've fixed this up and sent in v5.
- dc_src = get_physdev_dc(dev_src);
- dev_src = GET_DC_PHYSDEV(dc_src, pGetImage);
- err = dev_src->funcs->pGetImage(dev_src, src_info, &bits, src);
- if (err)
- {
SetLastError(err);
return FALSE;
- }
Huw.