diff --git a/src/Skia/Avalonia.Skia/DrawingContextImpl.cs b/src/Skia/Avalonia.Skia/DrawingContextImpl.cs index c54643a8daa..0a6a2187a35 100644 --- a/src/Skia/Avalonia.Skia/DrawingContextImpl.cs +++ b/src/Skia/Avalonia.Skia/DrawingContextImpl.cs @@ -1072,14 +1072,14 @@ private void ConfigureTileBrush(ref PaintWrapper paintWrapper, Rect targetBox, I SKShaderTileMode tileX = tileBrush.TileMode == TileMode.None - ? SKShaderTileMode.Clamp + ? SKShaderTileMode.Decal : tileBrush.TileMode == TileMode.FlipX || tileBrush.TileMode == TileMode.FlipXY ? SKShaderTileMode.Mirror : SKShaderTileMode.Repeat; SKShaderTileMode tileY = tileBrush.TileMode == TileMode.None - ? SKShaderTileMode.Clamp + ? SKShaderTileMode.Decal : tileBrush.TileMode == TileMode.FlipY || tileBrush.TileMode == TileMode.FlipXY ? SKShaderTileMode.Mirror : SKShaderTileMode.Repeat; @@ -1225,14 +1225,14 @@ private void ConfigureSceneBrushContentWithPicture(ref PaintWrapper paintWrapper SKShaderTileMode tileX = tileBrush.TileMode == TileMode.None - ? SKShaderTileMode.Clamp + ? SKShaderTileMode.Decal : tileBrush.TileMode == TileMode.FlipX || tileBrush.TileMode == TileMode.FlipXY ? SKShaderTileMode.Mirror : SKShaderTileMode.Repeat; SKShaderTileMode tileY = tileBrush.TileMode == TileMode.None - ? SKShaderTileMode.Clamp + ? SKShaderTileMode.Decal : tileBrush.TileMode == TileMode.FlipY || tileBrush.TileMode == TileMode.FlipXY ? SKShaderTileMode.Mirror : SKShaderTileMode.Repeat; diff --git a/tests/Avalonia.RenderTests/CrossTests/Brushes/CrossTileBrushTests.cs b/tests/Avalonia.RenderTests/CrossTests/Brushes/CrossTileBrushTests.cs index 13d4930bc97..db5a75e02b8 100644 --- a/tests/Avalonia.RenderTests/CrossTests/Brushes/CrossTileBrushTests.cs +++ b/tests/Avalonia.RenderTests/CrossTests/Brushes/CrossTileBrushTests.cs @@ -108,6 +108,38 @@ public void Should_Render_Aligned_TileBrush() } + [CrossFact] + public void Should_Render_TileBrush_With_TileMode_None() + { + var brush = new CrossDrawingBrush + { + TileMode = TileMode.None, + Stretch = Stretch.Fill, + Viewbox = new Rect(0, 0, 50, 50), + ViewboxUnits = BrushMappingMode.Absolute, + Viewport = new Rect(0, 0, 50, 50), + ViewportUnits = BrushMappingMode.Absolute, + Drawing = new CrossDrawingGroup() + { + Children = new List() + { + new CrossGeometryDrawing(new CrossRectangleGeometry(new(0, 0, 50, 50))) + { + Brush = new CrossSolidColorBrush(Colors.Crimson) + }, + } + } + }; + + RenderAndCompare(new CrossControl() + { + Width = 200, + Height = 200, + Background = brush + }); + + } + [CrossFact] public void Should_Render_With_Transform() { diff --git a/tests/TestFiles/CrossTests/Media/TileBrushes/Should_Render_TileBrush_With_TileMode_None.wpf.png b/tests/TestFiles/CrossTests/Media/TileBrushes/Should_Render_TileBrush_With_TileMode_None.wpf.png new file mode 100644 index 00000000000..7c4a13b7bd4 Binary files /dev/null and b/tests/TestFiles/CrossTests/Media/TileBrushes/Should_Render_TileBrush_With_TileMode_None.wpf.png differ