Browse Source

Fix VisualBrush tests

pull/3877/head
Benedikt Schroeder 6 years ago
parent
commit
5824d77d0f
  1. 13
      tests/Avalonia.RenderTests/Media/ImageBrushTests.cs
  2. 36
      tests/Avalonia.RenderTests/Media/VisualBrushTests.cs
  3. BIN
      tests/TestFiles/Direct2D1/Media/VisualBrush/VisualBrush_Fill_NoTile.expected.png
  4. BIN
      tests/TestFiles/Direct2D1/Media/VisualBrush/VisualBrush_InTree_Visual.expected.png
  5. BIN
      tests/TestFiles/Direct2D1/Media/VisualBrush/VisualBrush_NoStretch_FlipXY_TopLeftDest.expected.png
  6. BIN
      tests/TestFiles/Direct2D1/Media/VisualBrush/VisualBrush_NoStretch_FlipX_TopLeftDest.expected.png
  7. BIN
      tests/TestFiles/Direct2D1/Media/VisualBrush/VisualBrush_NoStretch_FlipY_TopLeftDest.expected.png
  8. BIN
      tests/TestFiles/Direct2D1/Media/VisualBrush/VisualBrush_NoStretch_NoTile_Alignment_Center.expected.png
  9. BIN
      tests/TestFiles/Direct2D1/Media/VisualBrush/VisualBrush_NoStretch_NoTile_BottomRightQuarterDest.expected.png
  10. BIN
      tests/TestFiles/Direct2D1/Media/VisualBrush/VisualBrush_UniformToFill_NoTile.expected.png
  11. BIN
      tests/TestFiles/Direct2D1/Media/VisualBrush/VisualBrush_Uniform_NoTile.expected.png
  12. BIN
      tests/TestFiles/Skia/Media/ImageBrush/ImageBrush_Fill_NoTile.expected.png
  13. BIN
      tests/TestFiles/Skia/Media/ImageBrush/ImageBrush_Tile_Fill.expected.png
  14. BIN
      tests/TestFiles/Skia/Media/ImageBrush/ImageBrush_Tile_UniformToFill.expected.png
  15. BIN
      tests/TestFiles/Skia/Media/ImageBrush/ImageBrush_UniformToFill_NoTile.expected.png
  16. BIN
      tests/TestFiles/Skia/Media/ImageBrush/ImageBrush_Uniform_NoTile.expected.png
  17. BIN
      tests/TestFiles/Skia/Media/VisualBrush/VisualBrush_Fill_NoTile.expected.png
  18. BIN
      tests/TestFiles/Skia/Media/VisualBrush/VisualBrush_InTree_Visual.expected.png
  19. BIN
      tests/TestFiles/Skia/Media/VisualBrush/VisualBrush_NoStretch_FlipXY_TopLeftDest.expected.png
  20. BIN
      tests/TestFiles/Skia/Media/VisualBrush/VisualBrush_NoStretch_FlipX_TopLeftDest.expected.png
  21. BIN
      tests/TestFiles/Skia/Media/VisualBrush/VisualBrush_NoStretch_FlipY_TopLeftDest.expected.png
  22. BIN
      tests/TestFiles/Skia/Media/VisualBrush/VisualBrush_NoStretch_NoTile_Alignment_Center.expected.png
  23. BIN
      tests/TestFiles/Skia/Media/VisualBrush/VisualBrush_NoStretch_NoTile_BottomRightQuarterDest.expected.png
  24. BIN
      tests/TestFiles/Skia/Media/VisualBrush/VisualBrush_UniformToFill_NoTile.expected.png
  25. BIN
      tests/TestFiles/Skia/Media/VisualBrush/VisualBrush_Uniform_NoTile.expected.png

13
tests/Avalonia.RenderTests/Media/ImageBrushTests.cs

