Vincent Povirk : gdiplus: Reimplement GdipDrawPolygon based on GdipDrawPath.

Alexandre Julliard julliard at winehq.org
Wed Oct 19 20:47:57 CDT 2016


Module: wine
Branch: master
Commit: 6920cf68e6367f3d201de7cc3bee3a2842ca93f0
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=6920cf68e6367f3d201de7cc3bee3a2842ca93f0

Author: Vincent Povirk <vincent at codeweavers.com>
Date:   Wed Oct 19 10:03:05 2016 -0500

gdiplus: Reimplement GdipDrawPolygon based on GdipDrawPath.

Signed-off-by: Vincent Povirk <vincent at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/gdiplus/graphics.c | 26 +++++++++-----------------
 1 file changed, 9 insertions(+), 17 deletions(-)

diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index 324c06f..f9a6f3e 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -6164,8 +6164,8 @@ GpStatus WINGDIPAPI GdipSetClipRegion(GpGraphics *graphics, GpRegion *region,
 GpStatus WINGDIPAPI GdipDrawPolygon(GpGraphics *graphics,GpPen *pen,GDIPCONST GpPointF *points,
     INT count)
 {
-    INT save_state;
-    POINT *pti;
+    GpStatus status;
+    GpPath* path;
 
     TRACE("(%p, %p, %d)\n", graphics, points, count);
 
@@ -6175,24 +6175,16 @@ GpStatus WINGDIPAPI GdipDrawPolygon(GpGraphics *graphics,GpPen *pen,GDIPCONST Gp
     if(graphics->busy)
         return ObjectBusy;
 
-    if (!graphics->hdc)
-    {
-        FIXME("graphics object has no HDC\n");
-        return Ok;
-    }
-
-    pti = heap_alloc_zero(sizeof(POINT) * count);
-
-    save_state = prepare_dc(graphics, pen);
-    SelectObject(graphics->hdc, GetStockObject(NULL_BRUSH));
+    status = GdipCreatePath(FillModeAlternate, &path);
+    if (status != Ok) return status;
 
-    transform_and_round_points(graphics, pti, (GpPointF*)points, count);
-    Polygon(graphics->hdc, pti, count);
+    status = GdipAddPathPolygon(path, points, count);
+    if (status == Ok)
+        status = GdipDrawPath(graphics, pen, path);
 
-    restore_dc(graphics, save_state);
-    heap_free(pti);
+    GdipDeletePath(path);
 
-    return Ok;
+    return status;
 }
 
 GpStatus WINGDIPAPI GdipDrawPolygonI(GpGraphics *graphics,GpPen *pen,GDIPCONST GpPoint *points,




More information about the wine-cvs mailing list