From a8b26a41eca7cfbb29a199c9cd639084943c1b93 Mon Sep 17 00:00:00 2001 From: Lauri Kotilainen Date: Fri, 12 Jan 2018 14:28:43 +0200 Subject: [PATCH] - Use Configuration.Default.MemoryManager in tests --- .../Color/Bulk/PackFromVector4.cs | 4 +- .../Bulk/PackFromVector4ReferenceVsPointer.cs | 4 +- .../Color/Bulk/PackFromXyzw.cs | 4 +- .../Color/Bulk/ToVector4.cs | 4 +- .../ImageSharp.Benchmarks/Color/Bulk/ToXyz.cs | 4 +- .../Color/Bulk/ToXyzw.cs | 4 +- .../General/ClearBuffer.cs | 2 +- .../General/IterateArray.cs | 2 +- .../General/PixelIndexing.cs | 2 +- .../Image/EncodeIndexedPng.cs | 10 ++--- .../ImageSharp.Benchmarks/Image/EncodePng.cs | 2 +- .../Image/Jpeg/YCbCrColorConversion.cs | 2 +- .../PixelBlenders/PorterDuffBulkVsPixel.cs | 6 +-- tests/ImageSharp.Benchmarks/Samplers/Glow.cs | 4 +- .../Drawing/Paths/ShapeRegionTests.cs | 16 ++++---- .../Jpg/Block8x8FTests.CopyToBufferArea.cs | 4 +- .../Jpg/JpegImagePostProcessorTests.cs | 6 +-- .../Jpg/Utils/LibJpegTools.ComponentData.cs | 2 +- .../Formats/Png/PngEncoderTests.cs | 4 +- .../Formats/Png/PngSmokeTests.cs | 4 +- .../Image/ImageFramesCollectionTests.cs | 40 +++++++++---------- tests/ImageSharp.Tests/Image/ImageTests.cs | 2 +- .../ImageSharp.Tests/Memory/Buffer2DTests.cs | 10 ++--- .../Memory/BufferAreaTests.cs | 4 +- tests/ImageSharp.Tests/Memory/BufferTests.cs | 22 +++++----- .../Memory/SpanUtilityTests.cs | 2 +- .../PixelFormats/PixelOperationsTests.cs | 6 +-- .../Transforms/ResizeProfilingBenchmarks.cs | 2 +- .../ReferenceCodecs/SystemDrawingBridge.cs | 12 +++--- .../Tests/ReferenceCodecTests.cs | 2 +- 30 files changed, 96 insertions(+), 96 deletions(-) diff --git a/tests/ImageSharp.Benchmarks/Color/Bulk/PackFromVector4.cs b/tests/ImageSharp.Benchmarks/Color/Bulk/PackFromVector4.cs index e00b94a2e3..1f660466df 100644 --- a/tests/ImageSharp.Benchmarks/Color/Bulk/PackFromVector4.cs +++ b/tests/ImageSharp.Benchmarks/Color/Bulk/PackFromVector4.cs @@ -22,8 +22,8 @@ namespace SixLabors.ImageSharp.Benchmarks.Color.Bulk [GlobalSetup] public void Setup() { - this.destination = MemoryManager.Current.Allocate(this.Count); - this.source = MemoryManager.Current.Allocate(this.Count); + this.destination = Configuration.Default.MemoryManager.Allocate(this.Count); + this.source = Configuration.Default.MemoryManager.Allocate(this.Count); } [GlobalCleanup] diff --git a/tests/ImageSharp.Benchmarks/Color/Bulk/PackFromVector4ReferenceVsPointer.cs b/tests/ImageSharp.Benchmarks/Color/Bulk/PackFromVector4ReferenceVsPointer.cs index 593291dedd..fd96c02cd3 100644 --- a/tests/ImageSharp.Benchmarks/Color/Bulk/PackFromVector4ReferenceVsPointer.cs +++ b/tests/ImageSharp.Benchmarks/Color/Bulk/PackFromVector4ReferenceVsPointer.cs @@ -25,8 +25,8 @@ [GlobalSetup] public void Setup() { - this.destination = MemoryManager.Current.Allocate(this.Count); - this.source = MemoryManager.Current.Allocate(this.Count * 4); + this.destination = Configuration.Default.MemoryManager.Allocate(this.Count); + this.source = Configuration.Default.MemoryManager.Allocate(this.Count * 4); this.source.Pin(); this.destination.Pin(); } diff --git a/tests/ImageSharp.Benchmarks/Color/Bulk/PackFromXyzw.cs b/tests/ImageSharp.Benchmarks/Color/Bulk/PackFromXyzw.cs index d273124b89..eab65bb33a 100644 --- a/tests/ImageSharp.Benchmarks/Color/Bulk/PackFromXyzw.cs +++ b/tests/ImageSharp.Benchmarks/Color/Bulk/PackFromXyzw.cs @@ -19,8 +19,8 @@ namespace SixLabors.ImageSharp.Benchmarks.Color.Bulk [GlobalSetup] public void Setup() { - this.destination = MemoryManager.Current.Allocate(this.Count); - this.source = MemoryManager.Current.Allocate(this.Count * 4); + this.destination = Configuration.Default.MemoryManager.Allocate(this.Count); + this.source = Configuration.Default.MemoryManager.Allocate(this.Count * 4); } [GlobalCleanup] diff --git a/tests/ImageSharp.Benchmarks/Color/Bulk/ToVector4.cs b/tests/ImageSharp.Benchmarks/Color/Bulk/ToVector4.cs index 7e29dfe3a8..f9ecc9635e 100644 --- a/tests/ImageSharp.Benchmarks/Color/Bulk/ToVector4.cs +++ b/tests/ImageSharp.Benchmarks/Color/Bulk/ToVector4.cs @@ -21,8 +21,8 @@ namespace SixLabors.ImageSharp.Benchmarks.Color.Bulk [GlobalSetup] public void Setup() { - this.source = MemoryManager.Current.Allocate(this.Count); - this.destination = MemoryManager.Current.Allocate(this.Count); + this.source = Configuration.Default.MemoryManager.Allocate(this.Count); + this.destination = Configuration.Default.MemoryManager.Allocate(this.Count); } [GlobalCleanup] diff --git a/tests/ImageSharp.Benchmarks/Color/Bulk/ToXyz.cs b/tests/ImageSharp.Benchmarks/Color/Bulk/ToXyz.cs index adc374c1fb..8475a9e822 100644 --- a/tests/ImageSharp.Benchmarks/Color/Bulk/ToXyz.cs +++ b/tests/ImageSharp.Benchmarks/Color/Bulk/ToXyz.cs @@ -19,8 +19,8 @@ namespace SixLabors.ImageSharp.Benchmarks.Color.Bulk [GlobalSetup] public void Setup() { - this.source = MemoryManager.Current.Allocate(this.Count); - this.destination = MemoryManager.Current.Allocate(this.Count * 3); + this.source = Configuration.Default.MemoryManager.Allocate(this.Count); + this.destination = Configuration.Default.MemoryManager.Allocate(this.Count * 3); } [GlobalCleanup] diff --git a/tests/ImageSharp.Benchmarks/Color/Bulk/ToXyzw.cs b/tests/ImageSharp.Benchmarks/Color/Bulk/ToXyzw.cs index bead1384b2..b3e0eff14d 100644 --- a/tests/ImageSharp.Benchmarks/Color/Bulk/ToXyzw.cs +++ b/tests/ImageSharp.Benchmarks/Color/Bulk/ToXyzw.cs @@ -24,8 +24,8 @@ namespace SixLabors.ImageSharp.Benchmarks.Color.Bulk [GlobalSetup] public void Setup() { - this.source = MemoryManager.Current.Allocate(this.Count); - this.destination = MemoryManager.Current.Allocate(this.Count * 4); + this.source = Configuration.Default.MemoryManager.Allocate(this.Count); + this.destination = Configuration.Default.MemoryManager.Allocate(this.Count * 4); } [GlobalCleanup] diff --git a/tests/ImageSharp.Benchmarks/General/ClearBuffer.cs b/tests/ImageSharp.Benchmarks/General/ClearBuffer.cs index 47c8125543..6926d92536 100644 --- a/tests/ImageSharp.Benchmarks/General/ClearBuffer.cs +++ b/tests/ImageSharp.Benchmarks/General/ClearBuffer.cs @@ -18,7 +18,7 @@ namespace SixLabors.ImageSharp.Benchmarks.General [GlobalSetup] public void Setup() { - this.buffer = MemoryManager.Current.Allocate(this.Count); + this.buffer = Configuration.Default.MemoryManager.Allocate(this.Count); } [GlobalCleanup] diff --git a/tests/ImageSharp.Benchmarks/General/IterateArray.cs b/tests/ImageSharp.Benchmarks/General/IterateArray.cs index 383e7080ca..e06d71f4a0 100644 --- a/tests/ImageSharp.Benchmarks/General/IterateArray.cs +++ b/tests/ImageSharp.Benchmarks/General/IterateArray.cs @@ -21,7 +21,7 @@ namespace SixLabors.ImageSharp.Benchmarks.General [GlobalSetup] public void Setup() { - this.buffer = MemoryManager.Current.Allocate(this.Length); + this.buffer = Configuration.Default.MemoryManager.Allocate(this.Length); this.buffer.Pin(); this.array = new Vector4[this.Length]; } diff --git a/tests/ImageSharp.Benchmarks/General/PixelIndexing.cs b/tests/ImageSharp.Benchmarks/General/PixelIndexing.cs index 58f835a076..50e0bd6100 100644 --- a/tests/ImageSharp.Benchmarks/General/PixelIndexing.cs +++ b/tests/ImageSharp.Benchmarks/General/PixelIndexing.cs @@ -149,7 +149,7 @@ public void Setup() { this.width = 2048; - this.buffer = MemoryManager.Current.Allocate2D(2048, 2048); + this.buffer = Configuration.Default.MemoryManager.Allocate2D(2048, 2048); this.pointer = (Vector4*)this.buffer.Buffer.Pin(); this.array = this.buffer.Buffer.Array; this.pinnable = Unsafe.As>(this.array); diff --git a/tests/ImageSharp.Benchmarks/Image/EncodeIndexedPng.cs b/tests/ImageSharp.Benchmarks/Image/EncodeIndexedPng.cs index 70ea164d69..b4f78bee85 100644 --- a/tests/ImageSharp.Benchmarks/Image/EncodeIndexedPng.cs +++ b/tests/ImageSharp.Benchmarks/Image/EncodeIndexedPng.cs @@ -54,7 +54,7 @@ namespace SixLabors.ImageSharp.Benchmarks.Image { using (MemoryStream memoryStream = new MemoryStream()) { - PngEncoder encoder = new PngEncoder() { Quantizer = new OctreeQuantizer(), PaletteSize = 256 }; + PngEncoder encoder = new PngEncoder(Configuration.Default.MemoryManager) { Quantizer = new OctreeQuantizer(), PaletteSize = 256 }; this.bmpCore.SaveAsPng(memoryStream, encoder); } @@ -65,7 +65,7 @@ namespace SixLabors.ImageSharp.Benchmarks.Image { using (MemoryStream memoryStream = new MemoryStream()) { - PngEncoder options = new PngEncoder { Quantizer = new OctreeQuantizer { Dither = false }, PaletteSize = 256 }; + PngEncoder options = new PngEncoder(Configuration.Default.MemoryManager) { Quantizer = new OctreeQuantizer { Dither = false }, PaletteSize = 256 }; this.bmpCore.SaveAsPng(memoryStream, options); } @@ -76,7 +76,7 @@ namespace SixLabors.ImageSharp.Benchmarks.Image { using (MemoryStream memoryStream = new MemoryStream()) { - PngEncoder options = new PngEncoder { Quantizer = new PaletteQuantizer(), PaletteSize = 256 }; + PngEncoder options = new PngEncoder(Configuration.Default.MemoryManager) { Quantizer = new PaletteQuantizer(), PaletteSize = 256 }; this.bmpCore.SaveAsPng(memoryStream, options); } @@ -87,7 +87,7 @@ namespace SixLabors.ImageSharp.Benchmarks.Image { using (MemoryStream memoryStream = new MemoryStream()) { - PngEncoder options = new PngEncoder { Quantizer = new PaletteQuantizer { Dither = false }, PaletteSize = 256 }; + PngEncoder options = new PngEncoder(Configuration.Default.MemoryManager) { Quantizer = new PaletteQuantizer { Dither = false }, PaletteSize = 256 }; this.bmpCore.SaveAsPng(memoryStream, options); } @@ -98,7 +98,7 @@ namespace SixLabors.ImageSharp.Benchmarks.Image { using (MemoryStream memoryStream = new MemoryStream()) { - PngEncoder options = new PngEncoder() { Quantizer = new WuQuantizer(), PaletteSize = 256 }; + PngEncoder options = new PngEncoder(Configuration.Default.MemoryManager) { Quantizer = new WuQuantizer(), PaletteSize = 256 }; this.bmpCore.SaveAsPng(memoryStream, options); } diff --git a/tests/ImageSharp.Benchmarks/Image/EncodePng.cs b/tests/ImageSharp.Benchmarks/Image/EncodePng.cs index b3c1e4ee95..383505e0d1 100644 --- a/tests/ImageSharp.Benchmarks/Image/EncodePng.cs +++ b/tests/ImageSharp.Benchmarks/Image/EncodePng.cs @@ -74,7 +74,7 @@ namespace SixLabors.ImageSharp.Benchmarks.Image new OctreeQuantizer() : new PaletteQuantizer(); - var options = new PngEncoder { Quantizer = quantizer }; + var options = new PngEncoder(Configuration.Default.MemoryManager) { Quantizer = quantizer }; this.bmpCore.SaveAsPng(memoryStream, options); } } diff --git a/tests/ImageSharp.Benchmarks/Image/Jpeg/YCbCrColorConversion.cs b/tests/ImageSharp.Benchmarks/Image/Jpeg/YCbCrColorConversion.cs index f513e0d38b..c47aff9cf4 100644 --- a/tests/ImageSharp.Benchmarks/Image/Jpeg/YCbCrColorConversion.cs +++ b/tests/ImageSharp.Benchmarks/Image/Jpeg/YCbCrColorConversion.cs @@ -76,7 +76,7 @@ } // no need to dispose when buffer is not array owner - buffers[i] = MemoryManager.Current.Allocate2D(values.Length, 1); + buffers[i] = Configuration.Default.MemoryManager.Allocate2D(values.Length, 1); } return buffers; diff --git a/tests/ImageSharp.Benchmarks/PixelBlenders/PorterDuffBulkVsPixel.cs b/tests/ImageSharp.Benchmarks/PixelBlenders/PorterDuffBulkVsPixel.cs index ef44d1e789..4524d757cf 100644 --- a/tests/ImageSharp.Benchmarks/PixelBlenders/PorterDuffBulkVsPixel.cs +++ b/tests/ImageSharp.Benchmarks/PixelBlenders/PorterDuffBulkVsPixel.cs @@ -24,7 +24,7 @@ namespace SixLabors.ImageSharp.Benchmarks Guard.MustBeGreaterThanOrEqualTo(source.Length, destination.Length, nameof(source.Length)); Guard.MustBeGreaterThanOrEqualTo(amount.Length, destination.Length, nameof(amount.Length)); - using (Buffer buffer = MemoryManager.Current.Allocate(destination.Length * 3)) + using (Buffer buffer = Configuration.Default.MemoryManager.Allocate(destination.Length * 3)) { Span destinationSpan = buffer.Slice(0, destination.Length); Span backgroundSpan = buffer.Slice(destination.Length, destination.Length); @@ -59,7 +59,7 @@ namespace SixLabors.ImageSharp.Benchmarks { using (Image image = new Image(800, 800)) { - Buffer amounts = MemoryManager.Current.Allocate(image.Width); + Buffer amounts = Configuration.Default.MemoryManager.Allocate(image.Width); for (int x = 0; x < image.Width; x++) { @@ -82,7 +82,7 @@ namespace SixLabors.ImageSharp.Benchmarks { using (Image image = new Image(800, 800)) { - Buffer amounts = MemoryManager.Current.Allocate(image.Width); + Buffer amounts = Configuration.Default.MemoryManager.Allocate(image.Width); for (int x = 0; x < image.Width; x++) { diff --git a/tests/ImageSharp.Benchmarks/Samplers/Glow.cs b/tests/ImageSharp.Benchmarks/Samplers/Glow.cs index 0494db9b9a..2743924f24 100644 --- a/tests/ImageSharp.Benchmarks/Samplers/Glow.cs +++ b/tests/ImageSharp.Benchmarks/Samplers/Glow.cs @@ -28,7 +28,7 @@ namespace SixLabors.ImageSharp.Benchmarks [GlobalSetup] public void Setup() { - this.bulk = new GlowProcessor(NamedColors.Beige, 800 * .5f, GraphicsOptions.Default); + this.bulk = new GlowProcessor(Configuration.Default.MemoryManager, NamedColors.Beige, 800 * .5f, GraphicsOptions.Default); this.parallel = new GlowProcessorParallel(NamedColors.Beige) { Radius = 800 * .5f, }; } @@ -103,7 +103,7 @@ namespace SixLabors.ImageSharp.Benchmarks } int width = maxX - minX; - using (Buffer rowColors = MemoryManager.Current.Allocate(width)) + using (Buffer rowColors = Configuration.Default.MemoryManager.Allocate(width)) using (PixelAccessor sourcePixels = source.Lock()) { for (int i = 0; i < width; i++) diff --git a/tests/ImageSharp.Tests/Drawing/Paths/ShapeRegionTests.cs b/tests/ImageSharp.Tests/Drawing/Paths/ShapeRegionTests.cs index 941807f542..d3fcc5322e 100644 --- a/tests/ImageSharp.Tests/Drawing/Paths/ShapeRegionTests.cs +++ b/tests/ImageSharp.Tests/Drawing/Paths/ShapeRegionTests.cs @@ -37,7 +37,7 @@ namespace SixLabors.ImageSharp.Tests.Drawing.Paths [Fact] public void ShapeRegionWithPathCallsAsShape() { - new ShapeRegion(pathMock.Object); + new ShapeRegion(Configuration.Default.MemoryManager, pathMock.Object); pathMock.Verify(x => x.AsClosedPath()); } @@ -45,7 +45,7 @@ namespace SixLabors.ImageSharp.Tests.Drawing.Paths [Fact] public void ShapeRegionWithPathRetainsShape() { - ShapeRegion region = new ShapeRegion(pathMock.Object); + ShapeRegion region = new ShapeRegion(Configuration.Default.MemoryManager, pathMock.Object); Assert.Equal(pathMock.Object, region.Shape); } @@ -53,7 +53,7 @@ namespace SixLabors.ImageSharp.Tests.Drawing.Paths [Fact] public void ShapeRegionFromPathConvertsBoundsProxyToShape() { - ShapeRegion region = new ShapeRegion(pathMock.Object); + ShapeRegion region = new ShapeRegion(Configuration.Default.MemoryManager, pathMock.Object); Assert.Equal(Math.Floor(bounds.Left), region.Bounds.Left); Assert.Equal(Math.Ceiling(bounds.Right), region.Bounds.Right); @@ -64,7 +64,7 @@ namespace SixLabors.ImageSharp.Tests.Drawing.Paths [Fact] public void ShapeRegionFromPathMaxIntersectionsProxyToShape() { - ShapeRegion region = new ShapeRegion(pathMock.Object); + ShapeRegion region = new ShapeRegion(Configuration.Default.MemoryManager, pathMock.Object); int i = region.MaxIntersections; pathMock.Verify(x => x.MaxIntersections); @@ -74,7 +74,7 @@ namespace SixLabors.ImageSharp.Tests.Drawing.Paths public void ShapeRegionFromPathScanYProxyToShape() { int yToScan = 10; - ShapeRegion region = new ShapeRegion(pathMock.Object); + ShapeRegion region = new ShapeRegion(Configuration.Default.MemoryManager, pathMock.Object); pathMock.Setup(x => x.FindIntersections(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) .Callback((s, e, b, o) => { @@ -93,7 +93,7 @@ namespace SixLabors.ImageSharp.Tests.Drawing.Paths public void ShapeRegionFromShapeScanYProxyToShape() { int yToScan = 10; - ShapeRegion region = new ShapeRegion(pathMock.Object); + ShapeRegion region = new ShapeRegion(Configuration.Default.MemoryManager, pathMock.Object); pathMock.Setup(x => x.FindIntersections(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) .Callback((s, e, b, o) => { @@ -111,7 +111,7 @@ namespace SixLabors.ImageSharp.Tests.Drawing.Paths [Fact] public void ShapeRegionFromShapeConvertsBoundsProxyToShape() { - ShapeRegion region = new ShapeRegion(pathMock.Object); + ShapeRegion region = new ShapeRegion(Configuration.Default.MemoryManager, pathMock.Object); Assert.Equal(Math.Floor(bounds.Left), region.Bounds.Left); Assert.Equal(Math.Ceiling(bounds.Right), region.Bounds.Right); @@ -122,7 +122,7 @@ namespace SixLabors.ImageSharp.Tests.Drawing.Paths [Fact] public void ShapeRegionFromShapeMaxIntersectionsProxyToShape() { - ShapeRegion region = new ShapeRegion(pathMock.Object); + ShapeRegion region = new ShapeRegion(Configuration.Default.MemoryManager, pathMock.Object); int i = region.MaxIntersections; pathMock.Verify(x => x.MaxIntersections); diff --git a/tests/ImageSharp.Tests/Formats/Jpg/Block8x8FTests.CopyToBufferArea.cs b/tests/ImageSharp.Tests/Formats/Jpg/Block8x8FTests.CopyToBufferArea.cs index 1dc4896eeb..e50d84852a 100644 --- a/tests/ImageSharp.Tests/Formats/Jpg/Block8x8FTests.CopyToBufferArea.cs +++ b/tests/ImageSharp.Tests/Formats/Jpg/Block8x8FTests.CopyToBufferArea.cs @@ -48,7 +48,7 @@ namespace SixLabors.ImageSharp.Tests.Formats.Jpg { Block8x8F block = CreateRandomFloatBlock(0, 100); - using (var buffer = MemoryManager.Current.Allocate2D(20, 20)) + using (var buffer = Configuration.Default.MemoryManager.Allocate2D(20, 20)) { BufferArea area = buffer.GetArea(5, 10, 8, 8); block.CopyTo(area); @@ -78,7 +78,7 @@ namespace SixLabors.ImageSharp.Tests.Formats.Jpg var start = new Point(50, 50); - using (var buffer = MemoryManager.Current.Allocate2D(100, 100)) + using (var buffer = Configuration.Default.MemoryManager.Allocate2D(100, 100)) { BufferArea area = buffer.GetArea(start.X, start.Y, 8 * horizontalFactor, 8 * verticalFactor); block.CopyTo(area, horizontalFactor, verticalFactor); diff --git a/tests/ImageSharp.Tests/Formats/Jpg/JpegImagePostProcessorTests.cs b/tests/ImageSharp.Tests/Formats/Jpg/JpegImagePostProcessorTests.cs index df6d1ef1bb..423673ef93 100644 --- a/tests/ImageSharp.Tests/Formats/Jpg/JpegImagePostProcessorTests.cs +++ b/tests/ImageSharp.Tests/Formats/Jpg/JpegImagePostProcessorTests.cs @@ -55,8 +55,8 @@ namespace SixLabors.ImageSharp.Tests.Formats.Jpg { string imageFile = provider.SourceFileOrDescription; using (OrigJpegDecoderCore decoder = JpegFixture.ParseStream(imageFile)) - using (var pp = new JpegImagePostProcessor(decoder)) - using (var imageFrame = new ImageFrame(decoder.ImageWidth, decoder.ImageHeight)) + using (var pp = new JpegImagePostProcessor(Configuration.Default.MemoryManager, decoder)) + using (var imageFrame = new ImageFrame(Configuration.Default.MemoryManager, decoder.ImageWidth, decoder.ImageHeight)) { pp.DoPostProcessorStep(imageFrame); @@ -77,7 +77,7 @@ namespace SixLabors.ImageSharp.Tests.Formats.Jpg { string imageFile = provider.SourceFileOrDescription; using (OrigJpegDecoderCore decoder = JpegFixture.ParseStream(imageFile)) - using (var pp = new JpegImagePostProcessor(decoder)) + using (var pp = new JpegImagePostProcessor(Configuration.Default.MemoryManager, decoder)) using (var image = new Image(decoder.ImageWidth, decoder.ImageHeight)) { pp.PostProcess(image.Frames.RootFrame); diff --git a/tests/ImageSharp.Tests/Formats/Jpg/Utils/LibJpegTools.ComponentData.cs b/tests/ImageSharp.Tests/Formats/Jpg/Utils/LibJpegTools.ComponentData.cs index ad9ad81436..9e287eb2d7 100644 --- a/tests/ImageSharp.Tests/Formats/Jpg/Utils/LibJpegTools.ComponentData.cs +++ b/tests/ImageSharp.Tests/Formats/Jpg/Utils/LibJpegTools.ComponentData.cs @@ -23,7 +23,7 @@ namespace SixLabors.ImageSharp.Tests.Formats.Jpg.Utils this.HeightInBlocks = heightInBlocks; this.WidthInBlocks = widthInBlocks; this.Index = index; - this.SpectralBlocks = MemoryManager.Current.Allocate2D(this.WidthInBlocks, this.HeightInBlocks); + this.SpectralBlocks = Configuration.Default.MemoryManager.Allocate2D(this.WidthInBlocks, this.HeightInBlocks); } public Size Size => new Size(this.WidthInBlocks, this.HeightInBlocks); diff --git a/tests/ImageSharp.Tests/Formats/Png/PngEncoderTests.cs b/tests/ImageSharp.Tests/Formats/Png/PngEncoderTests.cs index 1566ddf442..ac9a5c2209 100644 --- a/tests/ImageSharp.Tests/Formats/Png/PngEncoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Png/PngEncoderTests.cs @@ -28,7 +28,7 @@ namespace SixLabors.ImageSharp.Tests { using (Image image = provider.GetImage()) { - var options = new PngEncoder() + var options = new PngEncoder(Configuration.Default.MemoryManager) { PngColorType = pngColorType }; @@ -46,7 +46,7 @@ namespace SixLabors.ImageSharp.Tests using (Image image = provider.GetImage()) using (var ms = new MemoryStream()) { - image.Save(ms, new PngEncoder()); + image.Save(ms, new PngEncoder(Configuration.Default.MemoryManager)); byte[] data = ms.ToArray().Take(8).ToArray(); byte[] expected = { diff --git a/tests/ImageSharp.Tests/Formats/Png/PngSmokeTests.cs b/tests/ImageSharp.Tests/Formats/Png/PngSmokeTests.cs index fc17df93d1..3a73867ba6 100644 --- a/tests/ImageSharp.Tests/Formats/Png/PngSmokeTests.cs +++ b/tests/ImageSharp.Tests/Formats/Png/PngSmokeTests.cs @@ -23,7 +23,7 @@ namespace SixLabors.ImageSharp.Tests.Formats.Png { // image.Save(provider.Utility.GetTestOutputFileName("bmp")); - image.Save(ms, new PngEncoder()); + image.Save(ms, new PngEncoder(Configuration.Default.MemoryManager)); ms.Position = 0; using (Image img2 = Image.Load(ms, new PngDecoder())) { @@ -110,7 +110,7 @@ namespace SixLabors.ImageSharp.Tests.Formats.Png image.Mutate(x => x.Resize(100, 100)); // image.Save(provider.Utility.GetTestOutputFileName("png", "resize")); - image.Save(ms, new PngEncoder()); + image.Save(ms, new PngEncoder(Configuration.Default.MemoryManager)); ms.Position = 0; using (Image img2 = Image.Load(ms, new PngDecoder())) { diff --git a/tests/ImageSharp.Tests/Image/ImageFramesCollectionTests.cs b/tests/ImageSharp.Tests/Image/ImageFramesCollectionTests.cs index afae9cae8c..1f2137070f 100644 --- a/tests/ImageSharp.Tests/Image/ImageFramesCollectionTests.cs +++ b/tests/ImageSharp.Tests/Image/ImageFramesCollectionTests.cs @@ -30,7 +30,7 @@ namespace SixLabors.ImageSharp.Tests { ArgumentException ex = Assert.Throws(() => { - this.collection.AddFrame(new ImageFrame(1, 1)); + this.collection.AddFrame(new ImageFrame(Configuration.Default.MemoryManager, 1, 1)); }); Assert.StartsWith("Frame must have the same dimensions as the image.", ex.Message); @@ -78,7 +78,7 @@ namespace SixLabors.ImageSharp.Tests ArgumentException ex = Assert.Throws(() => { - this.collection.InsertFrame(1, new ImageFrame(1, 1)); + this.collection.InsertFrame(1, new ImageFrame(Configuration.Default.MemoryManager, 1, 1)); }); Assert.StartsWith("Frame must have the same dimensions as the image.", ex.Message); @@ -103,8 +103,8 @@ namespace SixLabors.ImageSharp.Tests ArgumentException ex = Assert.Throws(() => { var collection = new ImageFrameCollection(this.image, new[] { - new ImageFrame(10,10), - new ImageFrame(1,1), + new ImageFrame(Configuration.Default.MemoryManager,10,10), + new ImageFrame(Configuration.Default.MemoryManager,1,1), }); }); @@ -115,7 +115,7 @@ namespace SixLabors.ImageSharp.Tests public void RemoveAtFrame_ThrowIfRemovingLastFrame() { var collection = new ImageFrameCollection(this.image, new[] { - new ImageFrame(10,10) + new ImageFrame(Configuration.Default.MemoryManager,10,10) }); InvalidOperationException ex = Assert.Throws(() => @@ -130,8 +130,8 @@ namespace SixLabors.ImageSharp.Tests { var collection = new ImageFrameCollection(this.image, new[] { - new ImageFrame(10,10), - new ImageFrame(10,10), + new ImageFrame(Configuration.Default.MemoryManager,10,10), + new ImageFrame(Configuration.Default.MemoryManager,10,10), }); collection.RemoveFrame(0); @@ -142,8 +142,8 @@ namespace SixLabors.ImageSharp.Tests public void RootFrameIsFrameAtIndexZero() { var collection = new ImageFrameCollection(this.image, new[] { - new ImageFrame(10,10), - new ImageFrame(10,10), + new ImageFrame(Configuration.Default.MemoryManager,10,10), + new ImageFrame(Configuration.Default.MemoryManager,10,10), }); Assert.Equal(collection.RootFrame, collection[0]); @@ -153,8 +153,8 @@ namespace SixLabors.ImageSharp.Tests public void ConstructorPopulatesFrames() { var collection = new ImageFrameCollection(this.image, new[] { - new ImageFrame(10,10), - new ImageFrame(10,10), + new ImageFrame(Configuration.Default.MemoryManager,10,10), + new ImageFrame(Configuration.Default.MemoryManager,10,10), }); Assert.Equal(2, collection.Count); @@ -164,8 +164,8 @@ namespace SixLabors.ImageSharp.Tests public void DisposeClearsCollection() { var collection = new ImageFrameCollection(this.image, new[] { - new ImageFrame(10,10), - new ImageFrame(10,10), + new ImageFrame(Configuration.Default.MemoryManager,10,10), + new ImageFrame(Configuration.Default.MemoryManager,10,10), }); collection.Dispose(); @@ -177,8 +177,8 @@ namespace SixLabors.ImageSharp.Tests public void Dispose_DisposesAllInnerFrames() { var collection = new ImageFrameCollection(this.image, new[] { - new ImageFrame(10,10), - new ImageFrame(10,10), + new ImageFrame(Configuration.Default.MemoryManager,10,10), + new ImageFrame(Configuration.Default.MemoryManager,10,10), }); IPixelSource[] framesSnapShot = collection.OfType>().ToArray(); @@ -198,7 +198,7 @@ namespace SixLabors.ImageSharp.Tests { using (Image img = provider.GetImage()) { - img.Frames.AddFrame(new ImageFrame(10, 10));// add a frame anyway + img.Frames.AddFrame(new ImageFrame(Configuration.Default.MemoryManager,10, 10));// add a frame anyway using (Image cloned = img.Frames.CloneFrame(0)) { Assert.Equal(2, img.Frames.Count); @@ -216,7 +216,7 @@ namespace SixLabors.ImageSharp.Tests { var sourcePixelData = img.GetPixelSpan().ToArray(); - img.Frames.AddFrame(new ImageFrame(10, 10)); + img.Frames.AddFrame(new ImageFrame(Configuration.Default.MemoryManager,10, 10)); using (Image cloned = img.Frames.ExportFrame(0)) { Assert.Equal(1, img.Frames.Count); @@ -244,7 +244,7 @@ namespace SixLabors.ImageSharp.Tests public void AddFrame_clones_sourceFrame() { var pixelData = this.image.Frames.RootFrame.GetPixelSpan().ToArray(); - var otherFRame = new ImageFrame(10, 10); + var otherFRame = new ImageFrame(Configuration.Default.MemoryManager,10, 10); var addedFrame = this.image.Frames.AddFrame(otherFRame); addedFrame.ComparePixelBufferTo(otherFRame.GetPixelSpan()); Assert.NotEqual(otherFRame, addedFrame); @@ -254,7 +254,7 @@ namespace SixLabors.ImageSharp.Tests public void InsertFrame_clones_sourceFrame() { var pixelData = this.image.Frames.RootFrame.GetPixelSpan().ToArray(); - var otherFRame = new ImageFrame(10, 10); + var otherFRame = new ImageFrame(Configuration.Default.MemoryManager,10, 10); var addedFrame = this.image.Frames.InsertFrame(0, otherFRame); addedFrame.ComparePixelBufferTo(otherFRame.GetPixelSpan()); Assert.NotEqual(otherFRame, addedFrame); @@ -308,7 +308,7 @@ namespace SixLabors.ImageSharp.Tests this.image.Frames.CreateFrame(); } - var frame = new ImageFrame(10, 10); + var frame = new ImageFrame(Configuration.Default.MemoryManager,10, 10); Assert.False(this.image.Frames.Contains(frame)); } diff --git a/tests/ImageSharp.Tests/Image/ImageTests.cs b/tests/ImageSharp.Tests/Image/ImageTests.cs index da813f4280..45ecf60a06 100644 --- a/tests/ImageSharp.Tests/Image/ImageTests.cs +++ b/tests/ImageSharp.Tests/Image/ImageTests.cs @@ -103,7 +103,7 @@ namespace SixLabors.ImageSharp.Tests using (Image image = new Image(10, 10)) { - image.Save(file, new PngEncoder()); + image.Save(file, new PngEncoder(Configuration.Default.MemoryManager)); } using (Image img = Image.Load(file, out var mime)) { diff --git a/tests/ImageSharp.Tests/Memory/Buffer2DTests.cs b/tests/ImageSharp.Tests/Memory/Buffer2DTests.cs index f14995433d..7f78ef39c0 100644 --- a/tests/ImageSharp.Tests/Memory/Buffer2DTests.cs +++ b/tests/ImageSharp.Tests/Memory/Buffer2DTests.cs @@ -31,7 +31,7 @@ namespace SixLabors.ImageSharp.Tests.Memory [InlineData(1025, 17)] public void Construct(int width, int height) { - using (Buffer2D buffer = MemoryManager.Current.Allocate2D(width, height)) + using (Buffer2D buffer = Configuration.Default.MemoryManager.Allocate2D(width, height)) { Assert.Equal(width, buffer.Width); Assert.Equal(height, buffer.Height); @@ -44,7 +44,7 @@ namespace SixLabors.ImageSharp.Tests.Memory { for (int i = 0; i < 100; i++) { - using (Buffer2D buffer = Buffer2D.CreateClean(42, 42)) + using (Buffer2D buffer = Configuration.Default.MemoryManager.Allocate2D(42, 42, true)) { for (int j = 0; j < buffer.Buffer.Length; j++) { @@ -61,7 +61,7 @@ namespace SixLabors.ImageSharp.Tests.Memory [InlineData(17, 42, 41)] public void GetRowSpanY(int width, int height, int y) { - using (Buffer2D buffer = MemoryManager.Current.Allocate2D(width, height)) + using (Buffer2D buffer = Configuration.Default.MemoryManager.Allocate2D(width, height)) { Span span = buffer.GetRowSpan(y); @@ -77,7 +77,7 @@ namespace SixLabors.ImageSharp.Tests.Memory [InlineData(17, 42, 0, 41)] public void GetRowSpanXY(int width, int height, int x, int y) { - using (Buffer2D buffer = MemoryManager.Current.Allocate2D(width, height)) + using (Buffer2D buffer = Configuration.Default.MemoryManager.Allocate2D(width, height)) { Span span = buffer.GetRowSpan(x, y); @@ -93,7 +93,7 @@ namespace SixLabors.ImageSharp.Tests.Memory [InlineData(99, 88, 98, 87)] public void Indexer(int width, int height, int x, int y) { - using (Buffer2D buffer = MemoryManager.Current.Allocate2D(width, height)) + using (Buffer2D buffer = Configuration.Default.MemoryManager.Allocate2D(width, height)) { TestStructs.Foo[] array = buffer.Buffer.Array; diff --git a/tests/ImageSharp.Tests/Memory/BufferAreaTests.cs b/tests/ImageSharp.Tests/Memory/BufferAreaTests.cs index 74e9098b90..2ca409dc15 100644 --- a/tests/ImageSharp.Tests/Memory/BufferAreaTests.cs +++ b/tests/ImageSharp.Tests/Memory/BufferAreaTests.cs @@ -13,7 +13,7 @@ namespace SixLabors.ImageSharp.Tests.Memory [Fact] public void Construct() { - using (var buffer = MemoryManager.Current.Allocate2D(10, 20)) + using (var buffer = Configuration.Default.MemoryManager.Allocate2D(10, 20)) { var rectangle = new Rectangle(3,2, 5, 6); var area = new BufferArea(buffer, rectangle); @@ -25,7 +25,7 @@ namespace SixLabors.ImageSharp.Tests.Memory private static Buffer2D CreateTestBuffer(int w, int h) { - var buffer = MemoryManager.Current.Allocate2D(w, h); + var buffer = Configuration.Default.MemoryManager.Allocate2D(w, h); for (int y = 0; y < h; y++) { for (int x = 0; x < w; x++) diff --git a/tests/ImageSharp.Tests/Memory/BufferTests.cs b/tests/ImageSharp.Tests/Memory/BufferTests.cs index 8669f2bb05..d0a83a094d 100644 --- a/tests/ImageSharp.Tests/Memory/BufferTests.cs +++ b/tests/ImageSharp.Tests/Memory/BufferTests.cs @@ -35,7 +35,7 @@ namespace SixLabors.ImageSharp.Tests.Memory [InlineData(1111)] public void ConstructWithOwnArray(int count) { - using (Buffer buffer = MemoryManager.Current.Allocate(count)) + using (Buffer buffer = Configuration.Default.MemoryManager.Allocate(count)) { Assert.False(buffer.IsDisposedOrLostArrayOwnership); Assert.NotNull(buffer.Array); @@ -76,7 +76,7 @@ namespace SixLabors.ImageSharp.Tests.Memory { for (int i = 0; i < 100; i++) { - using (Buffer buffer = MemoryManager.Current.Allocate(42, true)) + using (Buffer buffer = Configuration.Default.MemoryManager.Allocate(42, true)) { for (int j = 0; j < buffer.Length; j++) { @@ -129,7 +129,7 @@ namespace SixLabors.ImageSharp.Tests.Memory [Fact] public void Dispose() { - Buffer buffer = MemoryManager.Current.Allocate(42); + Buffer buffer = Configuration.Default.MemoryManager.Allocate(42); buffer.Dispose(); Assert.True(buffer.IsDisposedOrLostArrayOwnership); @@ -140,7 +140,7 @@ namespace SixLabors.ImageSharp.Tests.Memory [InlineData(123)] public void CastToSpan(int bufferLength) { - using (Buffer buffer = MemoryManager.Current.Allocate(bufferLength)) + using (Buffer buffer = Configuration.Default.MemoryManager.Allocate(bufferLength)) { Span span = buffer; @@ -154,7 +154,7 @@ namespace SixLabors.ImageSharp.Tests.Memory [Fact] public void Span() { - using (Buffer buffer = MemoryManager.Current.Allocate(42)) + using (Buffer buffer = Configuration.Default.MemoryManager.Allocate(42)) { Span span = buffer.Span; @@ -173,7 +173,7 @@ namespace SixLabors.ImageSharp.Tests.Memory [InlineData(123, 17)] public void WithStartOnly(int bufferLength, int start) { - using (Buffer buffer = MemoryManager.Current.Allocate(bufferLength)) + using (Buffer buffer = Configuration.Default.MemoryManager.Allocate(bufferLength)) { Span span = buffer.Slice(start); @@ -187,7 +187,7 @@ namespace SixLabors.ImageSharp.Tests.Memory [InlineData(123, 17, 42)] public void WithStartAndLength(int bufferLength, int start, int spanLength) { - using (Buffer buffer = MemoryManager.Current.Allocate(bufferLength)) + using (Buffer buffer = Configuration.Default.MemoryManager.Allocate(bufferLength)) { Span span = buffer.Slice(start, spanLength); @@ -201,7 +201,7 @@ namespace SixLabors.ImageSharp.Tests.Memory public void UnPinAndTakeArrayOwnership() { TestStructs.Foo[] data = null; - using (Buffer buffer = MemoryManager.Current.Allocate(42)) + using (Buffer buffer = Configuration.Default.MemoryManager.Allocate(42)) { data = buffer.TakeArrayOwnership(); Assert.True(buffer.IsDisposedOrLostArrayOwnership); @@ -216,7 +216,7 @@ namespace SixLabors.ImageSharp.Tests.Memory [Fact] public void ReturnsPinnedPointerToTheBeginningOfArray() { - using (Buffer buffer = MemoryManager.Current.Allocate(42)) + using (Buffer buffer = Configuration.Default.MemoryManager.Allocate(42)) { TestStructs.Foo* actual = (TestStructs.Foo*)buffer.Pin(); fixed (TestStructs.Foo* expected = buffer.Array) @@ -229,7 +229,7 @@ namespace SixLabors.ImageSharp.Tests.Memory [Fact] public void SecondCallReturnsTheSamePointer() { - using (Buffer buffer = MemoryManager.Current.Allocate(42)) + using (Buffer buffer = Configuration.Default.MemoryManager.Allocate(42)) { IntPtr ptr1 = buffer.Pin(); IntPtr ptr2 = buffer.Pin(); @@ -241,7 +241,7 @@ namespace SixLabors.ImageSharp.Tests.Memory [Fact] public void WhenCalledOnDisposedBuffer_ThrowsInvalidOperationException() { - Buffer buffer = MemoryManager.Current.Allocate(42); + Buffer buffer = Configuration.Default.MemoryManager.Allocate(42); buffer.Dispose(); Assert.Throws(() => buffer.Pin()); diff --git a/tests/ImageSharp.Tests/Memory/SpanUtilityTests.cs b/tests/ImageSharp.Tests/Memory/SpanUtilityTests.cs index 8b90295ce8..757c8fcf9f 100644 --- a/tests/ImageSharp.Tests/Memory/SpanUtilityTests.cs +++ b/tests/ImageSharp.Tests/Memory/SpanUtilityTests.cs @@ -424,7 +424,7 @@ namespace SixLabors.ImageSharp.Tests.Memory Rgba32[] colors = { new Rgba32(0, 1, 2, 3), new Rgba32(4, 5, 6, 7), new Rgba32(8, 9, 10, 11), }; using (Buffer colorBuf = new Buffer(colors)) - using (Buffer byteBuf = MemoryManager.Current.Allocate(colors.Length * 4)) + using (Buffer byteBuf = Configuration.Default.MemoryManager.Allocate(colors.Length * 4)) { SpanHelper.Copy(colorBuf.Span.AsBytes(), byteBuf, colorBuf.Length * sizeof(Rgba32)); diff --git a/tests/ImageSharp.Tests/PixelFormats/PixelOperationsTests.cs b/tests/ImageSharp.Tests/PixelFormats/PixelOperationsTests.cs index c7227eb8ae..4cd7ebeea3 100644 --- a/tests/ImageSharp.Tests/PixelFormats/PixelOperationsTests.cs +++ b/tests/ImageSharp.Tests/PixelFormats/PixelOperationsTests.cs @@ -50,8 +50,8 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats int times = 200000; int count = 1024; - using (Buffer source = MemoryManager.Current.Allocate(count)) - using (Buffer dest = MemoryManager.Current.Allocate(count)) + using (Buffer source = Configuration.Default.MemoryManager.Allocate(count)) + using (Buffer dest = Configuration.Default.MemoryManager.Allocate(count)) { this.Measure( times, @@ -344,7 +344,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats { this.SourceBuffer = new Buffer(source); this.ExpectedDestBuffer = new Buffer(expectedDest); - this.ActualDestBuffer = MemoryManager.Current.Allocate(expectedDest.Length); + this.ActualDestBuffer = Configuration.Default.MemoryManager.Allocate(expectedDest.Length); } public void Dispose() diff --git a/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeProfilingBenchmarks.cs b/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeProfilingBenchmarks.cs index 963b849d2a..d5aed8832a 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeProfilingBenchmarks.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeProfilingBenchmarks.cs @@ -38,7 +38,7 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms // [Fact] public void PrintWeightsData() { - var proc = new ResizeProcessor(new BicubicResampler(), 200, 200); + var proc = new ResizeProcessor(Configuration.Default.MemoryManager, new BicubicResampler(), 200, 200); ResamplingWeightedProcessor.WeightsBuffer weights = proc.PrecomputeWeights(200, 500); diff --git a/tests/ImageSharp.Tests/TestUtilities/ReferenceCodecs/SystemDrawingBridge.cs b/tests/ImageSharp.Tests/TestUtilities/ReferenceCodecs/SystemDrawingBridge.cs index babe148c80..d14a0165aa 100644 --- a/tests/ImageSharp.Tests/TestUtilities/ReferenceCodecs/SystemDrawingBridge.cs +++ b/tests/ImageSharp.Tests/TestUtilities/ReferenceCodecs/SystemDrawingBridge.cs @@ -19,7 +19,7 @@ namespace SixLabors.ImageSharp.Tests.TestUtilities.ReferenceCodecs int length = source.Length; Guard.MustBeSizedAtLeast(dest, length, nameof(dest)); - using (var rgbaBuffer = MemoryManager.Current.Allocate(length)) + using (var rgbaBuffer = Configuration.Default.MemoryManager.Allocate(length)) { PixelOperations.Instance.ToRgba32(source, rgbaBuffer, length); @@ -39,7 +39,7 @@ namespace SixLabors.ImageSharp.Tests.TestUtilities.ReferenceCodecs int length = source.Length; Guard.MustBeSizedAtLeast(dest, length, nameof(dest)); - using (var rgbaBuffer = MemoryManager.Current.Allocate(length)) + using (var rgbaBuffer = Configuration.Default.MemoryManager.Allocate(length)) { PixelOperations.Instance.ToRgba32(source, rgbaBuffer, length); @@ -59,7 +59,7 @@ namespace SixLabors.ImageSharp.Tests.TestUtilities.ReferenceCodecs int length = source.Length; Guard.MustBeSizedAtLeast(dest, length, nameof(dest)); - using (var rgbaBuffer = MemoryManager.Current.Allocate(length)) + using (var rgbaBuffer = Configuration.Default.MemoryManager.Allocate(length)) { PixelOperations.Instance.ToRgb24(source, rgbaBuffer, length); @@ -96,7 +96,7 @@ namespace SixLabors.ImageSharp.Tests.TestUtilities.ReferenceCodecs var image = new Image(w, h); - using (var workBuffer = MemoryManager.Current.Allocate(w)) + using (var workBuffer = Configuration.Default.MemoryManager.Allocate(w)) { var destPtr = (Argb32*)workBuffer.Pin(); for (int y = 0; y < h; y++) @@ -138,7 +138,7 @@ namespace SixLabors.ImageSharp.Tests.TestUtilities.ReferenceCodecs var image = new Image(w, h); - using (var workBuffer = MemoryManager.Current.Allocate(w)) + using (var workBuffer = Configuration.Default.MemoryManager.Allocate(w)) { var destPtr = (Rgb24*)workBuffer.Pin(); for (int y = 0; y < h; y++) @@ -170,7 +170,7 @@ namespace SixLabors.ImageSharp.Tests.TestUtilities.ReferenceCodecs long destRowByteCount = data.Stride; long sourceRowByteCount = w * sizeof(Argb32); - using (var workBuffer = MemoryManager.Current.Allocate(w)) + using (var workBuffer = Configuration.Default.MemoryManager.Allocate(w)) { var sourcePtr = (Argb32*)workBuffer.Pin(); diff --git a/tests/ImageSharp.Tests/TestUtilities/Tests/ReferenceCodecTests.cs b/tests/ImageSharp.Tests/TestUtilities/Tests/ReferenceCodecTests.cs index 0a550a3c1a..f4fce0f639 100644 --- a/tests/ImageSharp.Tests/TestUtilities/Tests/ReferenceCodecTests.cs +++ b/tests/ImageSharp.Tests/TestUtilities/Tests/ReferenceCodecTests.cs @@ -59,7 +59,7 @@ namespace SixLabors.ImageSharp.Tests sourceImage.Mutate(c => c.Alpha(1)); } - var encoder = new PngEncoder() { PngColorType = pngColorType }; + var encoder = new PngEncoder(Configuration.Default.MemoryManager) { PngColorType = pngColorType }; return provider.Utility.SaveTestOutputFile(sourceImage, "png", encoder); } }