瀏覽代碼

Added in-tree visual brush test.

Expected output is slightly wonky - need to investigate that once
stuff's working in general.
Steven Kirk 8 年之前
父節點
當前提交
24635ea218

+ 36 - 0
tests/Avalonia.RenderTests/Media/VisualBrushTests.cs

@@ -425,5 +425,41 @@ namespace Avalonia.Direct2D1.RenderTests.Media
             RenderToFile(target);
             CompareImages();
         }
+
+        [Fact]
+        public void VisualBrush_InTree_Visual()
+        {
+            TextBlock source;
+            Decorator target = new Decorator
+            {
+                Padding = new Thickness(8),
+                Width = 200,
+                Height = 200,
+                Child = new Grid
+                {
+                    RowDefinitions = new RowDefinitions("Auto,*"),
+                    Children =
+                    {
+                        (source = new TextBlock
+                        {
+                            HorizontalAlignment = HorizontalAlignment.Left,
+                            Text = "Visual"
+                        }),
+                        new Rectangle
+                        {
+                            Fill = new VisualBrush
+                            {
+                                Stretch = Stretch.Uniform,
+                                Visual = source,
+                            },
+                            [Grid.RowProperty] = 1,
+                        }
+                    }
+                }
+            };
+
+            RenderToFile(target);
+            CompareImages();
+        }
     }
 }

二進制
tests/TestFiles/Direct2D1/Media/VisualBrush/VisualBrush_InTree_Visual.expected.png