diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 87dc7473531..94123faca16 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -414,7 +414,7 @@ @ stub GdipImageSetAbort @ stub GdipInitializePalette @ stdcall GdipInvertMatrix(ptr) -@ stub GdipIsClipEmpty +@ stdcall GdipIsClipEmpty(ptr ptr) @ stdcall GdipIsEmptyRegion(ptr ptr ptr) @ stdcall GdipIsEqualRegion(ptr ptr ptr ptr) @ stdcall GdipIsInfiniteRegion(ptr ptr ptr) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index bcfe70f6e5e..d91d825b3db 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -2392,6 +2392,14 @@ GpStatus WINGDIPAPI GdipGetWorldTransform(GpGraphics *graphics, GpMatrix *matrix return Ok; } +GpStatus WINGDIPAPI GdipIsClipEmpty(GpGraphics *graphics, BOOL *res) +{ + if(!graphics || !res) + return InvalidParameter; + + return GdipIsEmptyRegion(graphics->clip, graphics, res); +} + GpStatus WINGDIPAPI GdipMeasureCharacterRanges(GpGraphics* graphics, GDIPCONST WCHAR* string, INT length, GDIPCONST GpFont* font, GDIPCONST RectF* layoutRect, GDIPCONST GpStringFormat *stringFormat, diff --git a/dlls/gdiplus/tests/graphics.c b/dlls/gdiplus/tests/graphics.c index 8bd76d1dcce..b0858e1eb6c 100644 --- a/dlls/gdiplus/tests/graphics.c +++ b/dlls/gdiplus/tests/graphics.c @@ -844,6 +844,40 @@ static void test_get_set_clip(void) ReleaseDC(0, hdc); } +static void test_isempty(void) +{ + GpStatus status; + GpGraphics *graphics = NULL; + HDC hdc = GetDC(0); + GpRegion *clip; + BOOL res; + + status = GdipCreateFromHDC(hdc, &graphics); + expect(Ok, status); + + status = GdipCreateRegion(&clip); + expect(Ok, status); + + /* NULL */ + status = GdipIsClipEmpty(NULL, NULL); + expect(InvalidParameter, status); + status = GdipIsClipEmpty(graphics, NULL); + expect(InvalidParameter, status); + status = GdipIsClipEmpty(NULL, &res); + expect(InvalidParameter, status); + + /* default is infinite */ + res = TRUE; + status = GdipIsClipEmpty(graphics, &res); + expect(Ok, status); + expect(FALSE, res); + + GdipDeleteRegion(clip); + + GdipDeleteGraphics(graphics); + ReleaseDC(0, hdc); +} + START_TEST(graphics) { struct GdiplusStartupInput gdiplusStartupInput; @@ -866,6 +900,7 @@ START_TEST(graphics) test_Get_Release_DC(); test_transformpoints(); test_get_set_clip(); + test_isempty(); GdiplusShutdown(gdiplusToken); } diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index d9b70b2a57e..0b4a67f6b52 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -158,6 +158,7 @@ GpStatus WINGDIPAPI GdipGetCompositingMode(GpGraphics*,CompositingMode*); GpStatus WINGDIPAPI GdipGetClip(GpGraphics*,GpRegion*); GpStatus WINGDIPAPI GdipSetClipRegion(GpGraphics*,GpRegion*,CombineMode); GpStatus WINGDIPAPI GdipResetClip(GpGraphics*); +GpStatus WINGDIPAPI GdipIsClipEmpty(GpGraphics*, BOOL*); GpStatus WINGDIPAPI GdipGetCompositingQuality(GpGraphics*,CompositingQuality*); GpStatus WINGDIPAPI GdipGetDC(GpGraphics*,HDC*); GpStatus WINGDIPAPI GdipGetImageDimension(GpImage*,REAL*,REAL*);