gdiplus: Implemented GdipSetTextureTransform with tests.

This commit is contained in:
Nikolay Sivov 2008-09-25 08:56:35 +04:00 committed by Alexandre Julliard
parent 48b8072518
commit edb764fa54
2 changed files with 19 additions and 5 deletions

View File

@ -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;
}

View File

@ -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);