Evan Stade : gdiplus: Added GdipFillPolygon.
Alexandre Julliard
julliard at wine.codeweavers.com
Thu Aug 2 06:23:08 CDT 2007
Module: wine
Branch: master
Commit: 1ef7793b51339d37c3f695faa9e90576e8ff5d2b
URL: http://source.winehq.org/git/wine.git/?a=commit;h=1ef7793b51339d37c3f695faa9e90576e8ff5d2b
Author: Evan Stade <estade at gmail.com>
Date: Wed Aug 1 17:55:50 2007 -0700
gdiplus: Added GdipFillPolygon.
---
dlls/gdiplus/gdiplus.spec | 2 +-
dlls/gdiplus/graphics.c | 39 +++++++++++++++++++++++++++++++++++++++
include/gdiplusflat.h | 2 ++
3 files changed, 42 insertions(+), 1 deletions(-)
diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec
index 81ff0ae..0087aef 100644
--- a/dlls/gdiplus/gdiplus.spec
+++ b/dlls/gdiplus/gdiplus.spec
@@ -224,7 +224,7 @@
@ stub GdipFillPieI
@ stub GdipFillPolygon2
@ stub GdipFillPolygon2I
-@ stub GdipFillPolygon
+@ stdcall GdipFillPolygon(ptr ptr ptr long long)
@ stdcall GdipFillPolygonI(ptr ptr ptr long long)
@ stub GdipFillRectangle
@ stub GdipFillRectangleI
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index 2be9fc7..7c8fc16 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -1224,6 +1224,45 @@ GpStatus WINGDIPAPI GdipFillPie(GpGraphics *graphics, GpBrush *brush, REAL x,
return Ok;
}
+GpStatus WINGDIPAPI GdipFillPolygon(GpGraphics *graphics, GpBrush *brush,
+ GDIPCONST GpPointF *points, INT count, GpFillMode fillMode)
+{
+ INT save_state;
+ GpPointF *ptf = NULL;
+ POINT *pti = NULL;
+ GpStatus retval = Ok;
+
+ if(!graphics || !brush || !points || !count)
+ return InvalidParameter;
+
+ ptf = GdipAlloc(count * sizeof(GpPointF));
+ pti = GdipAlloc(count * sizeof(POINT));
+ if(!ptf || !pti){
+ retval = OutOfMemory;
+ goto end;
+ }
+
+ memcpy(ptf, points, count * sizeof(GpPointF));
+
+ save_state = SaveDC(graphics->hdc);
+ EndPath(graphics->hdc);
+ SelectObject(graphics->hdc, brush->gdibrush);
+ SelectObject(graphics->hdc, GetStockObject(NULL_PEN));
+ SetPolyFillMode(graphics->hdc, (fillMode == FillModeAlternate ? ALTERNATE
+ : WINDING));
+
+ transform_and_round_points(graphics, pti, ptf, count);
+ Polygon(graphics->hdc, pti, count);
+
+ RestoreDC(graphics->hdc, save_state);
+
+end:
+ GdipFree(ptf);
+ GdipFree(pti);
+
+ return retval;
+}
+
GpStatus WINGDIPAPI GdipFillPolygonI(GpGraphics *graphics, GpBrush *brush,
GDIPCONST GpPoint *points, INT count, GpFillMode fillMode)
{
diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h
index 045c17b..cd4f3d6 100644
--- a/include/gdiplusflat.h
+++ b/include/gdiplusflat.h
@@ -102,6 +102,8 @@ GpStatus WINGDIPAPI GdipClosePathFigure(GpPath*);
GpStatus WINGDIPAPI GdipClosePathFigures(GpPath*);
GpStatus WINGDIPAPI GdipCreatePath(GpFillMode,GpPath**);
GpStatus WINGDIPAPI GdipDeletePath(GpPath*);
+GpStatus WINGDIPAPI GdipFillPolygon(GpGraphics*,GpBrush*,GDIPCONST GpPointF*,
+ INT,GpFillMode);
GpStatus WINGDIPAPI GdipGetPathFillMode(GpPath*,GpFillMode*);
GpStatus WINGDIPAPI GdipGetPathPoints(GpPath*,GpPointF*,INT);
GpStatus WINGDIPAPI GdipGetPathTypes(GpPath*,BYTE*,INT);
More information about the wine-cvs
mailing list