@ -192,11 +192,8 @@ namespace Avalonia.Direct2D1.RenderTests.Media
await RenderToFile(target);
CompareImages();
}
#if AVALONIA_SKIA_SKIP_FAIL
[Fact(Skip = "FIXME")]
#else
[Fact]
#endif
public async Task ImageBrush_Fill_NoTile()
{
Decorator target = new Decorator
@ -219,11 +216,7 @@ namespace Avalonia.Direct2D1.RenderTests.Media
CompareImages();
}
#if AVALONIA_SKIA_SKIP_FAIL
[Fact(Skip = "FIXME")]
#else
[Fact]
#endif
public async Task ImageBrush_Uniform_NoTile()
{
Decorator target = new Decorator
@ -246,11 +239,7 @@ namespace Avalonia.Direct2D1.RenderTests.Media
CompareImages();
}
#if AVALONIA_SKIA_SKIP_FAIL
[Fact(Skip = "FIXME")]
#else
[Fact]
#endif
public async Task ImageBrush_UniformToFill_NoTile()
{
Decorator target = new Decorator

36
tests/Avalonia.RenderTests/Media/VisualBrushTests.cs

@ -14,6 +14,10 @@ namespace Avalonia.Direct2D1.RenderTests.Media
{
public class VisualBrushTests : TestBase
{
//Whitespaces are used here to be able to compare rendering results in a platform independent way.
//Otherwise tests will fail because of slightly different glyph rendering.
private static readonly string s_visualBrushText = " ";
public VisualBrushTests()
: base(@"Media\VisualBrush")
{
@ -48,7 +52,7 @@ namespace Avalonia.Direct2D1.RenderTests.Media
FontFamily = TestFontFamily,
Background = Brushes.Green,
Foreground = Brushes.Yellow,
Text = "VisualBrush",
Text = s_visualBrushText
}
}
}
@ -56,7 +60,7 @@ namespace Avalonia.Direct2D1.RenderTests.Media
}
}
[Fact(Skip = "Visual brush is broken in combination with text rendering.")]
[Fact]
public async Task VisualBrush_NoStretch_NoTile_Alignment_TopLeft()
{
Decorator target = new Decorator
@ -81,7 +85,7 @@ namespace Avalonia.Direct2D1.RenderTests.Media
CompareImages();
}
[Fact(Skip = "Visual brush is broken in combination with text rendering.")]
[Fact]
public async Task VisualBrush_NoStretch_NoTile_Alignment_Center()
{
Decorator target = new Decorator
@ -106,7 +110,7 @@ namespace Avalonia.Direct2D1.RenderTests.Media
CompareImages();
}
[Fact(Skip = "Visual brush is broken in combination with text rendering.")]
[Fact]
public async Task VisualBrush_NoStretch_NoTile_Alignment_BottomRight()
{
Decorator target = new Decorator
@ -131,7 +135,7 @@ namespace Avalonia.Direct2D1.RenderTests.Media
CompareImages();
}
[Fact(Skip = "Visual brush is broken in combination with text rendering.")]
[Fact]
public async Task VisualBrush_Fill_NoTile()
{
Decorator target = new Decorator
@ -154,7 +158,7 @@ namespace Avalonia.Direct2D1.RenderTests.Media
CompareImages();
}
[Fact(Skip = "Visual brush is broken in combination with text rendering.")]
[Fact]
public async Task VisualBrush_Uniform_NoTile()
{
Decorator target = new Decorator
@ -177,7 +181,7 @@ namespace Avalonia.Direct2D1.RenderTests.Media
CompareImages();
}
[Fact(Skip = "Visual brush is broken in combination with text rendering.")]
[Fact]
public async Task VisualBrush_UniformToFill_NoTile()
{
Decorator target = new Decorator
@ -200,7 +204,7 @@ namespace Avalonia.Direct2D1.RenderTests.Media
CompareImages();
}
[Fact(Skip = "Visual brush is broken in combination with text rendering.")]
[Fact]
public async Task VisualBrush_NoStretch_NoTile_BottomRightQuarterSource()
{
Decorator target = new Decorator
@ -224,7 +228,7 @@ namespace Avalonia.Direct2D1.RenderTests.Media
CompareImages();
}
[Fact(Skip = "Visual brush is broken in combination with text rendering.")]
[Fact]
public async Task VisualBrush_NoStretch_NoTile_BottomRightQuarterDest()
{
Decorator target = new Decorator
@ -248,7 +252,7 @@ namespace Avalonia.Direct2D1.RenderTests.Media
CompareImages();
}
[Fact(Skip = "Visual brush is broken in combination with text rendering.")]
[Fact]
public async Task VisualBrush_NoStretch_NoTile_BottomRightQuarterSource_BottomRightQuarterDest()
{
Decorator target = new Decorator
@ -273,7 +277,7 @@ namespace Avalonia.Direct2D1.RenderTests.Media
CompareImages();
}
[Fact(Skip = "Visual brush is broken in combination with text rendering.")]
[Fact]
public async Task VisualBrush_NoStretch_Tile_BottomRightQuarterSource_CenterQuarterDest()
{
Decorator target = new Decorator
@ -298,7 +302,7 @@ namespace Avalonia.Direct2D1.RenderTests.Media
CompareImages();
}
[Fact(Skip = "Visual brush is broken in combination with text rendering.")]
[Fact]
public async Task VisualBrush_NoStretch_FlipX_TopLeftDest()
{
Decorator target = new Decorator
@ -322,7 +326,7 @@ namespace Avalonia.Direct2D1.RenderTests.Media
CompareImages();
}
[Fact(Skip = "Visual brush is broken in combination with text rendering.")]
[Fact]
public async Task VisualBrush_NoStretch_FlipY_TopLeftDest()
{
Decorator target = new Decorator
@ -346,7 +350,7 @@ namespace Avalonia.Direct2D1.RenderTests.Media
CompareImages();
}
[Fact(Skip = "Visual brush is broken in combination with text rendering.")]
[Fact]
public async Task VisualBrush_NoStretch_FlipXY_TopLeftDest()
{
Decorator target = new Decorator
@ -370,7 +374,7 @@ namespace Avalonia.Direct2D1.RenderTests.Media
CompareImages();
}
[Fact(Skip = "Visual brush is broken in combination with text rendering.")]
[Fact]
public async Task VisualBrush_InTree_Visual()
{
Border source;
@ -391,7 +395,7 @@ namespace Avalonia.Direct2D1.RenderTests.Media
Child = new TextBlock
{
FontFamily = TestFontFamily,
Text = "Visual"
Text = s_visualBrushText
}
}),
new Border

