This is an optimization. Clipping has already been taken care of by the caller in this case.
From: Esme Povirk esme@codeweavers.com
--- dlls/gdiplus/graphics.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 8fa0d689cbe..9bc5550d5a6 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -4833,6 +4833,11 @@ static GpStatus get_clipped_region_hrgn(GpGraphics* graphics, GpRegion* region, GdipDeleteRegion(device_region); }
+ if (status == Ok && graphics->gdi_clip) + { + CombineRgn(*hrgn, *hrgn, graphics->gdi_clip, RGN_AND); + } + return status; }
From: Esme Povirk esme@codeweavers.com
This is an optimization. Clipping has already been taken care of by the caller in this case. --- dlls/gdiplus/graphics.c | 51 ++++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 23 deletions(-)
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 9bc5550d5a6..49a9d453b3d 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -616,22 +616,24 @@ static GpStatus alpha_blend_pixels_hrgn(GpGraphics *graphics, INT dst_x, INT dst if (!hrgn) return OutOfMemory;
- stat = get_clip_hrgn(graphics, &visible_rgn); - if (stat != Ok) + if (hregion) + CombineRgn(hrgn, hrgn, hregion, RGN_AND); + else { - DeleteObject(hrgn); - return stat; - } + stat = get_clip_hrgn(graphics, &visible_rgn); + if (stat != Ok) + { + DeleteObject(hrgn); + return stat; + }
- if (visible_rgn) - { - CombineRgn(hrgn, hrgn, visible_rgn, RGN_AND); - DeleteObject(visible_rgn); + if (visible_rgn) + { + CombineRgn(hrgn, hrgn, visible_rgn, RGN_AND); + DeleteObject(visible_rgn); + } }
- if (hregion) - CombineRgn(hrgn, hrgn, hregion, RGN_AND); - size = GetRegionData(hrgn, 0, NULL);
rgndata = malloc(size); @@ -675,28 +677,31 @@ static GpStatus alpha_blend_pixels_hrgn(GpGraphics *graphics, INT dst_x, INT dst if (stat != Ok) return stat;
- stat = get_clip_hrgn(graphics, &hrgn); + save = SaveDC(hdc);
- if (stat != Ok) + if (hregion) + ExtSelectClipRgn(hdc, hregion, RGN_COPY); + else { - gdi_dc_release(graphics, hdc); - return stat; - } + stat = get_clip_hrgn(graphics, &hrgn);
- save = SaveDC(hdc); + if (stat != Ok) + { + RestoreDC(hdc, save); + gdi_dc_release(graphics, hdc); + return stat; + }
- ExtSelectClipRgn(hdc, hrgn, RGN_COPY); + ExtSelectClipRgn(hdc, hrgn, RGN_COPY);
- if (hregion) - ExtSelectClipRgn(hdc, hregion, RGN_AND); + DeleteObject(hrgn); + }
stat = alpha_blend_hdc_pixels(graphics, dst_x, dst_y, src, src_width, src_height, src_stride, fmt);
RestoreDC(hdc, save);
- DeleteObject(hrgn); - gdi_dc_release(graphics, hdc);
return stat;