Skip to content

Commit e058bf3

Browse files
Use PNG for comparison
1 parent e1c2605 commit e058bf3

5 files changed

Lines changed: 14 additions & 17 deletions

File tree

tests/ImageSharp.Drawing.Tests/Processing/ProcessWithDrawingCanvasTests.Polygons.cs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,6 @@ public void FillPolygon_EllipsePolygon<TPixel>(TestImageProvider<TPixel> provide
366366
public void FillPolygon_IntersectionRules_OddEven<TPixel>(TestImageProvider<TPixel> provider)
367367
where TPixel : unmanaged, IPixel<TPixel>
368368
{
369-
using Image<TPixel> img = provider.GetImage();
370369
Polygon poly = new(new LinearLineSegment(
371370
new PointF(10, 30),
372371
new PointF(10, 20),
@@ -385,19 +384,17 @@ public void FillPolygon_IntersectionRules_OddEven<TPixel>(TestImageProvider<TPix
385384
ShapeOptions = new ShapeOptions { IntersectionRule = IntersectionRule.EvenOdd }
386385
};
387386

388-
img.Mutate(c => c.ProcessWithCanvas(options, canvas => canvas.Fill(Brushes.Solid(Color.HotPink), poly)));
389-
390-
provider.Utility.SaveTestOutputFile(img);
391-
Assert.Equal(Color.Blue.ToPixel<TPixel>(), img[25, 25]);
387+
provider.RunValidatingProcessorTest(
388+
c => c.ProcessWithCanvas(options, canvas => canvas.Fill(Brushes.Solid(Color.HotPink), poly)),
389+
appendPixelTypeToFileName: false,
390+
appendSourceFileOrDescription: false);
392391
}
393392

394393
[Theory]
395394
[WithSolidFilledImages(60, 60, "Blue", PixelTypes.Rgba32)]
396395
public void FillPolygon_IntersectionRules_Nonzero<TPixel>(TestImageProvider<TPixel> provider)
397396
where TPixel : unmanaged, IPixel<TPixel>
398397
{
399-
Configuration.Default.MaxDegreeOfParallelism = 1;
400-
using Image<TPixel> img = provider.GetImage();
401398
Polygon poly = new(new LinearLineSegment(
402399
new PointF(10, 30),
403400
new PointF(10, 20),
@@ -416,9 +413,9 @@ public void FillPolygon_IntersectionRules_Nonzero<TPixel>(TestImageProvider<TPix
416413
ShapeOptions = new ShapeOptions { IntersectionRule = IntersectionRule.NonZero }
417414
};
418415

419-
img.Mutate(c => c.ProcessWithCanvas(options, canvas => canvas.Fill(Brushes.Solid(Color.HotPink), poly)));
420-
421-
provider.Utility.SaveTestOutputFile(img);
422-
Assert.Equal(Color.HotPink.ToPixel<TPixel>(), img[25, 25]);
416+
provider.RunValidatingProcessorTest(
417+
c => c.ProcessWithCanvas(options, canvas => canvas.Fill(Brushes.Solid(Color.HotPink), poly)),
418+
appendPixelTypeToFileName: false,
419+
appendSourceFileOrDescription: false);
423420
}
424421
}
Lines changed: 3 additions & 0 deletions
Loading

tests/Images/ReferenceOutput/Drawing/ProcessWithDrawingCanvasTests/FillPolygon_IntersectionRules_Nonzero_Rgba32_Solid60x60_(0,0,255,255).bmp

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 3 additions & 0 deletions
Loading

tests/Images/ReferenceOutput/Drawing/ProcessWithDrawingCanvasTests/FillPolygon_IntersectionRules_OddEven_Rgba32_Solid60x60_(0,0,255,255).bmp

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)