gdiplus/tests: Add more tests for gradient brush rectangles.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
0046c1f5bd
commit
1f95fd4811
@ -621,141 +621,103 @@ static void test_texturewrap(void)
|
|||||||
|
|
||||||
static void test_gradientgetrect(void)
|
static void test_gradientgetrect(void)
|
||||||
{
|
{
|
||||||
|
static const struct
|
||||||
|
{
|
||||||
|
LinearGradientMode mode;
|
||||||
|
GpRectF rect;
|
||||||
|
REAL transform[6];
|
||||||
|
}
|
||||||
|
create_from_rect[] =
|
||||||
|
{
|
||||||
|
{ LinearGradientModeHorizontal, { 10.0f, 10.0f, -100.0f, -100.0f } },
|
||||||
|
{ LinearGradientModeHorizontal, { 10.0f, 10.0f, 100.0f, 100.0f } },
|
||||||
|
{ LinearGradientModeHorizontal, { 10.0f, -5.0f, 100.0f, 50.0f } },
|
||||||
|
{ LinearGradientModeHorizontal, { -5.0f, 10.0f, 100.0f, 50.0f } },
|
||||||
|
{ LinearGradientModeVertical, { 0.0f, 0.0f, 100.0f, 10.0f }, { 0.0f, 0.1f, -10.0f, -0.0f, 100.0f, 0.0f } },
|
||||||
|
{ LinearGradientModeVertical, { 10.0f, -12.0f, 100.0f, 105.0f }, { 0.0f, 1.05f, -0.952f, 0.0f, 98.571f, -22.5f } },
|
||||||
|
};
|
||||||
|
static const struct
|
||||||
|
{
|
||||||
|
GpPointF pt1, pt2;
|
||||||
|
GpRectF rect;
|
||||||
|
REAL transform[6];
|
||||||
|
}
|
||||||
|
create_from_pt[] =
|
||||||
|
{
|
||||||
|
{ { 1.0f, 1.0f }, { 100.0f, 100.0f }, { 1.0f, 1.0f, 99.0f, 99.0f }, { 1.0f, 1.0f, -1.0f, 1.0f, 50.50f, -50.50f } },
|
||||||
|
{ { 0.0f, 0.0f }, { 0.0f, 10.0f }, { -5.0f, 0.0f, 10.0f, 10.0f }, { 0.0f, 1.0f, -1.0f, 0.0f, 5.0f, 5.0f } },
|
||||||
|
{ { 0.0f, 0.0f }, { 10.0f, 0.0f }, { 0.0f, -5.0f, 10.0f, 10.0f }, { 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f } },
|
||||||
|
/* Slope = -1 */
|
||||||
|
{ { 0.0f, 0.0f }, { 20.0f, -20.0f }, { 0.0f, -20.0f, 20.0f, 20.0f }, { 1.0f, -1.0f, 1.0f, 1.0f, 10.0f, 10.0f } },
|
||||||
|
/* Slope = 1/100 */
|
||||||
|
{ { 0.0f, 0.0f }, { 100.0f, 1.0f }, { 0.0f, 0.0f, 100.0f, 1.0f }, { 1.0f, 0.01f, -0.02f, 2.0f, 0.01f, -1.0f } },
|
||||||
|
{ { 10.0f, 10.0f }, { -90.0f, 10.0f }, { -90.0f, -40.0f, 100.0f, 100.0f }, { -1.0f, 0.0f, 0.0f, -1.0f, -80.0f, 20.0f } },
|
||||||
|
};
|
||||||
|
static const struct
|
||||||
|
{
|
||||||
|
GpRectF rect;
|
||||||
|
REAL angle;
|
||||||
|
BOOL is_scalable;
|
||||||
|
REAL transform[6];
|
||||||
|
}
|
||||||
|
create_with_angle[] =
|
||||||
|
{
|
||||||
|
{ { 10.0f, 10.0f, -100.0f, -100.0f }, 0.0f, TRUE },
|
||||||
|
{ { 10.0f, 10.0f, -100.0f, -100.0f }, 0.0f, FALSE },
|
||||||
|
{ { 10.0f, 10.0f, 100.0f, 100.0f }, 0.0f, FALSE },
|
||||||
|
{ { 10.0f, 10.0f, 100.0f, 100.0f }, 0.0f, TRUE },
|
||||||
|
{ { 10.0f, -5.0f, 100.0f, 50.0f }, 0.0f, FALSE },
|
||||||
|
{ { 10.0f, -5.0f, 100.0f, 50.0f }, 0.0f, TRUE },
|
||||||
|
{ { -5.0f, 10.0f, 100.0f, 50.0f }, 0.0f, FALSE },
|
||||||
|
{ { -5.0f, 10.0f, 100.0f, 50.0f }, 0.0f, TRUE },
|
||||||
|
{ { 0.0f, 0.0f, 100.0f, 10.0f }, -90.0f, TRUE, { 0.0f, -0.1f, 10.0f, 0.0f, 0.0f, 10.0f } },
|
||||||
|
{ { 10.0f, -12.0f, 100.0f, 105.0f }, -90.0f, TRUE, { 0.0f, -1.05f, 0.952f, 0.0f, 21.429f, 103.5f } },
|
||||||
|
{ { 0.0f, 0.0f, 100.0f, 10.0f }, -90.0f, FALSE, { 0.0f, -0.1f, 10.0f, -0.0f, 0.0f, 10.0f } },
|
||||||
|
{ { 10.0f, -12.0f, 100.0f, 105.0f }, -90.0f, FALSE, { 0.0f, -1.05f, 0.952f, 0.0f, 21.429f, 103.5f } },
|
||||||
|
};
|
||||||
GpLineGradient *brush;
|
GpLineGradient *brush;
|
||||||
GpMatrix *transform;
|
GpMatrix *transform;
|
||||||
REAL elements[6];
|
REAL elements[6];
|
||||||
GpRectF rectf;
|
|
||||||
GpStatus status;
|
GpStatus status;
|
||||||
GpPointF pt1, pt2;
|
unsigned int i;
|
||||||
|
ARGB colors[2];
|
||||||
|
GpRectF rectf;
|
||||||
|
|
||||||
status = GdipCreateMatrix(&transform);
|
status = GdipCreateMatrix(&transform);
|
||||||
expect(Ok, status);
|
expect(Ok, status);
|
||||||
|
|
||||||
pt1.X = pt1.Y = 1.0;
|
for (i = 0; i < ARRAY_SIZE(create_from_pt); ++i)
|
||||||
pt2.X = pt2.Y = 100.0;
|
{
|
||||||
status = GdipCreateLineBrush(&pt1, &pt2, 0, 0, WrapModeTile, &brush);
|
status = GdipCreateLineBrush(&create_from_pt[i].pt1, &create_from_pt[i].pt2, 0x1, 0x2, WrapModeTile, &brush);
|
||||||
expect(Ok, status);
|
ok(status == Ok, "Failed to create a brush, %d.\n", status);
|
||||||
memset(&rectf, 0, sizeof(GpRectF));
|
|
||||||
status = GdipGetLineRect(brush, &rectf);
|
|
||||||
expect(Ok, status);
|
|
||||||
expectf(1.0, rectf.X);
|
|
||||||
expectf(1.0, rectf.Y);
|
|
||||||
expectf(99.0, rectf.Width);
|
|
||||||
expectf(99.0, rectf.Height);
|
|
||||||
status = GdipGetLineTransform(brush, transform);
|
|
||||||
expect(Ok, status);
|
|
||||||
status = GdipGetMatrixElements(transform, elements);
|
|
||||||
expect(Ok, status);
|
|
||||||
expectf(1.0, elements[0]);
|
|
||||||
expectf(1.0, elements[1]);
|
|
||||||
expectf(-1.0, elements[2]);
|
|
||||||
expectf(1.0, elements[3]);
|
|
||||||
expectf(50.50, elements[4]);
|
|
||||||
expectf(-50.50, elements[5]);
|
|
||||||
status = GdipDeleteBrush((GpBrush*)brush);
|
|
||||||
expect(Ok, status);
|
|
||||||
|
|
||||||
/* vertical gradient */
|
memset(&rectf, 0, sizeof(rectf));
|
||||||
pt1.X = pt1.Y = pt2.X = 0.0;
|
|
||||||
pt2.Y = 10.0;
|
|
||||||
status = GdipCreateLineBrush(&pt1, &pt2, 0, 0, WrapModeTile, &brush);
|
|
||||||
expect(Ok, status);
|
|
||||||
memset(&rectf, 0, sizeof(GpRectF));
|
|
||||||
status = GdipGetLineRect(brush, &rectf);
|
status = GdipGetLineRect(brush, &rectf);
|
||||||
expect(Ok, status);
|
ok(status == Ok, "Failed to get brush rect, %d.\n", status);
|
||||||
expectf(-5.0, rectf.X);
|
ok(!memcmp(&rectf, &create_from_pt[i].rect, sizeof(rectf)), "Unexpected brush rect.\n");
|
||||||
expectf(0.0, rectf.Y);
|
|
||||||
expectf(10.0, rectf.Width);
|
|
||||||
expectf(10.0, rectf.Height);
|
|
||||||
status = GdipGetLineTransform(brush, transform);
|
|
||||||
expect(Ok, status);
|
|
||||||
status = GdipGetMatrixElements(transform, elements);
|
|
||||||
expect(Ok, status);
|
|
||||||
expectf(0.0, elements[0]);
|
|
||||||
expectf(1.0, elements[1]);
|
|
||||||
expectf(-1.0, elements[2]);
|
|
||||||
expectf(0.0, elements[3]);
|
|
||||||
expectf(5.0, elements[4]);
|
|
||||||
expectf(5.0, elements[5]);
|
|
||||||
status = GdipDeleteBrush((GpBrush*)brush);
|
|
||||||
expect(Ok, status);
|
|
||||||
|
|
||||||
/* horizontal gradient */
|
|
||||||
pt1.X = pt1.Y = pt2.Y = 0.0;
|
|
||||||
pt2.X = 10.0;
|
|
||||||
status = GdipCreateLineBrush(&pt1, &pt2, 0, 0, WrapModeTile, &brush);
|
|
||||||
expect(Ok, status);
|
|
||||||
memset(&rectf, 0, sizeof(GpRectF));
|
|
||||||
status = GdipGetLineRect(brush, &rectf);
|
|
||||||
expect(Ok, status);
|
|
||||||
expectf(0.0, rectf.X);
|
|
||||||
expectf(-5.0, rectf.Y);
|
|
||||||
expectf(10.0, rectf.Width);
|
|
||||||
expectf(10.0, rectf.Height);
|
|
||||||
status = GdipGetLineTransform(brush, transform);
|
status = GdipGetLineTransform(brush, transform);
|
||||||
expect(Ok, status);
|
ok(status == Ok, "Failed to get brush transform, %d.\n", status);
|
||||||
status = GdipGetMatrixElements(transform, elements);
|
|
||||||
expect(Ok, status);
|
|
||||||
expectf(1.0, elements[0]);
|
|
||||||
expectf(0.0, elements[1]);
|
|
||||||
expectf(0.0, elements[2]);
|
|
||||||
expectf(1.0, elements[3]);
|
|
||||||
expectf(0.0, elements[4]);
|
|
||||||
expectf(0.0, elements[5]);
|
|
||||||
status = GdipDeleteBrush((GpBrush*)brush);
|
|
||||||
expect(Ok, status);
|
|
||||||
|
|
||||||
/* slope = -1 */
|
|
||||||
pt1.X = pt1.Y = 0.0;
|
|
||||||
pt2.X = 20.0;
|
|
||||||
pt2.Y = -20.0;
|
|
||||||
status = GdipCreateLineBrush(&pt1, &pt2, 0, 0, WrapModeTile, &brush);
|
|
||||||
expect(Ok, status);
|
|
||||||
memset(&rectf, 0, sizeof(GpRectF));
|
|
||||||
status = GdipGetLineRect(brush, &rectf);
|
|
||||||
expect(Ok, status);
|
|
||||||
expectf(0.0, rectf.X);
|
|
||||||
expectf(-20.0, rectf.Y);
|
|
||||||
expectf(20.0, rectf.Width);
|
|
||||||
expectf(20.0, rectf.Height);
|
|
||||||
status = GdipGetLineTransform(brush, transform);
|
|
||||||
expect(Ok, status);
|
|
||||||
status = GdipGetMatrixElements(transform, elements);
|
status = GdipGetMatrixElements(transform, elements);
|
||||||
expect(Ok, status);
|
ok(status == Ok, "Failed to get matrix elements, %d.\n", status);
|
||||||
expectf(1.0, elements[0]);
|
|
||||||
expectf(-1.0, elements[1]);
|
|
||||||
expectf(1.0, elements[2]);
|
|
||||||
expectf(1.0, elements[3]);
|
|
||||||
expectf(10.0, elements[4]);
|
|
||||||
expectf(10.0, elements[5]);
|
|
||||||
status = GdipDeleteBrush((GpBrush*)brush);
|
|
||||||
expect(Ok, status);
|
|
||||||
|
|
||||||
/* slope = 1/100 */
|
#define expectf2(expected, got) ok(fabs(expected - got) < 0.001, "%u: expected %.3f, got %.3f.\n", i, expected, got)
|
||||||
pt1.X = pt1.Y = 0.0;
|
expectf2(create_from_pt[i].transform[0], elements[0]);
|
||||||
pt2.X = 100.0;
|
expectf2(create_from_pt[i].transform[1], elements[1]);
|
||||||
pt2.Y = 1.0;
|
expectf2(create_from_pt[i].transform[2], elements[2]);
|
||||||
status = GdipCreateLineBrush(&pt1, &pt2, 0, 0, WrapModeTile, &brush);
|
expectf2(create_from_pt[i].transform[3], elements[3]);
|
||||||
expect(Ok, status);
|
expectf2(create_from_pt[i].transform[4], elements[4]);
|
||||||
memset(&rectf, 0, sizeof(GpRectF));
|
expectf2(create_from_pt[i].transform[5], elements[5]);
|
||||||
status = GdipGetLineRect(brush, &rectf);
|
#undef expect2f
|
||||||
expect(Ok, status);
|
|
||||||
expectf(0.0, rectf.X);
|
status = GdipGetLineColors(brush, colors);
|
||||||
expectf(0.0, rectf.Y);
|
ok(status == Ok, "Failed to get line colors, %d.\n", status);
|
||||||
expectf(100.0, rectf.Width);
|
ok(colors[0] == 0x1 && colors[1] == 0x2, "Unexpected brush colors.\n");
|
||||||
expectf(1.0, rectf.Height);
|
|
||||||
status = GdipGetLineTransform(brush, transform);
|
status = GdipDeleteBrush((GpBrush *)brush);
|
||||||
expect(Ok, status);
|
ok(status == Ok, "Failed to delete a brush, %d.\n", status);
|
||||||
status = GdipGetMatrixElements(transform, elements);
|
}
|
||||||
expect(Ok,status);
|
|
||||||
expectf(1.0, elements[0]);
|
|
||||||
expectf(0.01, elements[1]);
|
|
||||||
expectf(-0.02, elements[2]);
|
|
||||||
/* expectf(2.0, elements[3]); */
|
|
||||||
expectf(0.01, elements[4]);
|
|
||||||
/* expectf(-1.0, elements[5]); */
|
|
||||||
status = GdipDeleteBrush((GpBrush*)brush);
|
|
||||||
expect(Ok,status);
|
|
||||||
|
|
||||||
/* zero height rect */
|
/* zero height rect */
|
||||||
rectf.X = rectf.Y = 10.0;
|
rectf.X = rectf.Y = 10.0;
|
||||||
@ -773,84 +735,100 @@ static void test_gradientgetrect(void)
|
|||||||
WrapModeTile, &brush);
|
WrapModeTile, &brush);
|
||||||
expect(OutOfMemory, status);
|
expect(OutOfMemory, status);
|
||||||
|
|
||||||
/* from rect with LinearGradientModeHorizontal */
|
for (i = 0; i < ARRAY_SIZE(create_from_rect); ++i)
|
||||||
rectf.X = rectf.Y = 10.0;
|
{
|
||||||
rectf.Width = rectf.Height = 100.0;
|
ARGB colors[2];
|
||||||
status = GdipCreateLineBrushFromRect(&rectf, 0, 0, LinearGradientModeHorizontal,
|
BOOL ret;
|
||||||
WrapModeTile, &brush);
|
|
||||||
expect(Ok, status);
|
|
||||||
memset(&rectf, 0, sizeof(GpRectF));
|
|
||||||
status = GdipGetLineRect(brush, &rectf);
|
|
||||||
expect(Ok, status);
|
|
||||||
expectf(10.0, rectf.X);
|
|
||||||
expectf(10.0, rectf.Y);
|
|
||||||
expectf(100.0, rectf.Width);
|
|
||||||
expectf(100.0, rectf.Height);
|
|
||||||
status = GdipGetLineTransform(brush, transform);
|
|
||||||
expect(Ok, status);
|
|
||||||
status = GdipGetMatrixElements(transform, elements);
|
|
||||||
expect(Ok,status);
|
|
||||||
expectf(1.0, elements[0]);
|
|
||||||
expectf(0.0, elements[1]);
|
|
||||||
expectf(0.0, elements[2]);
|
|
||||||
expectf(1.0, elements[3]);
|
|
||||||
expectf(0.0, elements[4]);
|
|
||||||
expectf(0.0, elements[5]);
|
|
||||||
status = GdipDeleteBrush((GpBrush*)brush);
|
|
||||||
expect(Ok,status);
|
|
||||||
|
|
||||||
/* passing negative Width/Height to LinearGradientModeHorizontal */
|
status = GdipCreateLineBrushFromRect(&create_from_rect[i].rect, 0x1, 0x2, create_from_rect[i].mode,
|
||||||
rectf.X = rectf.Y = 10.0;
|
|
||||||
rectf.Width = rectf.Height = -100.0;
|
|
||||||
status = GdipCreateLineBrushFromRect(&rectf, 0, 0, LinearGradientModeHorizontal,
|
|
||||||
WrapModeTile, &brush);
|
WrapModeTile, &brush);
|
||||||
expect(Ok, status);
|
ok(status == Ok, "Failed to create a brush, %d.\n", status);
|
||||||
memset(&rectf, 0, sizeof(GpRectF));
|
|
||||||
status = GdipGetLineRect(brush, &rectf);
|
|
||||||
expect(Ok, status);
|
|
||||||
expectf(10.0, rectf.X);
|
|
||||||
expectf(10.0, rectf.Y);
|
|
||||||
expectf(-100.0, rectf.Width);
|
|
||||||
expectf(-100.0, rectf.Height);
|
|
||||||
status = GdipGetLineTransform(brush, transform);
|
|
||||||
expect(Ok, status);
|
|
||||||
status = GdipGetMatrixElements(transform, elements);
|
|
||||||
expect(Ok,status);
|
|
||||||
expectf(1.0, elements[0]);
|
|
||||||
expectf(0.0, elements[1]);
|
|
||||||
expectf(0.0, elements[2]);
|
|
||||||
expectf(1.0, elements[3]);
|
|
||||||
expectf(0.0, elements[4]);
|
|
||||||
expectf(0.0, elements[5]);
|
|
||||||
status = GdipDeleteBrush((GpBrush*)brush);
|
|
||||||
expect(Ok,status);
|
|
||||||
|
|
||||||
/* reverse gradient line as immediately previous */
|
memset(&rectf, 0, sizeof(rectf));
|
||||||
pt1.X = 10.0;
|
|
||||||
pt1.Y = 10.0;
|
|
||||||
pt2.X = -90.0;
|
|
||||||
pt2.Y = 10.0;
|
|
||||||
status = GdipCreateLineBrush(&pt1, &pt2, 0, 0, WrapModeTile, &brush);
|
|
||||||
expect(Ok, status);
|
|
||||||
memset(&rectf, 0, sizeof(GpRectF));
|
|
||||||
status = GdipGetLineRect(brush, &rectf);
|
status = GdipGetLineRect(brush, &rectf);
|
||||||
expect(Ok, status);
|
ok(status == Ok, "Failed to get brush rect, %d.\n", status);
|
||||||
expectf(-90.0, rectf.X);
|
ok(!memcmp(&rectf, &create_from_rect[i].rect, sizeof(rectf)), "Unexpected brush rect.\n");
|
||||||
expectf(-40.0, rectf.Y);
|
|
||||||
expectf(100.0, rectf.Width);
|
|
||||||
expectf(100.0, rectf.Height);
|
|
||||||
status = GdipGetLineTransform(brush, transform);
|
status = GdipGetLineTransform(brush, transform);
|
||||||
expect(Ok, status);
|
ok(status == Ok, "Failed to get brush transform, %d.\n", status);
|
||||||
|
|
||||||
|
if (create_from_rect[i].mode == LinearGradientModeHorizontal)
|
||||||
|
{
|
||||||
|
status = GdipIsMatrixIdentity(transform, &ret);
|
||||||
|
ok(status == Ok, "Unexpected ret value %d.\n", status);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
status = GdipGetMatrixElements(transform, elements);
|
status = GdipGetMatrixElements(transform, elements);
|
||||||
expect(Ok, status);
|
ok(status == Ok, "Failed to get matrix elements, %d.\n", status);
|
||||||
expectf(-1.0, elements[0]);
|
|
||||||
expectf(0.0, elements[1]);
|
#define expectf2(expected, got) ok(fabs(expected - got) < 0.001, "%u: expected %.3f, got %.3f.\n", i, expected, got)
|
||||||
expectf(0.0, elements[2]);
|
expectf2(create_from_rect[i].transform[0], elements[0]);
|
||||||
expectf(-1.0, elements[3]);
|
todo_wine_if(create_from_rect[i].mode == LinearGradientModeVertical) {
|
||||||
expectf(-80.0, elements[4]);
|
expectf2(create_from_rect[i].transform[1], elements[1]);
|
||||||
expectf(20.0, elements[5]);
|
expectf2(create_from_rect[i].transform[2], elements[2]);
|
||||||
|
}
|
||||||
|
expectf2(create_from_rect[i].transform[3], elements[3]);
|
||||||
|
todo_wine_if(create_from_rect[i].mode == LinearGradientModeVertical) {
|
||||||
|
expectf2(create_from_rect[i].transform[4], elements[4]);
|
||||||
|
expectf2(create_from_rect[i].transform[5], elements[5]);
|
||||||
|
}
|
||||||
|
#undef expectf2
|
||||||
|
}
|
||||||
|
|
||||||
|
status = GdipGetLineColors(brush, colors);
|
||||||
|
ok(status == Ok, "Failed to get line colors, %d.\n", status);
|
||||||
|
ok(colors[0] == 0x1 && colors[1] == 0x2, "Unexpected brush colors.\n");
|
||||||
|
|
||||||
status = GdipDeleteBrush((GpBrush*)brush);
|
status = GdipDeleteBrush((GpBrush*)brush);
|
||||||
expect(Ok, status);
|
ok(status == Ok, "Failed to delete a brush, %d.\n", status);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < ARRAY_SIZE(create_with_angle); ++i)
|
||||||
|
{
|
||||||
|
ARGB colors[2];
|
||||||
|
BOOL ret;
|
||||||
|
|
||||||
|
status = GdipCreateLineBrushFromRectWithAngle(&create_with_angle[i].rect, 0x1, 0x2, create_with_angle[i].angle,
|
||||||
|
create_with_angle[i].is_scalable, WrapModeTile, &brush);
|
||||||
|
ok(status == Ok, "Failed to create a brush, %d.\n", status);
|
||||||
|
|
||||||
|
memset(&rectf, 0, sizeof(rectf));
|
||||||
|
status = GdipGetLineRect(brush, &rectf);
|
||||||
|
ok(status == Ok, "Failed to get brush rect, %d.\n", status);
|
||||||
|
ok(!memcmp(&rectf, &create_with_angle[i].rect, sizeof(rectf)), "%u: unexpected brush rect {%f,%f,%f,%f}.\n",
|
||||||
|
i, rectf.X, rectf.Y, rectf.Width, rectf.Height);
|
||||||
|
|
||||||
|
status = GdipGetLineTransform(brush, transform);
|
||||||
|
ok(status == Ok, "Failed to get brush transform, %d.\n", status);
|
||||||
|
|
||||||
|
if (create_with_angle[i].angle == 0.0f)
|
||||||
|
{
|
||||||
|
status = GdipIsMatrixIdentity(transform, &ret);
|
||||||
|
ok(status == Ok, "Unexpected ret value %d.\n", status);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
status = GdipGetMatrixElements(transform, elements);
|
||||||
|
ok(status == Ok, "Failed to get matrix elements, %d.\n", status);
|
||||||
|
|
||||||
|
#define expectf2(expected, got) ok(fabs(expected - got) < 0.001, "%u: expected %.3f, got %.3f.\n", i, expected, got)
|
||||||
|
expectf2(create_with_angle[i].transform[0], elements[0]);
|
||||||
|
expectf2(create_with_angle[i].transform[1], elements[1]);
|
||||||
|
expectf2(create_with_angle[i].transform[2], elements[2]);
|
||||||
|
expectf2(create_with_angle[i].transform[3], elements[3]);
|
||||||
|
expectf2(create_with_angle[i].transform[4], elements[4]);
|
||||||
|
expectf2(create_with_angle[i].transform[5], elements[5]);
|
||||||
|
#undef expectf2
|
||||||
|
}
|
||||||
|
|
||||||
|
status = GdipGetLineColors(brush, colors);
|
||||||
|
ok(status == Ok, "Failed to get line colors, %d.\n", status);
|
||||||
|
ok(colors[0] == 0x1 && colors[1] == 0x2, "Unexpected brush colors.\n");
|
||||||
|
|
||||||
|
status = GdipDeleteBrush((GpBrush*)brush);
|
||||||
|
ok(status == Ok, "Failed to delete a brush, %d.\n", status);
|
||||||
|
}
|
||||||
|
|
||||||
GdipDeleteMatrix(transform);
|
GdipDeleteMatrix(transform);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user