Module: wine Branch: master Commit: 8c5bcef9f3e5082f00387e49be7f6a56d6557ff6 URL: http://source.winehq.org/git/wine.git/?a=commit;h=8c5bcef9f3e5082f00387e49be...
Author: Evan Stade estade@gmail.com Date: Fri Jul 20 17:50:02 2007 -0700
gdiplus: Added rendering of fill-path type custom line caps.
---
dlls/gdiplus/customlinecap.c | 7 +++++++ dlls/gdiplus/graphics.c | 20 ++++++++++++-------- 2 files changed, 19 insertions(+), 8 deletions(-)
diff --git a/dlls/gdiplus/customlinecap.c b/dlls/gdiplus/customlinecap.c index 76e2c1d..aadea5f 100644 --- a/dlls/gdiplus/customlinecap.c +++ b/dlls/gdiplus/customlinecap.c @@ -23,6 +23,9 @@
#include "gdiplus.h" #include "gdiplus_private.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(gdiplus);
GpStatus WINGDIPAPI GdipCloneCustomLineCap(GpCustomLineCap* from, GpCustomLineCap** to) @@ -52,11 +55,15 @@ GpStatus WINGDIPAPI GdipCloneCustomLineCap(GpCustomLineCap* from, return Ok; }
+/* FIXME: Sometimes when fillPath is non-null and stroke path is null, the native + * version of this function returns NotImplemented. I cannot figure out why. */ GpStatus WINGDIPAPI GdipCreateCustomLineCap(GpPath* fillPath, GpPath* strokePath, GpLineCap baseCap, REAL baseInset, GpCustomLineCap **customCap) { GpPathData *pathdata;
+ TRACE("%p %p %d %f %p\n", fillPath, strokePath, baseCap, baseInset, customCap); + if(!customCap || !(fillPath || strokePath)) return InvalidParameter;
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 4a581d1..a7383ab 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -130,7 +130,8 @@ static void calc_curve_bezier_endp(REAL xend, REAL yend, REAL xadj, REAL yadj, }
/* Draws the linecap the specified color and size on the hdc. The linecap is in - * direction of the line from x1, y1 to x2, y2 and is anchored on x2, y2. */ + * direction of the line from x1, y1 to x2, y2 and is anchored on x2, y2. Probably + * should not be called on an hdc that has a path you care about. */ static void draw_cap(HDC hdc, COLORREF color, GpLineCap cap, REAL size, const GpCustomLineCap *custom, REAL x1, REAL y1, REAL x2, REAL y2) { @@ -158,7 +159,8 @@ static void draw_cap(HDC hdc, COLORREF color, GpLineCap cap, REAL size, lb.lbColor = color; lb.lbHatch = 0; pen = ExtCreatePen(PS_GEOMETRIC | PS_SOLID | PS_ENDCAP_FLAT, - (cap == LineCapCustom ? size : 1), &lb, 0, NULL); + ((cap == LineCapCustom) && custom && (custom->fill)) ? size : 1, + &lb, 0, NULL); oldbrush = SelectObject(hdc, brush); oldpen = SelectObject(hdc, pen);
@@ -267,11 +269,6 @@ static void draw_cap(HDC hdc, COLORREF color, GpLineCap cap, REAL size, if(!custom) break;
- if(custom->fill){ - FIXME("fill-path custom line caps not implemented\n"); - break; - } - count = custom->pathdata.Count; custptf = GdipAlloc(count * sizeof(PointF)); custpt = GdipAlloc(count * sizeof(POINT)); @@ -294,7 +291,14 @@ static void draw_cap(HDC hdc, COLORREF color, GpLineCap cap, REAL size, tp[i] = convert_path_point_type(custom->pathdata.Types[i]); }
- PolyDraw(hdc, custpt, tp, count); + if(custom->fill){ + BeginPath(hdc); + PolyDraw(hdc, custpt, tp, count); + EndPath(hdc); + StrokeAndFillPath(hdc); + } + else + PolyDraw(hdc, custpt, tp, count);
custend: GdipFree(custptf);