From 833316f91d428955744f88ee02c71f4bad38e4c2 Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Thu, 10 Mar 2011 15:58:22 -0600 Subject: [PATCH] gdiplus: Call GdiAlphaBlend only once per GdipFillRegion call. --- dlls/gdiplus/graphics.c | 95 +++++++++++++++++++++++++++++++---------- 1 file changed, 73 insertions(+), 22 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 4d059f815bf..83e0f248d52 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -3856,39 +3856,90 @@ static GpStatus SOFTWARE_GdipFillRegion(GpGraphics *graphics, GpBrush *brush, if (stat == Ok) { - UINT max_size=0; - - for (i=0; iimage) { - UINT size = scans[i].Width * scans[i].Height; + /* If we have to go through gdi32, use as few alpha blends as possible. */ + INT min_x, min_y, max_x, max_y; + UINT data_width, data_height; - if (size > max_size) - max_size = size; - } + min_x = scans[0].X; + min_y = scans[0].Y; + max_x = scans[0].X+scans[0].Width; + max_y = scans[0].Y+scans[0].Height; - pixel_data = GdipAlloc(sizeof(*pixel_data) * max_size); - if (!pixel_data) - stat = OutOfMemory; - - if (stat == Ok) - { - for (i=0; i max_size) + max_size = size; } - GdipFree(pixel_data); + pixel_data = GdipAlloc(sizeof(*pixel_data) * max_size); + if (!pixel_data) + stat = OutOfMemory; + + if (stat == Ok) + { + for (i=0; i