From 673e8c67237f1399f97ef1773cfeb01035f728b9 Mon Sep 17 00:00:00 2001 From: Rogier Date: Sun, 7 Jun 2015 21:30:45 +0200 Subject: [PATCH] When using transparency, don't compute new value when pixel is already fully opaque This makes the code slightly more efficient, and should not affect the generated map at all. --- PixelAttributes.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PixelAttributes.cpp b/PixelAttributes.cpp index 12a5d1a..fa82bbb 100644 --- a/PixelAttributes.cpp +++ b/PixelAttributes.cpp @@ -259,6 +259,8 @@ void PixelAttribute::mixUnder(const PixelAttribute &p) } m_h = p.m_h; } + else if (m_a == 1) + ; // Nothing to do: pixel is already fully opaque. else if ((m_mixMode & AlphaMixCumulative) == AlphaMixCumulative || (m_mixMode == AlphaMixAverage && p.m_a == 1)) { PixelAttribute pp(p); #ifdef DEBUG