gdiplus: Added solid-color path gradient brush implementation.

This commit is contained in:
Evan Stade 2007-08-01 17:56:02 -07:00 committed by Alexandre Julliard
parent 5e29e37af5
commit f18cdef727
5 changed files with 37 additions and 2 deletions

View file

@ -23,6 +23,9 @@
#include "gdiplus.h"
#include "gdiplus_private.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(gdiplus);
GpStatus WINGDIPAPI GdipCloneBrush(GpBrush *brush, GpBrush **clone)
{
@ -45,6 +48,29 @@ GpStatus WINGDIPAPI GdipCloneBrush(GpBrush *brush, GpBrush **clone)
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)
{
COLORREF col = ARGB2COLORREF(color);

View file

@ -117,7 +117,7 @@
@ stub GdipCreatePath2I
@ stdcall GdipCreatePath(long ptr)
@ stub GdipCreatePathGradient
@ stub GdipCreatePathGradientFromPath
@ stdcall GdipCreatePathGradientFromPath(ptr ptr)
@ stub GdipCreatePathGradientI
@ stdcall GdipCreatePathIter(ptr ptr)
@ stdcall GdipCreatePen1(long long long ptr)

View file

@ -92,6 +92,11 @@ struct GpSolidFill{
ARGB color;
};
struct GpPathGradient{
GpBrush brush;
ARGB centercolor;
};
struct GpPath{
GpFillMode fill;
GpPathData pathdata;

View file

@ -88,6 +88,8 @@ GpStatus WINGDIPAPI GdipSetSmoothingMode(GpGraphics*,SmoothingMode);
GpStatus WINGDIPAPI GdipSetWorldTransform(GpGraphics*,GpMatrix*);
GpStatus WINGDIPAPI GdipCloneBrush(GpBrush*,GpBrush**);
GpStatus WINGDIPAPI GdipCreatePathGradientFromPath(GDIPCONST GpPath*,
GpPathGradient**);
GpStatus WINGDIPAPI GdipCreateSolidFill(ARGB,GpSolidFill**);
GpStatus WINGDIPAPI GdipGetBrushType(GpBrush*,GpBrushType*);
GpStatus WINGDIPAPI GdipDeleteBrush(GpBrush*);

View file

@ -24,7 +24,7 @@
class GpGraphics {};
class GpGraphics {};
class GpBrush {};
class GpSolidFill {};
class GpSolidFill : public GpBrush {};
class GpPath {};
class GpMatrix {};
class GpPathIterator {};
@ -33,6 +33,7 @@ class GpImage {};
class GpMetafile : public GpImage {};
class GpImageAttributes {};
class GpBitmap : public GpImage {};
class GpPathGradient : public GpBrush {};
#else /* end of c++ declarations */
@ -48,6 +49,7 @@ typedef struct GpImage GpImage;
typedef struct GpMetafile GpMetafile;
typedef struct GpImageAttributes GpImageAttributes;
typedef struct GpBitmap GpBitmap;
typedef struct GpPathGradient GpPathGradient;
#endif /* end of c declarations */