Implemented most of the rendering pipeline in SkiaSharp

This commit is contained in:
SpoinkyNL committed 2019-12-03 00:09:32 +01:00
1 parent 0e3afef6ca
commit 07b2ad87c4
35 files changed
+234 -274

No files matched your search

+15 -13
View File
@@ -30,6 +30,7 @@ namespace Artemis.Core.Services
_targetFrameRateSetting = settingsService.GetSetting("Core.TargetFrameRate", 25);
Surface = RGBSurface.Instance;
GraphicsDecorator = new GraphicsDecorator(new ListLedGroup(), 1);
// Let's throw these for now
Surface.Exception += SurfaceOnException;
@@ -100,21 +101,22 @@ namespace Artemis.Core.Services
public void UpdateGraphicsDecorator()
{
// TODO: Create new one first, then clean up the old one for a smoother transition
// Clean up the old background if present
if (_background != null)
lock (GraphicsDecorator)
{
_background.Brush?.RemoveAllDecorators();
_background.Detach();
// Clean up the old background if present
if (_background != null)
{
_background.Brush?.RemoveAllDecorators();
_background.Detach();
}
// Apply the application wide brush and decorator
_background = new ListLedGroup(Surface.Leds) {Brush = new SolidColorBrush(new Color(255, 255, 255, 255))};
GraphicsDecorator = new GraphicsDecorator(_background, _renderScaleSetting.Value);
_background.Brush.RemoveAllDecorators();
_background.Brush.AddDecorator(GraphicsDecorator);
}
// Apply the application wide brush and decorator
_background = new ListLedGroup(Surface.Leds) {Brush = new SolidColorBrush(new Color(255, 255, 255, 255))};
GraphicsDecorator = new GraphicsDecorator(_background, _renderScaleSetting.Value);
_background.Brush.RemoveAllDecorators();
_background.Brush.AddDecorator(GraphicsDecorator);
}
private void OnDeviceLoaded(DeviceEventArgs e)