From 0c0d2bba6d93d7802aaa86fdac27f01037eaafc1 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Mon, 6 Jan 2020 02:55:28 +0100 Subject: [PATCH] Fixed lambda capturing this --- .../Processors/Effects/PixelShaderProcessorBase.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ImageSharp/Processing/Processors/Effects/PixelShaderProcessorBase.cs b/src/ImageSharp/Processing/Processors/Effects/PixelShaderProcessorBase.cs index f1245ca51..d75d23a51 100644 --- a/src/ImageSharp/Processing/Processors/Effects/PixelShaderProcessorBase.cs +++ b/src/ImageSharp/Processing/Processors/Effects/PixelShaderProcessorBase.cs @@ -40,6 +40,8 @@ namespace SixLabors.ImageSharp.Processing.Processors.Effects { var interest = Rectangle.Intersect(this.SourceRectangle, source.Bounds()); int startX = interest.X; + Configuration configuration = this.Configuration; + PixelConversionModifiers modifiers = this.modifiers; ParallelHelper.IterateRowsWithTempBuffer( interest, @@ -51,12 +53,12 @@ namespace SixLabors.ImageSharp.Processing.Processors.Effects Span vectorSpan = vectorBuffer.Span; int length = vectorSpan.Length; Span rowSpan = source.GetPixelRowSpan(y).Slice(startX, length); - PixelOperations.Instance.ToVector4(this.Configuration, rowSpan, vectorSpan, this.modifiers); + PixelOperations.Instance.ToVector4(configuration, rowSpan, vectorSpan, modifiers); // Run the user defined pixel shader on the current row of pixels this.ApplyPixelShader(vectorSpan, y, startX); - PixelOperations.Instance.FromVector4Destructive(this.Configuration, vectorSpan, rowSpan, this.modifiers); + PixelOperations.Instance.FromVector4Destructive(configuration, vectorSpan, rowSpan, modifiers); } }); }