mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 03:48:56 +00:00
UI - Rename each OS assembly to Artemis 2
UI - Added auto-run UI - Added auto-update
This commit is contained in:
1 parent
20af5e9c21
commit
faf5302975
30 files changed
+1568
-192
No files matched your search
@@ -1,22 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using Artemis.Core.SkiaSharp;
|
||||
|
||||
namespace Artemis.Core.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a class that can provide one or more graphics <see cref="IManagedGraphicsContext"/> instances by name.
|
||||
/// </summary>
|
||||
public interface IGraphicsContextProvider
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets a read only collection containing the names of all the graphics contexts supported by this provider.
|
||||
/// </summary>
|
||||
IReadOnlyCollection<string> GraphicsContextNames { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a managed graphics context by name.
|
||||
/// </summary>
|
||||
/// <param name="name">The name of the graphics context.</param>
|
||||
/// <returns>If found, an instance of the managed graphics context with the given <paramref name="name"/>; otherwise <see langword="null"/>.</returns>
|
||||
IManagedGraphicsContext? GetGraphicsContext(string name);
|
||||
}
|
||||
@@ -4,6 +4,7 @@ using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using Artemis.Core.DeviceProviders;
|
||||
using Artemis.Core.Providers;
|
||||
using Artemis.Core.Services.Models;
|
||||
using Artemis.Core.SkiaSharp;
|
||||
using Artemis.Storage.Entities.Surface;
|
||||
@@ -363,15 +364,15 @@ namespace Artemis.Core.Services
|
||||
return;
|
||||
}
|
||||
|
||||
IGraphicsContextProvider? provider = _kernel.TryGet<IGraphicsContextProvider>();
|
||||
if (provider == null)
|
||||
List<IGraphicsContextProvider> providers = _kernel.Get<List<IGraphicsContextProvider>>();
|
||||
if (!providers.Any())
|
||||
{
|
||||
_logger.Warning("No graphics context provider found, defaulting to software rendering");
|
||||
UpdateGraphicsContext(null);
|
||||
return;
|
||||
}
|
||||
|
||||
IManagedGraphicsContext? context = provider.GetGraphicsContext(_preferredGraphicsContext.Value);
|
||||
IManagedGraphicsContext? context = providers.FirstOrDefault(p => p.GraphicsContextName == _preferredGraphicsContext.Value)?.GetGraphicsContext();
|
||||
if (context == null)
|
||||
{
|
||||
_logger.Warning("No graphics context named '{Context}' found, defaulting to software rendering", _preferredGraphicsContext.Value);
|
||||
|
||||
Reference in new issue
Block a user