Vincent Povirk : gdiplus: Transform clipping region to gdi device coordinates.
Alexandre Julliard
julliard at winehq.org
Wed Aug 30 16:03:46 CDT 2017
Module: wine
Branch: master
Commit: 016dc76ab22f14c6f9a1c04fcc1fd494bddebe62
URL: http://source.winehq.org/git/wine.git/?a=commit;h=016dc76ab22f14c6f9a1c04fcc1fd494bddebe62
Author: Vincent Povirk <vincent at codeweavers.com>
Date: Wed Aug 30 12:32:14 2017 -0500
gdiplus: Transform clipping region to gdi device coordinates.
Signed-off-by: Vincent Povirk <vincent at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/gdiplus/graphics.c | 22 ++++++++++++++++++++--
dlls/gdiplus/tests/graphics.c | 2 +-
2 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index a250678..3dbb457 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -348,8 +348,26 @@ static void gdi_alpha_blend(GpGraphics *graphics, INT dst_x, INT dst_y, INT dst_
static GpStatus get_clip_hrgn(GpGraphics *graphics, HRGN *hrgn)
{
- /* clipping region is in device coords */
- return GdipGetRegionHRgn(graphics->clip, NULL, hrgn);
+ GpRegion *rgn;
+ GpMatrix transform;
+ GpStatus stat;
+
+ stat = get_graphics_transform(graphics, WineCoordinateSpaceGdiDevice, CoordinateSpaceDevice, &transform);
+
+ if (stat == Ok)
+ stat = GdipCloneRegion(graphics->clip, &rgn);
+
+ if (stat == Ok)
+ {
+ stat = GdipTransformRegion(rgn, &transform);
+
+ if (stat == Ok)
+ stat = GdipGetRegionHRgn(rgn, NULL, hrgn);
+
+ GdipDeleteRegion(rgn);
+ }
+
+ return stat;
}
/* Draw ARGB data to the given graphics object */
diff --git a/dlls/gdiplus/tests/graphics.c b/dlls/gdiplus/tests/graphics.c
index 04e2f50..540fdfd 100644
--- a/dlls/gdiplus/tests/graphics.c
+++ b/dlls/gdiplus/tests/graphics.c
@@ -6276,7 +6276,7 @@ static void test_GdipFillRectanglesOnMemoryDCSolidBrush(void)
color[5] = get_bitmap_pixel(width-1, height/2-1);
}
- todo_wine ok(is_blue_color(color[0]) && is_blue_color(color[1]) && is_blue_color(color[2]) &&
+ ok(is_blue_color(color[0]) && is_blue_color(color[1]) && is_blue_color(color[2]) &&
color[3] == 0 && color[4] == 0 && color[5] == 0,
"Expected GdipFillRectangleI take effect!\n" );
ReleaseBitmapPixelBuffer(pixel);
More information about the wine-cvs
mailing list