From e7f125d5fea737ea58dc11002caf48a51f237778 Mon Sep 17 00:00:00 2001 From: woutware <35376607+woutware@users.noreply.github.com> Date: Sun, 29 Apr 2018 21:36:03 +0200 Subject: [PATCH] Processed Scott's review comment. --- .../Drawing/Processors/FillProcessor.cs | 6 ++++- .../PixelFormats/PixelBlenderMode.cs | 24 +++++++++---------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/ImageSharp.Drawing/Processing/Drawing/Processors/FillProcessor.cs b/src/ImageSharp.Drawing/Processing/Drawing/Processors/FillProcessor.cs index c3addaf29f..3417b8faaa 100644 --- a/src/ImageSharp.Drawing/Processing/Drawing/Processors/FillProcessor.cs +++ b/src/ImageSharp.Drawing/Processing/Drawing/Processors/FillProcessor.cs @@ -55,7 +55,11 @@ namespace SixLabors.ImageSharp.Processing.Drawing.Processors var solidBrush = this.brush as SolidBrush; // If there's no reason for blending, then avoid it. - if (solidBrush != null && this.options.BlendPercentage == 1f && solidBrush.Color.ToVector4().W == 1f) + if (solidBrush != null && + ( + (this.options.BlenderMode == PixelBlenderMode.Normal && this.options.BlendPercentage == 1f && solidBrush.Color.ToVector4().W == 1f) || + (this.options.BlenderMode == PixelBlenderMode.Over && this.options.BlendPercentage == 1f && solidBrush.Color.ToVector4().W == 1f) || + (this.options.BlenderMode == PixelBlenderMode.Src))) { Parallel.For( minY, diff --git a/src/ImageSharp/PixelFormats/PixelBlenderMode.cs b/src/ImageSharp/PixelFormats/PixelBlenderMode.cs index 4b8f56d766..7a8ab6592a 100644 --- a/src/ImageSharp/PixelFormats/PixelBlenderMode.cs +++ b/src/ImageSharp/PixelFormats/PixelBlenderMode.cs @@ -54,62 +54,62 @@ namespace SixLabors.ImageSharp.PixelFormats HardLight, /// - /// returns the source colors + /// returns the source colors. /// Src, /// - /// returns the source over the destination + /// returns the source over the destination. /// Atop, /// - /// returns the detination over the source + /// returns the destination over the source. /// Over, /// - /// the source where the desitnation and source overlap + /// The source where the destination and source overlap. /// In, /// - /// the destination where the desitnation and source overlap + /// The destination where the destination and source overlap. /// Out, /// - /// the destination where the source does not overlap it + /// The destination where the source does not overlap it. /// Dest, /// - /// the source where they dont overlap othersie dest in overlapping parts + /// The source where they don't overlap othersie dest in overlapping parts. /// DestAtop, /// - /// the destnation over the source + /// The destination over the source. /// DestOver, /// - /// the destination where the desitnation and source overlap + /// The destination where the destination and source overlap. /// DestIn, /// - /// the source where the desitnation and source overlap + /// The source where the destination and source overlap. /// DestOut, /// - /// the clear. + /// The clear. /// Clear, /// - /// clear where they overlap + /// Clear where they overlap. /// Xor }