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

gdiplus: Implemented GdipSetTextureTransform with tests.

parent 48b80725
......@@ -1095,16 +1095,18 @@ GpStatus WINGDIPAPI GdipSetSolidFillColor(GpSolidFill *sf, ARGB argb)
return Ok;
}
/******************************************************************************
* GdipSetTextureTransform [GDIPLUS.@]
*/
GpStatus WINGDIPAPI GdipSetTextureTransform(GpTexture *texture,
GDIPCONST GpMatrix *matrix)
{
static int calls;
TRACE("(%p, %p)\n", texture, matrix);
if(!texture || !matrix)
return InvalidParameter;
if(!(calls++))
FIXME("not implemented\n");
memcpy(texture->transform, matrix, sizeof(GpMatrix));
return Ok;
}
......
......@@ -176,7 +176,7 @@ static void test_transform(void)
GpGraphics *graphics = NULL;
GpBitmap *bitmap;
HDC hdc = GetDC(0);
GpMatrix *m;
GpMatrix *m, *m1;
BOOL res;
status = GdipCreateMatrix2(2.0, 0.0, 0.0, 0.0, 0.0, 0.0, &m);
......@@ -196,16 +196,28 @@ static void test_transform(void)
status = GdipGetTextureTransform(texture, NULL);
expect(InvalidParameter, status);
/* default value - identity matrix */
/* get default value - identity matrix */
status = GdipGetTextureTransform(texture, m);
expect(Ok, status);
status = GdipIsMatrixIdentity(m, &res);
expect(Ok, status);
expect(TRUE, res);
/* set and get then */
status = GdipCreateMatrix2(2.0, 0.0, 0.0, 2.0, 0.0, 0.0, &m1);
expect(Ok, status);
status = GdipSetTextureTransform(texture, m1);
expect(Ok, status);
status = GdipGetTextureTransform(texture, m);
expect(Ok, status);
status = GdipIsMatrixEqual(m, m1, &res);
expect(Ok, status);
expect(TRUE, res);
status = GdipDeleteBrush((GpBrush*)texture);
expect(Ok, status);
status = GdipDeleteMatrix(m1);
expect(Ok, status);
status = GdipDeleteMatrix(m);
expect(Ok, status);
status = GdipDisposeImage((GpImage*)bitmap);
......
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