Commit 8d9c4867 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

gdiplus: Implemented GdipSetClipRect/GdipSetClipRectI.

parent 31847cf3
......@@ -509,7 +509,7 @@
@ stub GdipSetClipGraphics
@ stub GdipSetClipHrgn
@ stub GdipSetClipPath
@ stub GdipSetClipRect
@ stdcall GdipSetClipRect(ptr long long long long long)
@ stdcall GdipSetClipRectI(ptr long long long long long)
@ stdcall GdipSetClipRegion(ptr ptr long)
@ stdcall GdipSetCompositingMode(ptr long)
......
......@@ -2948,11 +2948,33 @@ GpStatus WINGDIPAPI GdipTranslateWorldTransform(GpGraphics *graphics, REAL dx,
return GdipTranslateMatrix(graphics->worldtrans, dx, dy, order);
}
GpStatus WINGDIPAPI GdipSetClipRect(GpGraphics *graphics, REAL x, REAL y,
REAL width, REAL height,
CombineMode mode)
{
GpRectF rect;
TRACE("(%p, %.2f, %.2f, %.2f, %.2f, %d)\n", graphics, x, y, width, height, mode);
if(!graphics)
return InvalidParameter;
if(graphics->busy)
return ObjectBusy;
rect.X = x;
rect.Y = y;
rect.Width = width;
rect.Height = height;
return GdipCombineRegionRect(graphics->clip, &rect, mode);
}
GpStatus WINGDIPAPI GdipSetClipRectI(GpGraphics *graphics, INT x, INT y,
INT width, INT height,
CombineMode combineMode)
CombineMode mode)
{
static int calls;
TRACE("(%p, %d, %d, %d, %d, %d)\n", graphics, x, y, width, height, mode);
if(!graphics)
return InvalidParameter;
......@@ -2960,10 +2982,7 @@ GpStatus WINGDIPAPI GdipSetClipRectI(GpGraphics *graphics, INT x, INT y,
if(graphics->busy)
return ObjectBusy;
if(!(calls++))
FIXME("not implemented\n");
return NotImplemented;
return GdipSetClipRect(graphics, (REAL)x, (REAL)y, (REAL)width, (REAL)height, mode);
}
GpStatus WINGDIPAPI GdipSetClipRegion(GpGraphics *graphics, GpRegion *region,
......
......@@ -706,6 +706,8 @@ static void test_Get_Release_DC(void)
expect(ObjectBusy, status); status = Ok;
status = GdipTranslateWorldTransform(graphics, 0.0, 0.0, MatrixOrderPrepend);
expect(ObjectBusy, status); status = Ok;
status = GdipSetClipRect(graphics, 0.0, 0.0, 10.0, 10.0, CombineModeReplace);
expect(ObjectBusy, status); status = Ok;
status = GdipSetClipRectI(graphics, 0, 0, 10, 10, CombineModeReplace);
expect(ObjectBusy, status); status = Ok;
status = GdipSetClipRegion(graphics, clip, CombineModeReplace);
......
......@@ -533,6 +533,7 @@ GpStatus WINGDIPAPI GdipTranslateRegionI(GpRegion *, INT, INT);
GpStatus WINGDIPAPI GdipFlush(GpGraphics*, GpFlushIntention);
GpStatus WINGDIPAPI GdipSetMetafileDownLevelRasterizationLimit(GpMetafile*,UINT);
GpStatus WINGDIPAPI GdipSetClipRect(GpGraphics*,REAL,REAL,REAL,REAL,CombineMode);
GpStatus WINGDIPAPI GdipSetClipRectI(GpGraphics*,INT,INT,INT,INT,CombineMode);
GpStatus WINGDIPAPI GdipFillRegion(GpGraphics*,GpBrush*,GpRegion*);
......
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