Ver Fonte

Fix mocks

Benedikt Stebner há 3 anos atrás
pai
commit
020c8de59e

+ 7 - 0
src/Avalonia.Headless/HeadlessPlatformRenderInterface.cs

@@ -114,6 +114,13 @@ namespace Avalonia.Headless
             return new HeadlessGlyphRunStub();
         }
 
+        public IGeometryImpl BuildGlyphRunGeometry(GlyphRun glyphRun, out Matrix scale)
+        {
+            scale = Matrix.Identity;
+
+            return new HeadlessGeometryStub(new Rect(glyphRun.Size));
+        }
+
         class HeadlessGeometryStub : IGeometryImpl
         {
             public HeadlessGeometryStub(Rect bounds)

+ 5 - 0
tests/Avalonia.Base.UnitTests/VisualTree/MockRenderInterface.cs

@@ -121,6 +121,11 @@ namespace Avalonia.Base.UnitTests.VisualTree
             throw new NotImplementedException();
         }
 
+        public IGeometryImpl BuildGlyphRunGeometry(GlyphRun glyphRun, out Matrix scale)
+        {
+            throw new NotImplementedException();
+        }
+
         class MockStreamGeometry : IStreamGeometryImpl
         {
             private MockStreamGeometryContext _impl = new MockStreamGeometryContext();

+ 5 - 0
tests/Avalonia.Benchmarks/NullRenderingPlatform.cs

@@ -117,6 +117,11 @@ namespace Avalonia.Benchmarks
             return new NullGlyphRun();
         }
 
+        public IGeometryImpl BuildGlyphRunGeometry(GlyphRun glyphRun, out Matrix scale)
+        {
+            throw new NotImplementedException();
+        }
+
         public bool SupportsIndividualRoundRects => true;
 
         public AlphaFormat DefaultAlphaFormat => AlphaFormat.Premul;

+ 7 - 0
tests/Avalonia.UnitTests/MockPlatformRenderInterface.cs

@@ -122,6 +122,13 @@ namespace Avalonia.UnitTests
             return Mock.Of<IGlyphRunImpl>();
         }
 
+        public IGeometryImpl BuildGlyphRunGeometry(GlyphRun glyphRun, out Matrix scale)
+        {
+            scale = Matrix.Identity;
+
+            return Mock.Of<IGeometryImpl>();
+        }
+
         public bool SupportsIndividualRoundRects { get; set; }
 
         public AlphaFormat DefaultAlphaFormat => AlphaFormat.Premul;