mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 11:26:27 +00:00
Profiles - Tweaked render pipeline, improving render performance by ~40%
This commit is contained in:
1 parent
7735edea1e
commit
991c5fd955
11 files changed
+231
-207
No files matched your search
@@ -95,7 +95,7 @@ namespace Artemis.Core.LayerBrushes
|
||||
// but LayerBrush<T> and RgbNetLayerBrush<T> outside the core
|
||||
internal abstract void Initialize();
|
||||
|
||||
internal abstract void InternalRender(SKCanvas canvas, SKPath path, SKPaint paint);
|
||||
internal abstract void InternalRender(SKCanvas canvas, SKRect path, SKPaint paint);
|
||||
|
||||
internal virtual void Dispose(bool disposing)
|
||||
{
|
||||
|
||||
@@ -22,13 +22,13 @@ namespace Artemis.Core.LayerBrushes
|
||||
/// <para>Called during rendering or layer preview, in the order configured on the layer</para>
|
||||
/// </summary>
|
||||
/// <param name="canvas">The layer canvas</param>
|
||||
/// <param name="path">The path to be filled, represents the shape</param>
|
||||
/// <param name="bounds">The area to be filled, covers the shape</param>
|
||||
/// <param name="paint">The paint to be used to fill the shape</param>
|
||||
public abstract void Render(SKCanvas canvas, SKPath path, SKPaint paint);
|
||||
public abstract void Render(SKCanvas canvas, SKRect bounds, SKPaint paint);
|
||||
|
||||
internal override void InternalRender(SKCanvas canvas, SKPath path, SKPaint paint)
|
||||
internal override void InternalRender(SKCanvas canvas, SKRect bounds, SKPaint paint)
|
||||
{
|
||||
Render(canvas, path, paint);
|
||||
Render(canvas, bounds, paint);
|
||||
}
|
||||
|
||||
internal override void Initialize()
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace Artemis.Core.LayerBrushes
|
||||
/// <returns>The color the LED will receive</returns>
|
||||
public abstract SKColor GetColor(ArtemisLed led, SKPoint renderPoint);
|
||||
|
||||
internal override void InternalRender(SKCanvas canvas, SKPath path, SKPaint paint)
|
||||
internal override void InternalRender(SKCanvas canvas, SKRect bounds, SKPaint paint)
|
||||
{
|
||||
// We don't want rotation on this canvas because that'll displace the LEDs, translations are applied to the points of each LED instead
|
||||
if (Layer.General.TransformMode.CurrentValue == LayerTransformMode.Normal && SupportsTransformation)
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace Artemis.Core.LayerBrushes
|
||||
}
|
||||
|
||||
// Not used in this effect type
|
||||
internal override void InternalRender(SKCanvas canvas, SKPath path, SKPaint paint)
|
||||
internal override void InternalRender(SKCanvas canvas, SKRect bounds, SKPaint paint)
|
||||
{
|
||||
throw new NotImplementedException("RGB.NET layer effectes do not implement InternalRender");
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ namespace Artemis.Core.LayerEffects
|
||||
/// <param name="canvas">The canvas used to render the frame</param>
|
||||
/// <param name="renderBounds">The bounds this layer/folder will render in</param>
|
||||
/// <param name="paint">The paint this layer/folder will use to render</param>
|
||||
public abstract void PreProcess(SKCanvas canvas, SKPath renderBounds, SKPaint paint);
|
||||
public abstract void PreProcess(SKCanvas canvas, SKRect renderBounds, SKPaint paint);
|
||||
|
||||
/// <summary>
|
||||
/// Called after the layer of folder has been rendered
|
||||
@@ -140,7 +140,7 @@ namespace Artemis.Core.LayerEffects
|
||||
/// <param name="canvas">The canvas used to render the frame</param>
|
||||
/// <param name="renderBounds">The bounds this layer/folder rendered in</param>
|
||||
/// <param name="paint">The paint this layer/folder used to render</param>
|
||||
public abstract void PostProcess(SKCanvas canvas, SKPath renderBounds, SKPaint paint);
|
||||
public abstract void PostProcess(SKCanvas canvas, SKRect renderBounds, SKPaint paint);
|
||||
|
||||
// Not only is this needed to initialize properties on the layer effects, it also prevents implementing anything
|
||||
// but LayerEffect<T> outside the core
|
||||
|
||||
@@ -40,12 +40,12 @@ namespace Artemis.Core.LayerEffects.Placeholder
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void PreProcess(SKCanvas canvas, SKPath renderBounds, SKPaint paint)
|
||||
public override void PreProcess(SKCanvas canvas, SKRect bounds, SKPaint paint)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void PostProcess(SKCanvas canvas, SKPath renderBounds, SKPaint paint)
|
||||
public override void PostProcess(SKCanvas canvas, SKRect bounds, SKPaint paint)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user