Browse Source

Fixed D2D render tests.

A few were beoken due to UseLayoutRounding changes and a few were false
negatives due to artifacts. Try using RootMeanSquared as the error
metric and an arbitrary value of 0.02 which seems to be about right from
current data.
pull/58/head
Steven Kirk 11 years ago
parent
commit
9e5bce524c
  1. BIN
      TestFiles/Direct2D1/Shapes/Path/Path_Expander_With_Border.expected.png
  2. BIN
      TestFiles/Direct2D1/Shapes/Rectangle/Rectangle_2px_Stroke.expected.png
  3. BIN
      TestFiles/Direct2D1/Shapes/Rectangle/Rectangle_Stroke_Fill.expected.png
  4. 13
      Tests/Perspex.RenderTests/TestBase.cs

BIN
TestFiles/Direct2D1/Shapes/Path/Path_Expander_With_Border.expected.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
TestFiles/Direct2D1/Shapes/Rectangle/Rectangle_2px_Stroke.expected.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 619 B

After

Width:  |  Height:  |  Size: 611 B

BIN
TestFiles/Direct2D1/Shapes/Rectangle/Rectangle_Stroke_Fill.expected.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 620 B

After

Width:  |  Height:  |  Size: 615 B

13
Tests/Perspex.RenderTests/TestBase.cs

@ -66,18 +66,11 @@ namespace Perspex.Direct2D1.RenderTests
string actualPath = Path.Combine(this.OutputPath, testName + ".out.png");
MagickImage expected = new MagickImage(expectedPath);
MagickImage actual = new MagickImage(actualPath);
MagickErrorInfo error = expected.Compare(actual);
double error = expected.Compare(actual, ErrorMetric.RootMeanSquared);
if (error.NormalizedMaximumError > 0.1)
if (error > 0.02)
{
if (error.NormalizedMaximumError > 0.15)
{
Assert.True(false, "NormalizedMaximumError = " + error.NormalizedMaximumError);
}
else
{
Assert.True(false, "Close but no cigar. NormalizedMaximumError = " + error.NormalizedMaximumError);
}
Assert.True(false, "Error = " + error);
}
}
}

Loading…
Cancel
Save