diff --git a/src/Artemis.Core/Artemis.Core.csproj b/src/Artemis.Core/Artemis.Core.csproj
index f4e4d85f2..01eb20f15 100644
--- a/src/Artemis.Core/Artemis.Core.csproj
+++ b/src/Artemis.Core/Artemis.Core.csproj
@@ -43,9 +43,9 @@
-
-
-
+
+
+
diff --git a/src/Artemis.Core/RGB.NET/SKTexture.cs b/src/Artemis.Core/RGB.NET/SKTexture.cs
index 70d6a1f84..3cb3a249c 100644
--- a/src/Artemis.Core/RGB.NET/SKTexture.cs
+++ b/src/Artemis.Core/RGB.NET/SKTexture.cs
@@ -1,5 +1,4 @@
using System;
-using System.Buffers;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using Artemis.Core.SkiaSharp;
@@ -56,31 +55,12 @@ public sealed class SKTexture : PixelTexture, IDisposable
if (skRectI.Width <= 0 || skRectI.Height <= 0)
return Color.Transparent;
- int bufferSize = skRectI.Width * skRectI.Height * DATA_PER_PIXEL;
- if (bufferSize <= STACK_ALLOC_LIMIT)
- {
- Span buffer = stackalloc byte[bufferSize];
- GetRegionData(skRectI.Left, skRectI.Top, skRectI.Width, skRectI.Height, buffer);
+ SamplerInfo samplerInfo = new(skRectI.Left, skRectI.Top, skRectI.Width, skRectI.Height, Stride, DataPerPixel, Data);
- Span pixelData = stackalloc byte[DATA_PER_PIXEL];
- Sampler.Sample(new SamplerInfo(skRectI.Width, skRectI.Height, buffer), pixelData);
+ Span pixelData = stackalloc byte[DATA_PER_PIXEL];
+ Sampler.Sample(samplerInfo, pixelData);
- return GetColor(pixelData);
- }
- else
- {
- byte[] rent = ArrayPool.Shared.Rent(bufferSize);
-
- Span buffer = new Span(rent).Slice(0, bufferSize);
- GetRegionData(skRectI.Left, skRectI.Top, skRectI.Width, skRectI.Height, buffer);
-
- Span pixelData = stackalloc byte[DATA_PER_PIXEL];
- Sampler.Sample(new SamplerInfo(skRectI.Width, skRectI.Height, buffer), pixelData);
-
- ArrayPool.Shared.Return(rent);
-
- return GetColor(pixelData);
- }
+ return GetColor(pixelData);
}
private void ReleaseUnmanagedResources()
@@ -106,7 +86,6 @@ public sealed class SKTexture : PixelTexture, IDisposable
#region Constants
- private const int STACK_ALLOC_LIMIT = 1024;
private const int DATA_PER_PIXEL = 4;
#endregion
diff --git a/src/Artemis.UI.Shared/Artemis.UI.Shared.csproj b/src/Artemis.UI.Shared/Artemis.UI.Shared.csproj
index 35cf357d8..dc4d46327 100644
--- a/src/Artemis.UI.Shared/Artemis.UI.Shared.csproj
+++ b/src/Artemis.UI.Shared/Artemis.UI.Shared.csproj
@@ -20,7 +20,7 @@
-
+
diff --git a/src/Artemis.UI/Artemis.UI.csproj b/src/Artemis.UI/Artemis.UI.csproj
index 4e5a5ccde..54ed78f98 100644
--- a/src/Artemis.UI/Artemis.UI.csproj
+++ b/src/Artemis.UI/Artemis.UI.csproj
@@ -33,8 +33,8 @@
-
-
+
+