Browse Source

Added another passing ImageBrush test.

This tests what I though was a bug in #874 but comparing with WPF, it seems this is correct behavior.
pull/1050/head
Steven Kirk 9 years ago
parent
commit
7a5e9010a3
  1. 28
      tests/Avalonia.RenderTests/Media/ImageBrushTests.cs
  2. BIN
      tests/TestFiles/Cairo/Media/ImageBrush/ImageBrush_Tile_Small_Image.expected.png
  3. BIN
      tests/TestFiles/Cairo/Media/ImageBrush/github_icon_small.png
  4. BIN
      tests/TestFiles/Direct2D1/Media/ImageBrush/ImageBrush_Tile_Small_Image.expected.png
  5. BIN
      tests/TestFiles/Direct2D1/Media/ImageBrush/github_icon_small.png
  6. BIN
      tests/TestFiles/Skia/Media/ImageBrush/ImageBrush_Tile_Small_Image.expected.png
  7. BIN
      tests/TestFiles/Skia/Media/ImageBrush/github_icon_small.png

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

@ -28,6 +28,11 @@ namespace Avalonia.Direct2D1.RenderTests.Media
get { return System.IO.Path.Combine(OutputPath, "github_icon.png"); }
}
private string SmallBitmapPath
{
get { return System.IO.Path.Combine(OutputPath, "github_icon_small.png"); }
}
[Fact]
public void ImageBrush_Tile_Fill()
{
@ -76,6 +81,29 @@ namespace Avalonia.Direct2D1.RenderTests.Media
CompareImages();
}
[Fact]
public void ImageBrush_Tile_Small_Image()
{
Decorator target = new Decorator
{
Width = 200,
Height = 200,
Child = new Rectangle
{
Margin = new Thickness(8),
Fill = new ImageBrush
{
Stretch = Stretch.None,
TileMode = TileMode.Tile,
Source = new Bitmap(SmallBitmapPath),
}
}
};
RenderToFile(target);
CompareImages();
}
[Fact]
public void ImageBrush_NoStretch_NoTile_Alignment_TopLeft()
{

BIN
tests/TestFiles/Cairo/Media/ImageBrush/ImageBrush_Tile_Small_Image.expected.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
tests/TestFiles/Cairo/Media/ImageBrush/github_icon_small.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 928 B

BIN
tests/TestFiles/Direct2D1/Media/ImageBrush/ImageBrush_Tile_Small_Image.expected.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
tests/TestFiles/Direct2D1/Media/ImageBrush/github_icon_small.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 928 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
tests/TestFiles/Skia/Media/ImageBrush/github_icon_small.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 928 B

Loading…
Cancel
Save