Skip to content

Commit 8cb551e

Browse files
committed
Added aggresive inline to GetColor in SKTexture
1 parent 1b23607 commit 8cb551e

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/Artemis.Core/RGB.NET/SKTexture.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.Runtime.CompilerServices;
34
using System.Runtime.InteropServices;
45
using Artemis.Core.SkiaSharp;
56
using RGB.NET.Core;
@@ -107,10 +108,8 @@ internal void CopyPixelData()
107108
}
108109

109110
/// <inheritdoc />
110-
protected override Color GetColor(in ReadOnlySpan<byte> pixel)
111-
{
112-
return new Color(pixel[2], pixel[1], pixel[0]);
113-
}
111+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
112+
protected override Color GetColor(in ReadOnlySpan<byte> pixel) => new(pixel[2], pixel[1], pixel[0]);
114113

115114
/// <inheritdoc />
116115
public override Color this[in Rectangle rectangle] => Color.Transparent;

0 commit comments

Comments
 (0)