Nikita Tsukanov
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
12 additions and
1 deletions
-
src/Linux/Avalonia.LinuxFramebuffer/LinuxFramebufferPlatform.cs
-
src/Linux/Avalonia.LinuxFramebuffer/LinuxFramebufferPlatformOptions.cs
|
|
|
@ -60,9 +60,13 @@ namespace Avalonia.LinuxFramebuffer |
|
|
|
|
|
|
|
var opts = AvaloniaLocator.Current.GetService<LinuxFramebufferPlatformOptions>() ?? new LinuxFramebufferPlatformOptions(); |
|
|
|
|
|
|
|
var timer = opts.ShouldRenderOnUIThread |
|
|
|
? new UiThreadRenderTimer(opts.Fps) |
|
|
|
: new DefaultRenderTimer(opts.Fps); |
|
|
|
|
|
|
|
AvaloniaLocator.CurrentMutable |
|
|
|
.Bind<IDispatcherImpl>().ToConstant(new ManagedDispatcherImpl(new ManualRawEventGrouperDispatchQueueDispatcherInputProvider(EventGrouperDispatchQueue))) |
|
|
|
.Bind<IRenderTimer>().ToConstant(new DefaultRenderTimer(opts.Fps)) |
|
|
|
.Bind<IRenderTimer>().ToConstant(timer) |
|
|
|
.Bind<ICursorFactory>().ToTransient<CursorFactoryStub>() |
|
|
|
.Bind<IKeyboardDevice>().ToConstant(new KeyboardDevice()) |
|
|
|
.Bind<IPlatformIconLoader>().ToSingleton<LinuxFramebufferIconLoaderStub>() |
|
|
|
|
|
|
|
@ -10,5 +10,12 @@ |
|
|
|
/// Default 60.
|
|
|
|
/// </summary>
|
|
|
|
public int Fps { get; set; } = 60; |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Render directly on the UI thread instead of using a dedicated render thread.
|
|
|
|
/// This can be usable if your device don't have multiple cores to begin with.
|
|
|
|
/// This setting is false by default.
|
|
|
|
/// </summary>
|
|
|
|
public bool ShouldRenderOnUIThread { get; set; } |
|
|
|
} |
|
|
|
} |
|
|
|
|