From 49e23bc07ff46d27bb2020d1ae04be654af81ab2 Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Tue, 28 Sep 2021 12:06:59 +0200 Subject: [PATCH] Use IRendererFactory in framebuffer backend. If an `IRendererFactory` is provided, use this to supply the renderer; otherwise fall back to the existing `DeferredRenderer`. --- .../Avalonia.LinuxFramebuffer/FramebufferToplevelImpl.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Linux/Avalonia.LinuxFramebuffer/FramebufferToplevelImpl.cs b/src/Linux/Avalonia.LinuxFramebuffer/FramebufferToplevelImpl.cs index b097e0917f..8688671d3b 100644 --- a/src/Linux/Avalonia.LinuxFramebuffer/FramebufferToplevelImpl.cs +++ b/src/Linux/Avalonia.LinuxFramebuffer/FramebufferToplevelImpl.cs @@ -30,10 +30,9 @@ namespace Avalonia.LinuxFramebuffer public IRenderer CreateRenderer(IRenderRoot root) { - return new DeferredRenderer(root, AvaloniaLocator.Current.GetService()) - { - - }; + var factory = AvaloniaLocator.Current.GetService(); + var renderLoop = AvaloniaLocator.Current.GetService(); + return factory?.Create(root, renderLoop) ?? new DeferredRenderer(root, renderLoop); } public void Dispose() @@ -41,7 +40,7 @@ namespace Avalonia.LinuxFramebuffer throw new NotSupportedException(); } - + public void Invalidate(Rect rect) { }