Commit f18cdef7 authored by Evan Stade's avatar Evan Stade Committed by Alexandre Julliard

gdiplus: Added solid-color path gradient brush implementation.

parent 5e29e37a
...@@ -23,6 +23,9 @@ ...@@ -23,6 +23,9 @@
#include "gdiplus.h" #include "gdiplus.h"
#include "gdiplus_private.h" #include "gdiplus_private.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(gdiplus);
GpStatus WINGDIPAPI GdipCloneBrush(GpBrush *brush, GpBrush **clone) GpStatus WINGDIPAPI GdipCloneBrush(GpBrush *brush, GpBrush **clone)
{ {
...@@ -45,6 +48,29 @@ GpStatus WINGDIPAPI GdipCloneBrush(GpBrush *brush, GpBrush **clone) ...@@ -45,6 +48,29 @@ GpStatus WINGDIPAPI GdipCloneBrush(GpBrush *brush, GpBrush **clone)
return Ok; return Ok;
} }
/* FIXME: path gradient brushes not truly supported (drawn as solid brushes) */
GpStatus WINGDIPAPI GdipCreatePathGradientFromPath(GDIPCONST GpPath* path,
GpPathGradient **grad)
{
COLORREF col = ARGB2COLORREF(0xffffffff);
if(!path || !grad)
return InvalidParameter;
*grad = GdipAlloc(sizeof(GpPathGradient));
if (!*grad) return OutOfMemory;
(*grad)->brush.lb.lbStyle = BS_SOLID;
(*grad)->brush.lb.lbColor = col;
(*grad)->brush.lb.lbHatch = 0;
(*grad)->brush.gdibrush = CreateSolidBrush(col);
(*grad)->brush.bt = BrushTypeSolidColor;
(*grad)->centercolor = 0xffffffff;
return Ok;
}
GpStatus WINGDIPAPI GdipCreateSolidFill(ARGB color, GpSolidFill **sf) GpStatus WINGDIPAPI GdipCreateSolidFill(ARGB color, GpSolidFill **sf)
{ {
COLORREF col = ARGB2COLORREF(color); COLORREF col = ARGB2COLORREF(color);
......
...@@ -117,7 +117,7 @@ ...@@ -117,7 +117,7 @@
@ stub GdipCreatePath2I @ stub GdipCreatePath2I
@ stdcall GdipCreatePath(long ptr) @ stdcall GdipCreatePath(long ptr)
@ stub GdipCreatePathGradient @ stub GdipCreatePathGradient
@ stub GdipCreatePathGradientFromPath @ stdcall GdipCreatePathGradientFromPath(ptr ptr)
@ stub GdipCreatePathGradientI @ stub GdipCreatePathGradientI
@ stdcall GdipCreatePathIter(ptr ptr) @ stdcall GdipCreatePathIter(ptr ptr)
@ stdcall GdipCreatePen1(long long long ptr) @ stdcall GdipCreatePen1(long long long ptr)
......
...@@ -92,6 +92,11 @@ struct GpSolidFill{ ...@@ -92,6 +92,11 @@ struct GpSolidFill{
ARGB color; ARGB color;
}; };
struct GpPathGradient{
GpBrush brush;
ARGB centercolor;
};
struct GpPath{ struct GpPath{
GpFillMode fill; GpFillMode fill;
GpPathData pathdata; GpPathData pathdata;
......
...@@ -88,6 +88,8 @@ GpStatus WINGDIPAPI GdipSetSmoothingMode(GpGraphics*,SmoothingMode); ...@@ -88,6 +88,8 @@ GpStatus WINGDIPAPI GdipSetSmoothingMode(GpGraphics*,SmoothingMode);
GpStatus WINGDIPAPI GdipSetWorldTransform(GpGraphics*,GpMatrix*); GpStatus WINGDIPAPI GdipSetWorldTransform(GpGraphics*,GpMatrix*);
GpStatus WINGDIPAPI GdipCloneBrush(GpBrush*,GpBrush**); GpStatus WINGDIPAPI GdipCloneBrush(GpBrush*,GpBrush**);
GpStatus WINGDIPAPI GdipCreatePathGradientFromPath(GDIPCONST GpPath*,
GpPathGradient**);
GpStatus WINGDIPAPI GdipCreateSolidFill(ARGB,GpSolidFill**); GpStatus WINGDIPAPI GdipCreateSolidFill(ARGB,GpSolidFill**);
GpStatus WINGDIPAPI GdipGetBrushType(GpBrush*,GpBrushType*); GpStatus WINGDIPAPI GdipGetBrushType(GpBrush*,GpBrushType*);
GpStatus WINGDIPAPI GdipDeleteBrush(GpBrush*); GpStatus WINGDIPAPI GdipDeleteBrush(GpBrush*);
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
class GpGraphics {}; class GpGraphics {};
class GpGraphics {}; class GpGraphics {};
class GpBrush {}; class GpBrush {};
class GpSolidFill {}; class GpSolidFill : public GpBrush {};
class GpPath {}; class GpPath {};
class GpMatrix {}; class GpMatrix {};
class GpPathIterator {}; class GpPathIterator {};
...@@ -33,6 +33,7 @@ class GpImage {}; ...@@ -33,6 +33,7 @@ class GpImage {};
class GpMetafile : public GpImage {}; class GpMetafile : public GpImage {};
class GpImageAttributes {}; class GpImageAttributes {};
class GpBitmap : public GpImage {}; class GpBitmap : public GpImage {};
class GpPathGradient : public GpBrush {};
#else /* end of c++ declarations */ #else /* end of c++ declarations */
...@@ -48,6 +49,7 @@ typedef struct GpImage GpImage; ...@@ -48,6 +49,7 @@ typedef struct GpImage GpImage;
typedef struct GpMetafile GpMetafile; typedef struct GpMetafile GpMetafile;
typedef struct GpImageAttributes GpImageAttributes; typedef struct GpImageAttributes GpImageAttributes;
typedef struct GpBitmap GpBitmap; typedef struct GpBitmap GpBitmap;
typedef struct GpPathGradient GpPathGradient;
#endif /* end of c declarations */ #endif /* end of c declarations */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment