From 315a4e5db4b101dca6141f447ef0a836adad4faa Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Thu, 10 Mar 2011 14:51:02 -0600 Subject: [PATCH 05/14] gdiplus: Prefer to not use gdi32 for gradient and texture brushes. --- dlls/gdiplus/graphics.c | 17 ++++++++++++++++- 1 files changed, 16 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 8f4e9d0..29dea0a 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -578,6 +578,21 @@ static ARGB resample_bitmap_pixel(GDIPCONST GpRect *src_rect, LPBYTE bits, UINT } } +static INT brush_can_fill_path(GpBrush *brush) +{ + switch (brush->bt) + { + case BrushTypeSolidColor: + case BrushTypeHatchFill: + return 1; + case BrushTypeLinearGradient: + case BrushTypeTextureFill: + /* Gdi32 isn't much help with these, so we should use brush_fill_pixels instead. */ + default: + return 0; + } +} + static void brush_fill_path(GpGraphics *graphics, GpBrush* brush) { switch (brush->bt) @@ -3745,7 +3760,7 @@ static GpStatus GDI32_GdipFillRegion(GpGraphics* graphics, GpBrush* brush, HRGN hrgn; RECT rc; - if(!graphics->hdc) + if(!graphics->hdc || !brush_can_fill_path(brush)) return NotImplemented; status = GdipGetRegionHRgn(region, graphics, &hrgn); -- 1.7.1