diff options
author | Armin Le Grand <alg@apache.org> | 2013-06-12 20:27:24 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-06-12 20:31:53 +0100 |
commit | 529ab257f10490a3e7d4f13ddabbc9374b84d529 (patch) | |
tree | e837d6d8993f14435fba9886a4b8c918a6f6bdd2 | |
parent | 4696292b9a9c7096b7ee6c98711bdcdfb7af7101 (diff) |
Small correction in scaling code seen while debugging something else
(cherry picked from commit 101e1cced456f1effd5b4daaa469c2817e34a448)
Change-Id: Ib373406a44c00d812dc754d8091c94cb6a64a1b0
-rw-r--r-- | vcl/source/gdi/bitmap3.cxx | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx index 5bcdb9ff2cfe..250f188d7bb2 100644 --- a/vcl/source/gdi/bitmap3.cxx +++ b/vcl/source/gdi/bitmap3.cxx @@ -2395,39 +2395,43 @@ sal_Bool Bitmap::ImplScaleConvolution( { const sal_uInt32 nInBetweenSizeHorFirst(nHeight * nNewWidth); const sal_uInt32 nInBetweenSizeVerFirst(nNewHeight * nWidth); + Bitmap aSource(*this); - Bitmap aInterm; if(nInBetweenSizeHorFirst < nInBetweenSizeVerFirst) { if(bScaleHor) { - bResult = ImplScaleConvolutionHor(*this, aInterm, fScaleX, aKernel); + bResult = ImplScaleConvolutionHor(aSource, aResult, fScaleX, aKernel); } - else - aInterm = *this; if(bResult && bScaleVer) { - bResult = ImplScaleConvolutionVer(aInterm, aResult, fScaleY, aKernel); + if(bScaleHor) + { + // copy partial result, independent of color depth + aSource = aResult; + } + + bResult = ImplScaleConvolutionVer(aSource, aResult, fScaleY, aKernel); } - else - aResult = aInterm; } else { if(bScaleVer) { - bResult = ImplScaleConvolutionVer(*this, aInterm, fScaleY, aKernel); + bResult = ImplScaleConvolutionVer(aSource, aResult, fScaleY, aKernel); } - else - aInterm = *this; if(bResult && bScaleHor) { - bResult = ImplScaleConvolutionHor(aInterm, aResult, fScaleX, aKernel); + if(bScaleVer) + { + // copy partial result, independent of color depth + aSource = aResult; + } + + bResult = ImplScaleConvolutionHor(aSource, aResult, fScaleX, aKernel); } - else - aResult = aInterm; } } |