BIN
tests/TestFiles/Direct2D1/Media/VisualBrush/VisualBrush_Fill_NoTile.expected.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 KiB

After

Width:  |  Height:  |  Size: 111 KiB

BIN
tests/TestFiles/Direct2D1/Media/VisualBrush/VisualBrush_InTree_Visual.expected.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 375 B

BIN
tests/TestFiles/Direct2D1/Media/VisualBrush/VisualBrush_NoStretch_FlipXY_TopLeftDest.expected.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
tests/TestFiles/Direct2D1/Media/VisualBrush/VisualBrush_NoStretch_FlipX_TopLeftDest.expected.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
tests/TestFiles/Direct2D1/Media/VisualBrush/VisualBrush_NoStretch_FlipY_TopLeftDest.expected.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
tests/TestFiles/Direct2D1/Media/VisualBrush/VisualBrush_NoStretch_NoTile_Alignment_Center.expected.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

BIN
tests/TestFiles/Direct2D1/Media/VisualBrush/VisualBrush_NoStretch_NoTile_BottomRightQuarterDest.expected.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
tests/TestFiles/Direct2D1/Media/VisualBrush/VisualBrush_UniformToFill_NoTile.expected.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 14 KiB

BIN
tests/TestFiles/Direct2D1/Media/VisualBrush/VisualBrush_Uniform_NoTile.expected.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 11 KiB

BIN
tests/TestFiles/Skia/Media/ImageBrush/ImageBrush_Fill_NoTile.expected.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 KiB

After

Width:  |  Height:  |  Size: 37 KiB

BIN
tests/TestFiles/Skia/Media/ImageBrush/ImageBrush_Tile_Fill.expected.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
tests/TestFiles/Skia/Media/ImageBrush/ImageBrush_Tile_UniformToFill.expected.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
tests/TestFiles/Skia/Media/ImageBrush/ImageBrush_UniformToFill_NoTile.expected.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

BIN
tests/TestFiles/Skia/Media/ImageBrush/ImageBrush_Uniform_NoTile.expected.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

BIN
tests/TestFiles/Skia/Media/VisualBrush/VisualBrush_Fill_NoTile.expected.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 KiB

After

Width:  |  Height:  |  Size: 37 KiB

BIN
tests/TestFiles/Skia/Media/VisualBrush/VisualBrush_InTree_Visual.expected.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 375 B

BIN
tests/TestFiles/Skia/Media/VisualBrush/VisualBrush_NoStretch_FlipXY_TopLeftDest.expected.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
tests/TestFiles/Skia/Media/VisualBrush/VisualBrush_NoStretch_FlipX_TopLeftDest.expected.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
tests/TestFiles/Skia/Media/VisualBrush/VisualBrush_NoStretch_FlipY_TopLeftDest.expected.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
tests/TestFiles/Skia/Media/VisualBrush/VisualBrush_NoStretch_NoTile_Alignment_Center.expected.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

BIN
tests/TestFiles/Skia/Media/VisualBrush/VisualBrush_NoStretch_NoTile_BottomRightQuarterDest.expected.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
tests/TestFiles/Skia/Media/VisualBrush/VisualBrush_UniformToFill_NoTile.expected.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

BIN
tests/TestFiles/Skia/Media/VisualBrush/VisualBrush_Uniform_NoTile.expected.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

Loading…
Cancel
Save