Commit bff1678f authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

gdiplus: Implemented GdipGraphicsClear.

parent f815b8b9
...@@ -403,7 +403,7 @@ ...@@ -403,7 +403,7 @@
@ stub GdipGetVisibleClipBounds @ stub GdipGetVisibleClipBounds
@ stub GdipGetVisibleClipBoundsI @ stub GdipGetVisibleClipBoundsI
@ stdcall GdipGetWorldTransform(ptr ptr) @ stdcall GdipGetWorldTransform(ptr ptr)
@ stub GdipGraphicsClear @ stdcall GdipGraphicsClear(ptr long)
@ stub GdipGraphicsSetAbort @ stub GdipGraphicsSetAbort
@ stub GdipImageForceValidation @ stub GdipImageForceValidation
@ stdcall GdipImageGetFrameCount(ptr ptr ptr) @ stdcall GdipImageGetFrameCount(ptr ptr ptr)
......
...@@ -2538,6 +2538,41 @@ GpStatus WINGDIPAPI GdipGetWorldTransform(GpGraphics *graphics, GpMatrix *matrix ...@@ -2538,6 +2538,41 @@ GpStatus WINGDIPAPI GdipGetWorldTransform(GpGraphics *graphics, GpMatrix *matrix
return Ok; return Ok;
} }
GpStatus WINGDIPAPI GdipGraphicsClear(GpGraphics *graphics, ARGB color)
{
GpSolidFill *brush;
GpStatus stat;
RECT rect;
TRACE("(%p, %x)\n", graphics, color);
if(!graphics)
return InvalidParameter;
if(graphics->busy)
return ObjectBusy;
if((stat = GdipCreateSolidFill(color, &brush)) != Ok)
return stat;
if(graphics->hwnd){
if(!GetWindowRect(graphics->hwnd, &rect)){
GdipDeleteBrush((GpBrush*)brush);
return GenericError;
}
GdipFillRectangle(graphics, (GpBrush*)brush, 0.0, 0.0, (REAL)(rect.right - rect.left),
(REAL)(rect.bottom - rect.top));
}
else
GdipFillRectangle(graphics, (GpBrush*)brush, 0.0, 0.0, (REAL)GetDeviceCaps(graphics->hdc, HORZRES),
(REAL)GetDeviceCaps(graphics->hdc, VERTRES));
GdipDeleteBrush((GpBrush*)brush);
return Ok;
}
GpStatus WINGDIPAPI GdipIsClipEmpty(GpGraphics *graphics, BOOL *res) GpStatus WINGDIPAPI GdipIsClipEmpty(GpGraphics *graphics, BOOL *res)
{ {
TRACE("(%p, %p)\n", graphics, res); TRACE("(%p, %p)\n", graphics, res);
......
...@@ -672,6 +672,8 @@ static void test_Get_Release_DC(void) ...@@ -672,6 +672,8 @@ static void test_Get_Release_DC(void)
expect(ObjectBusy, status); status = Ok; expect(ObjectBusy, status); status = Ok;
status = GdipGetWorldTransform(graphics, m); status = GdipGetWorldTransform(graphics, m);
expect(ObjectBusy, status); status = Ok; expect(ObjectBusy, status); status = Ok;
status = GdipGraphicsClear(graphics, 0xdeadbeef);
expect(ObjectBusy, status); status = Ok;
/* GdipMeasureCharacterRanges */ /* GdipMeasureCharacterRanges */
/* GdipMeasureString */ /* GdipMeasureString */
status = GdipResetClip(graphics); status = GdipResetClip(graphics);
...@@ -878,6 +880,14 @@ static void test_isempty(void) ...@@ -878,6 +880,14 @@ static void test_isempty(void)
ReleaseDC(0, hdc); ReleaseDC(0, hdc);
} }
static void test_clear(void)
{
GpStatus status;
status = GdipGraphicsClear(NULL, 0xdeadbeef);
expect(InvalidParameter, status);
}
START_TEST(graphics) START_TEST(graphics)
{ {
struct GdiplusStartupInput gdiplusStartupInput; struct GdiplusStartupInput gdiplusStartupInput;
...@@ -901,6 +911,7 @@ START_TEST(graphics) ...@@ -901,6 +911,7 @@ START_TEST(graphics)
test_transformpoints(); test_transformpoints();
test_get_set_clip(); test_get_set_clip();
test_isempty(); test_isempty();
test_clear();
GdiplusShutdown(gdiplusToken); GdiplusShutdown(gdiplusToken);
} }
...@@ -169,6 +169,7 @@ GpStatus WINGDIPAPI GdipGetPixelOffsetMode(GpGraphics*,PixelOffsetMode*); ...@@ -169,6 +169,7 @@ GpStatus WINGDIPAPI GdipGetPixelOffsetMode(GpGraphics*,PixelOffsetMode*);
GpStatus WINGDIPAPI GdipGetSmoothingMode(GpGraphics*,SmoothingMode*); GpStatus WINGDIPAPI GdipGetSmoothingMode(GpGraphics*,SmoothingMode*);
GpStatus WINGDIPAPI GdipGetTextRenderingHint(GpGraphics*,TextRenderingHint*); GpStatus WINGDIPAPI GdipGetTextRenderingHint(GpGraphics*,TextRenderingHint*);
GpStatus WINGDIPAPI GdipGetWorldTransform(GpGraphics*,GpMatrix*); GpStatus WINGDIPAPI GdipGetWorldTransform(GpGraphics*,GpMatrix*);
GpStatus WINGDIPAPI GdipGraphicsClear(GpGraphics*,ARGB);
GpStatus WINGDIPAPI GdipMeasureString(GpGraphics*,GDIPCONST WCHAR*,INT, GpStatus WINGDIPAPI GdipMeasureString(GpGraphics*,GDIPCONST WCHAR*,INT,
GDIPCONST GpFont*,GDIPCONST RectF*,GDIPCONST GpStringFormat*,RectF*,INT*,INT*); GDIPCONST GpFont*,GDIPCONST RectF*,GDIPCONST GpStringFormat*,RectF*,INT*,INT*);
GpStatus WINGDIPAPI GdipMeasureCharacterRanges(GpGraphics*, GDIPCONST WCHAR*, GpStatus WINGDIPAPI GdipMeasureCharacterRanges(GpGraphics*, GDIPCONST WCHAR*,
......
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