Skip to content

Commit 76a8114

Browse files
Use nint
1 parent e050b92 commit 76a8114

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/ImageSharp.Drawing/Shapes/Rasterization/ScanEdgeCollection.Build.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ static void RoundY(ReadOnlySpan<PointF> vertices, Span<float> destination, float
9898
if (verticesLength > 0)
9999
{
100100
ri = vertices.Length - (remainder / 2);
101-
float maxIterations = verticesLength / (Vector256<float>.Count * 2);
101+
nint maxIterations = verticesLength / (Vector256<float>.Count * 2);
102102
ref Vector256<float> sourceBase = ref Unsafe.As<PointF, Vector256<float>>(ref MemoryMarshal.GetReference(vertices));
103103
ref Vector256<float> destinationBase = ref Unsafe.As<float, Vector256<float>>(ref MemoryMarshal.GetReference(destination));
104104

@@ -136,7 +136,7 @@ static void RoundY(ReadOnlySpan<PointF> vertices, Span<float> destination, float
136136
if (verticesLength > 0)
137137
{
138138
ri = vertices.Length - (remainder / 2);
139-
float maxIterations = verticesLength / (Vector128<float>.Count * 2);
139+
nint maxIterations = verticesLength / (Vector128<float>.Count * 2);
140140
ref Vector128<float> sourceBase = ref Unsafe.As<PointF, Vector128<float>>(ref MemoryMarshal.GetReference(vertices));
141141
ref Vector128<float> destinationBase = ref Unsafe.As<float, Vector128<float>>(ref MemoryMarshal.GetReference(destination));
142142

@@ -172,7 +172,7 @@ static void RoundY(ReadOnlySpan<PointF> vertices, Span<float> destination, float
172172
if (verticesLength > 0)
173173
{
174174
ri = vertices.Length - (remainder / 2);
175-
float maxIterations = verticesLength / (Vector128<float>.Count * 2);
175+
nint maxIterations = verticesLength / (Vector128<float>.Count * 2);
176176
ref Vector128<float> sourceBase = ref Unsafe.As<PointF, Vector128<float>>(ref MemoryMarshal.GetReference(vertices));
177177
ref Vector128<float> destinationBase = ref Unsafe.As<float, Vector128<float>>(ref MemoryMarshal.GetReference(destination));
178178

@@ -186,7 +186,7 @@ static void RoundY(ReadOnlySpan<PointF> vertices, Span<float> destination, float
186186
Vector128<float> points1 = Unsafe.Add(ref sourceBase, j);
187187
Vector128<float> points2 = Unsafe.Add(ref sourceBase, j + 1);
188188

189-
// Shuffle the points to group the Y properties
189+
// Shuffle the points to group the Y
190190
Vector128<float> pointsY = AdvSimdShuffle(points1, points2, 0b11_01_11_01);
191191

192192
// Multiply by the subsampling ratio, round, then multiply by the inverted subsampling ratio and assign.

tests/ImageSharp.Drawing.Benchmarks/Drawing/Rounding.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ private static void RoundYAvx(ReadOnlySpan<PointF> vertices, Span<float> destina
5252
if (verticesLength > 0)
5353
{
5454
ri = vertices.Length - (remainder / 2);
55-
float maxIterations = verticesLength / (Vector256<float>.Count * 2);
55+
nint maxIterations = verticesLength / (Vector256<float>.Count * 2);
5656
ref Vector256<float> sourceBase = ref Unsafe.As<PointF, Vector256<float>>(ref MemoryMarshal.GetReference(vertices));
5757
ref Vector256<float> destinationBase = ref Unsafe.As<float, Vector256<float>>(ref MemoryMarshal.GetReference(destination));
5858

@@ -99,7 +99,7 @@ private static void RoundYSse41(ReadOnlySpan<PointF> vertices, Span<float> desti
9999
if (verticesLength > 0)
100100
{
101101
ri = vertices.Length - (remainder / 2);
102-
float maxIterations = verticesLength / (Vector128<float>.Count * 2);
102+
nint maxIterations = verticesLength / (Vector128<float>.Count * 2);
103103
ref Vector128<float> sourceBase = ref Unsafe.As<PointF, Vector128<float>>(ref MemoryMarshal.GetReference(vertices));
104104
ref Vector128<float> destinationBase = ref Unsafe.As<float, Vector128<float>>(ref MemoryMarshal.GetReference(destination));
105105

0 commit comments

Comments
 (0)