Skip to content

Commit

Permalink
use params where possible (#961)
Browse files Browse the repository at this point in the history
* use params where possible

* use params
  • Loading branch information
SimonCropp authored and JimBobSquarePants committed Aug 10, 2019
1 parent edeaf7d commit 16ed617
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 45 deletions.
14 changes: 6 additions & 8 deletions tests/ImageSharp.Benchmarks/Drawing/DrawBeziers.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Six Labors and contributors.
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.

using System.Drawing;
Expand Down Expand Up @@ -48,12 +48,10 @@ public void DrawLinesCore()
image.Mutate(x => x.DrawBeziers(
Rgba32.HotPink,
10,
new SixLabors.Primitives.PointF[] {
new Vector2(10, 500),
new Vector2(30, 10),
new Vector2(240, 30),
new Vector2(300, 500)
}));
new Vector2(10, 500),
new Vector2(30, 10),
new Vector2(240, 30),
new Vector2(300, 500)));

using (var stream = new MemoryStream())
{
Expand All @@ -62,4 +60,4 @@ public void DrawLinesCore()
}
}
}
}
}
12 changes: 5 additions & 7 deletions tests/ImageSharp.Benchmarks/Drawing/DrawLines.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Six Labors and contributors.
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.

using System.Drawing;
Expand Down Expand Up @@ -48,11 +48,9 @@ public void DrawLinesCore()
image.Mutate(x => x.DrawLines(
Rgba32.HotPink,
10,
new SixLabors.Primitives.PointF[] {
new Vector2(10, 10),
new Vector2(550, 50),
new Vector2(200, 400)
}));
new Vector2(10, 10),
new Vector2(550, 50),
new Vector2(200, 400)));

using (var stream = new MemoryStream())
{
Expand All @@ -61,4 +59,4 @@ public void DrawLinesCore()
}
}
}
}
}
12 changes: 5 additions & 7 deletions tests/ImageSharp.Benchmarks/Drawing/DrawPolygon.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Six Labors and contributors.
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.

using System.Drawing;
Expand Down Expand Up @@ -46,11 +46,9 @@ public void DrawPolygonCore()
image.Mutate(x => x.DrawPolygon(
Rgba32.HotPink,
10,
new SixLabors.Primitives.PointF[] {
new Vector2(10, 10),
new Vector2(550, 50),
new Vector2(200, 400)
}));
new Vector2(10, 10),
new Vector2(550, 50),
new Vector2(200, 400)));

using (var ms = new MemoryStream())
{
Expand All @@ -59,4 +57,4 @@ public void DrawPolygonCore()
}
}
}
}
}
10 changes: 4 additions & 6 deletions tests/ImageSharp.Benchmarks/Drawing/FillPolygon.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Six Labors and contributors.
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.

using System.Drawing;
Expand Down Expand Up @@ -54,11 +54,9 @@ public void DrawSolidPolygonCore()
{
image.Mutate(x => x.FillPolygon(
Rgba32.HotPink,
new SixLabors.Primitives.PointF[] {
new Vector2(10, 10),
new Vector2(550, 50),
new Vector2(200, 400)
}));
new Vector2(10, 10),
new Vector2(550, 50),
new Vector2(200, 400)));

using (var stream = new MemoryStream())
{
Expand Down
11 changes: 5 additions & 6 deletions tests/ImageSharp.Benchmarks/Drawing/FillRectangle.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Six Labors and contributors.
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.

using System.Drawing;
Expand Down Expand Up @@ -47,11 +47,10 @@ public CoreSize FillPolygonCore()
{
image.Mutate(x => x.FillPolygon(
Rgba32.HotPink,
new SixLabors.Primitives.PointF[] {
new Vector2(10, 10),
new Vector2(200, 10),
new Vector2(200, 150),
new Vector2(10, 150) }));
new Vector2(10, 10),
new Vector2(200, 10),
new Vector2(200, 150),
new Vector2(10, 150)));

return new CoreSize(image.Width, image.Height);
}
Expand Down
5 changes: 2 additions & 3 deletions tests/ImageSharp.Tests/Drawing/FillRegionProcessorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,9 @@ public void DrawOffCanvas()

using (var img = new Image<Rgba32>(10, 10))
{
img.Mutate(x => x.DrawLines(new Pen(Rgba32.Black, 10), new SixLabors.Primitives.PointF[] {
img.Mutate(x => x.DrawLines(new Pen(Rgba32.Black, 10),
new Vector2(-10, 5),
new Vector2(20, 5),
}));
new Vector2(20, 5)));
}
}

Expand Down
10 changes: 2 additions & 8 deletions tests/ImageSharp.Tests/Issues/Issue412.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,15 @@ public void AllPixelsExpectedToBeRedWhenAntialiasedDisabled<TPixel>(TestImagePro
new GraphicsOptions(false),
Color.Black,
1,
new[]
{
new PointF(i, 0.1066f),
new PointF(i, 10.1066f)
});
new PointF(i, 10.1066f));

context.DrawLines(
new GraphicsOptions(false),
Color.Red,
1,
new[]
{
new PointF(i, 15.1066f),
new PointF(i, 25.1066f)
});
new PointF(i, 25.1066f));
}
});

Expand Down

0 comments on commit 16ed617

Please sign in to comment.