From: Damjan Jovanovic Subject: [PATCH] gdiplus: GdipGraphicsClear() should overwrite pixels, not alpha blend Message-Id: Date: Thu, 12 Dec 2019 22:11:11 +0200 All sample code in the Python Pyglet library suffers from terrible text corruption, caused by the inability to erase the background between rendering sequential font glyphs, resulting in leftovers from previous letters mixing with the image of new letters. This is because it attempts to erase the background by calling GdipGraphicsClear() with ARGB color 0x00000000 (completely transparent black), and in our gdiplus alpha blending that into the background has no effect. It should be using CompositeModeSourceCopy to overwrite the background with that brush instead. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=30506 Signed-off-by: Damjan Jovanovic --- dlls/gdiplus/graphics.c | 26 +++++++++++++++------ dlls/gdiplus/tests/image.c | 47 ++++++++++++++++++++++++++++++++++++-- 2 files changed, 64 insertions(+), 9 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 3c83278a4b..e485e5c99f 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -372,6 +372,9 @@ static GpStatus alpha_blend_bmp_pixels(GpGraphics *graphics, INT dst_x, INT dst_ { GpBitmap *dst_bitmap = (GpBitmap*)graphics->image; INT x, y; + CompositingMode comp_mode; + + GdipGetCompositingMode(graphics, &comp_mode); for (y=0; y