From 3308863eb7e0619cec3c2b93012eef7cfd8aafbe Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Tue, 25 Oct 2016 19:58:37 +0200 Subject: [PATCH] Register an IRendererFactory on GTK. --- src/Gtk/Avalonia.Gtk/GtkPlatform.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Gtk/Avalonia.Gtk/GtkPlatform.cs b/src/Gtk/Avalonia.Gtk/GtkPlatform.cs index aaeba75b50..38bada2f25 100644 --- a/src/Gtk/Avalonia.Gtk/GtkPlatform.cs +++ b/src/Gtk/Avalonia.Gtk/GtkPlatform.cs @@ -28,7 +28,7 @@ namespace Avalonia.Gtk using Rendering; using Gtk = global::Gtk; - public class GtkPlatform : IPlatformThreadingInterface, IPlatformSettings, IWindowingPlatform, IPlatformIconLoader + public class GtkPlatform : IPlatformThreadingInterface, IPlatformSettings, IWindowingPlatform, IPlatformIconLoader, IRendererFactory { private static readonly GtkPlatform s_instance = new GtkPlatform(); private static Thread _uiThread; @@ -54,6 +54,7 @@ namespace Avalonia.Gtk .Bind().ToConstant(GtkMouseDevice.Instance) .Bind().ToConstant(s_instance) .Bind().ToConstant(s_instance) + .Bind().ToConstant(s_instance) .Bind().ToConstant(new DefaultRenderLoop(60)) .Bind().ToSingleton() .Bind().ToConstant(s_instance); @@ -112,6 +113,11 @@ namespace Avalonia.Gtk return new PopupImpl(); } + public IRenderer CreateRenderer(IRenderRoot root, IRenderLoop renderLoop) + { + return new Renderer(root, renderLoop); + } + public IWindowIconImpl LoadIcon(string fileName) { return new IconImpl(new Gdk.Pixbuf(fileName));