gdiplus: Add tests for GdipGetLineTransform.
This commit is contained in:
parent
3e86d43030
commit
f49d56fef3
@ -286,10 +286,15 @@ static void test_texturewrap(void)
|
|||||||
static void test_gradientgetrect(void)
|
static void test_gradientgetrect(void)
|
||||||
{
|
{
|
||||||
GpLineGradient *brush;
|
GpLineGradient *brush;
|
||||||
|
GpMatrix *transform;
|
||||||
|
REAL elements[6];
|
||||||
GpRectF rectf;
|
GpRectF rectf;
|
||||||
GpStatus status;
|
GpStatus status;
|
||||||
GpPointF pt1, pt2;
|
GpPointF pt1, pt2;
|
||||||
|
|
||||||
|
status = GdipCreateMatrix(&transform);
|
||||||
|
expect(Ok, status);
|
||||||
|
|
||||||
pt1.X = pt1.Y = 1.0;
|
pt1.X = pt1.Y = 1.0;
|
||||||
pt2.X = pt2.Y = 100.0;
|
pt2.X = pt2.Y = 100.0;
|
||||||
status = GdipCreateLineBrush(&pt1, &pt2, 0, 0, WrapModeTile, &brush);
|
status = GdipCreateLineBrush(&pt1, &pt2, 0, 0, WrapModeTile, &brush);
|
||||||
@ -301,6 +306,18 @@ static void test_gradientgetrect(void)
|
|||||||
expectf(1.0, rectf.Y);
|
expectf(1.0, rectf.Y);
|
||||||
expectf(99.0, rectf.Width);
|
expectf(99.0, rectf.Width);
|
||||||
expectf(99.0, rectf.Height);
|
expectf(99.0, rectf.Height);
|
||||||
|
status = GdipGetLineTransform(brush, transform);
|
||||||
|
todo_wine expect(Ok, status);
|
||||||
|
if (status == Ok)
|
||||||
|
{
|
||||||
|
status = GdipGetMatrixElements(transform, elements);
|
||||||
|
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);
|
status = GdipDeleteBrush((GpBrush*)brush);
|
||||||
/* vertical gradient */
|
/* vertical gradient */
|
||||||
pt1.X = pt1.Y = pt2.X = 0.0;
|
pt1.X = pt1.Y = pt2.X = 0.0;
|
||||||
@ -314,6 +331,18 @@ static void test_gradientgetrect(void)
|
|||||||
expectf(0.0, rectf.Y);
|
expectf(0.0, rectf.Y);
|
||||||
expectf(10.0, rectf.Width);
|
expectf(10.0, rectf.Width);
|
||||||
expectf(10.0, rectf.Height);
|
expectf(10.0, rectf.Height);
|
||||||
|
status = GdipGetLineTransform(brush, transform);
|
||||||
|
todo_wine expect(Ok, status);
|
||||||
|
if (status == Ok)
|
||||||
|
{
|
||||||
|
status = GdipGetMatrixElements(transform, elements);
|
||||||
|
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);
|
status = GdipDeleteBrush((GpBrush*)brush);
|
||||||
/* horizontal gradient */
|
/* horizontal gradient */
|
||||||
pt1.X = pt1.Y = pt2.Y = 0.0;
|
pt1.X = pt1.Y = pt2.Y = 0.0;
|
||||||
@ -327,6 +356,18 @@ static void test_gradientgetrect(void)
|
|||||||
expectf(-5.0, rectf.Y);
|
expectf(-5.0, rectf.Y);
|
||||||
expectf(10.0, rectf.Width);
|
expectf(10.0, rectf.Width);
|
||||||
expectf(10.0, rectf.Height);
|
expectf(10.0, rectf.Height);
|
||||||
|
status = GdipGetLineTransform(brush, transform);
|
||||||
|
todo_wine expect(Ok, status);
|
||||||
|
if (status == Ok)
|
||||||
|
{
|
||||||
|
status = GdipGetMatrixElements(transform, elements);
|
||||||
|
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);
|
status = GdipDeleteBrush((GpBrush*)brush);
|
||||||
/* slope = -1 */
|
/* slope = -1 */
|
||||||
pt1.X = pt1.Y = 0.0;
|
pt1.X = pt1.Y = 0.0;
|
||||||
@ -341,6 +382,18 @@ static void test_gradientgetrect(void)
|
|||||||
expectf(-20.0, rectf.Y);
|
expectf(-20.0, rectf.Y);
|
||||||
expectf(20.0, rectf.Width);
|
expectf(20.0, rectf.Width);
|
||||||
expectf(20.0, rectf.Height);
|
expectf(20.0, rectf.Height);
|
||||||
|
status = GdipGetLineTransform(brush, transform);
|
||||||
|
todo_wine expect(Ok, status);
|
||||||
|
if (status == Ok)
|
||||||
|
{
|
||||||
|
status = GdipGetMatrixElements(transform, elements);
|
||||||
|
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);
|
status = GdipDeleteBrush((GpBrush*)brush);
|
||||||
/* slope = 1/100 */
|
/* slope = 1/100 */
|
||||||
pt1.X = pt1.Y = 0.0;
|
pt1.X = pt1.Y = 0.0;
|
||||||
@ -355,6 +408,18 @@ static void test_gradientgetrect(void)
|
|||||||
expectf(0.0, rectf.Y);
|
expectf(0.0, rectf.Y);
|
||||||
expectf(100.0, rectf.Width);
|
expectf(100.0, rectf.Width);
|
||||||
expectf(1.0, rectf.Height);
|
expectf(1.0, rectf.Height);
|
||||||
|
status = GdipGetLineTransform(brush, transform);
|
||||||
|
todo_wine expect(Ok, status);
|
||||||
|
if (status == Ok)
|
||||||
|
{
|
||||||
|
status = GdipGetMatrixElements(transform, elements);
|
||||||
|
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);
|
status = GdipDeleteBrush((GpBrush*)brush);
|
||||||
/* zero height rect */
|
/* zero height rect */
|
||||||
rectf.X = rectf.Y = 10.0;
|
rectf.X = rectf.Y = 10.0;
|
||||||
@ -383,6 +448,18 @@ static void test_gradientgetrect(void)
|
|||||||
expectf(10.0, rectf.Y);
|
expectf(10.0, rectf.Y);
|
||||||
expectf(100.0, rectf.Width);
|
expectf(100.0, rectf.Width);
|
||||||
expectf(100.0, rectf.Height);
|
expectf(100.0, rectf.Height);
|
||||||
|
status = GdipGetLineTransform(brush, transform);
|
||||||
|
todo_wine expect(Ok, status);
|
||||||
|
if (status == Ok)
|
||||||
|
{
|
||||||
|
status = GdipGetMatrixElements(transform, elements);
|
||||||
|
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);
|
status = GdipDeleteBrush((GpBrush*)brush);
|
||||||
/* passing negative Width/Height to LinearGradientModeHorizontal */
|
/* passing negative Width/Height to LinearGradientModeHorizontal */
|
||||||
rectf.X = rectf.Y = 10.0;
|
rectf.X = rectf.Y = 10.0;
|
||||||
@ -397,7 +474,21 @@ static void test_gradientgetrect(void)
|
|||||||
expectf(10.0, rectf.Y);
|
expectf(10.0, rectf.Y);
|
||||||
expectf(-100.0, rectf.Width);
|
expectf(-100.0, rectf.Width);
|
||||||
expectf(-100.0, rectf.Height);
|
expectf(-100.0, rectf.Height);
|
||||||
|
status = GdipGetLineTransform(brush, transform);
|
||||||
|
todo_wine expect(Ok, status);
|
||||||
|
if (status == Ok)
|
||||||
|
{
|
||||||
|
status = GdipGetMatrixElements(transform, elements);
|
||||||
|
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);
|
status = GdipDeleteBrush((GpBrush*)brush);
|
||||||
|
|
||||||
|
GdipDeleteMatrix(transform);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_lineblend(void)
|
static void test_lineblend(void)
|
||||||
|
@ -474,6 +474,7 @@ GpStatus WINGDIPAPI GdipSetLinePresetBlend(GpLineGradient*,GDIPCONST ARGB*,
|
|||||||
GDIPCONST REAL*,INT);
|
GDIPCONST REAL*,INT);
|
||||||
GpStatus WINGDIPAPI GdipGetLinePresetBlend(GpLineGradient*,ARGB*,REAL*,INT);
|
GpStatus WINGDIPAPI GdipGetLinePresetBlend(GpLineGradient*,ARGB*,REAL*,INT);
|
||||||
GpStatus WINGDIPAPI GdipGetLinePresetBlendCount(GpLineGradient*,INT*);
|
GpStatus WINGDIPAPI GdipGetLinePresetBlendCount(GpLineGradient*,INT*);
|
||||||
|
GpStatus WINGDIPAPI GdipGetLineTransform(GpLineGradient*,GpMatrix*);
|
||||||
GpStatus WINGDIPAPI GdipResetLineTransform(GpLineGradient*);
|
GpStatus WINGDIPAPI GdipResetLineTransform(GpLineGradient*);
|
||||||
GpStatus WINGDIPAPI GdipRotateLineTransform(GpLineGradient*,REAL,GpMatrixOrder);
|
GpStatus WINGDIPAPI GdipRotateLineTransform(GpLineGradient*,REAL,GpMatrixOrder);
|
||||||
GpStatus WINGDIPAPI GdipScaleLineTransform(GpLineGradient*,REAL,REAL,
|
GpStatus WINGDIPAPI GdipScaleLineTransform(GpLineGradient*,REAL,REAL,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user