Commit 8b2ce0f9 authored by Evan Stade's avatar Evan Stade Committed by Alexandre Julliard

gdiplus: Implemented GdipSetSolidFillColor/GdipGetSolidFillColor.

parent 777d661f
...@@ -26,12 +26,18 @@ GpStatus WINGDIPAPI GdipCloneBrush(GpBrush *brush, GpBrush **clone) ...@@ -26,12 +26,18 @@ GpStatus WINGDIPAPI GdipCloneBrush(GpBrush *brush, GpBrush **clone)
if(!brush || !clone) if(!brush || !clone)
return InvalidParameter; return InvalidParameter;
*clone = GdipAlloc(sizeof(GpBrush)); switch(brush->bt){
if (!*clone) return OutOfMemory; case BrushTypeSolidColor:
*clone = GdipAlloc(sizeof(GpSolidFill));
if (!*clone) return OutOfMemory;
memcpy(*clone, brush, sizeof(GpBrush)); memcpy(*clone, brush, sizeof(GpSolidFill));
(*clone)->gdibrush = CreateBrushIndirect(&(*clone)->lb); (*clone)->gdibrush = CreateBrushIndirect(&(*clone)->lb);
break;
default:
return NotImplemented;
}
return Ok; return Ok;
} }
...@@ -51,7 +57,7 @@ GpStatus WINGDIPAPI GdipCreateSolidFill(ARGB color, GpSolidFill **sf) ...@@ -51,7 +57,7 @@ GpStatus WINGDIPAPI GdipCreateSolidFill(ARGB color, GpSolidFill **sf)
(*sf)->brush.gdibrush = CreateSolidBrush(col); (*sf)->brush.gdibrush = CreateSolidBrush(col);
(*sf)->brush.bt = BrushTypeSolidColor; (*sf)->brush.bt = BrushTypeSolidColor;
(*sf)->brush.color = col; (*sf)->color = color;
return Ok; return Ok;
} }
...@@ -80,7 +86,9 @@ GpStatus WINGDIPAPI GdipGetSolidFillColor(GpSolidFill *sf, ARGB *argb) ...@@ -80,7 +86,9 @@ GpStatus WINGDIPAPI GdipGetSolidFillColor(GpSolidFill *sf, ARGB *argb)
if(!sf || !argb) if(!sf || !argb)
return InvalidParameter; return InvalidParameter;
return NotImplemented; *argb = sf->color;
return Ok;
} }
GpStatus WINGDIPAPI GdipSetSolidFillColor(GpSolidFill *sf, ARGB argb) GpStatus WINGDIPAPI GdipSetSolidFillColor(GpSolidFill *sf, ARGB argb)
...@@ -88,5 +96,11 @@ GpStatus WINGDIPAPI GdipSetSolidFillColor(GpSolidFill *sf, ARGB argb) ...@@ -88,5 +96,11 @@ GpStatus WINGDIPAPI GdipSetSolidFillColor(GpSolidFill *sf, ARGB argb)
if(!sf) if(!sf)
return InvalidParameter; return InvalidParameter;
return NotImplemented; sf->color = argb;
sf->brush.lb.lbColor = ARGB2COLORREF(argb);
DeleteObject(sf->brush.gdibrush);
sf->brush.gdibrush = CreateSolidBrush(sf->brush.lb.lbColor);
return Ok;
} }
...@@ -71,12 +71,12 @@ struct GpGraphics{ ...@@ -71,12 +71,12 @@ struct GpGraphics{
struct GpBrush{ struct GpBrush{
HBRUSH gdibrush; HBRUSH gdibrush;
GpBrushType bt; GpBrushType bt;
COLORREF color;
LOGBRUSH lb; LOGBRUSH lb;
}; };
struct GpSolidFill{ struct GpSolidFill{
GpBrush brush; GpBrush brush;
ARGB color;
}; };
struct GpPath{ struct GpPath{
......
...@@ -107,8 +107,7 @@ static void test_brushfill(void) ...@@ -107,8 +107,7 @@ static void test_brushfill(void)
GdipGetPenBrushFill(pen, &brush2); GdipGetPenBrushFill(pen, &brush2);
ok(brush != brush2, "Expected to get a clone, not a copy of the reference\n"); ok(brush != brush2, "Expected to get a clone, not a copy of the reference\n");
GdipGetSolidFillColor((GpSolidFill*)brush2, &color); GdipGetSolidFillColor((GpSolidFill*)brush2, &color);
todo_wine expect(0xabaddeed, color);
expect(0xabaddeed, color);
GdipDeleteBrush(brush); GdipDeleteBrush(brush);
GdipDeleteBrush(brush2); GdipDeleteBrush(brush2);
......
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