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

gdiplus: Implemented GdipResetClip with tests.

parent 698e8727
......@@ -474,7 +474,7 @@
@ stub GdipRecordMetafileStreamI
@ stdcall GdipReleaseDC(ptr ptr)
@ stdcall GdipRemovePropertyItem(ptr long)
@ stub GdipResetClip
@ stdcall GdipResetClip(ptr)
@ stub GdipResetImageAttributes
@ stub GdipResetLineTransform
@ stub GdipResetPageTransform
......
......@@ -2514,6 +2514,17 @@ GpStatus WINGDIPAPI GdipMeasureString(GpGraphics *graphics,
return Ok;
}
GpStatus WINGDIPAPI GdipResetClip(GpGraphics *graphics)
{
if(!graphics)
return InvalidParameter;
if(graphics->busy)
return ObjectBusy;
return GdipSetInfinite(graphics->clip);
}
GpStatus WINGDIPAPI GdipResetWorldTransform(GpGraphics *graphics)
{
if(!graphics)
......
......@@ -674,6 +674,8 @@ static void test_Get_Release_DC(void)
expect(ObjectBusy, status); status = Ok;
/* GdipMeasureCharacterRanges */
/* GdipMeasureString */
status = GdipResetClip(graphics);
expect(ObjectBusy, status); status = Ok;
status = GdipResetWorldTransform(graphics);
expect(ObjectBusy, status); status = Ok;
/* GdipRestoreGraphics */
......@@ -805,6 +807,37 @@ static void test_get_set_clip(void)
expect(Ok, status);
expect(TRUE, res);
/* remains infinite after reset */
res = FALSE;
status = GdipResetClip(graphics);
expect(Ok, status);
status = GdipGetClip(graphics, clip);
expect(Ok, status);
status = GdipIsInfiniteRegion(clip, graphics, &res);
expect(Ok, status);
expect(TRUE, res);
/* set to empty and then reset to infinite */
status = GdipSetEmpty(clip);
expect(Ok, status);
status = GdipSetClipRegion(graphics, clip, CombineModeReplace);
expect(Ok, status);
status = GdipGetClip(graphics, clip);
expect(Ok, status);
res = FALSE;
status = GdipIsEmptyRegion(clip, graphics, &res);
expect(Ok, status);
expect(TRUE, res);
status = GdipResetClip(graphics);
expect(Ok, status);
status = GdipGetClip(graphics, clip);
expect(Ok, status);
res = FALSE;
status = GdipIsInfiniteRegion(clip, graphics, &res);
expect(Ok, status);
expect(TRUE, res);
GdipDeleteRegion(clip);
GdipDeleteGraphics(graphics);
......
......@@ -157,6 +157,7 @@ GpStatus WINGDIPAPI GdipFillRectanglesI(GpGraphics*,GpBrush*,GDIPCONST GpRect*,I
GpStatus WINGDIPAPI GdipGetCompositingMode(GpGraphics*,CompositingMode*);
GpStatus WINGDIPAPI GdipGetClip(GpGraphics*,GpRegion*);
GpStatus WINGDIPAPI GdipSetClipRegion(GpGraphics*,GpRegion*,CombineMode);
GpStatus WINGDIPAPI GdipResetClip(GpGraphics*);
GpStatus WINGDIPAPI GdipGetCompositingQuality(GpGraphics*,CompositingQuality*);
GpStatus WINGDIPAPI GdipGetDC(GpGraphics*,HDC*);
GpStatus WINGDIPAPI GdipGetImageDimension(GpImage*,REAL*,REAL*);
......
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