Author: alg
Date: Mon Dec 3 15:18:47 2012
New Revision: 1416557
URL: http://svn.apache.org/viewvc?rev=1416557&view=rev
Log:
Small correction in scaling code seen while debugging something else
Modified:
openoffice/trunk/main/vcl/source/gdi/bitmap3.cxx
Modified: openoffice/trunk/main/vcl/source/gdi/bitmap3.cxx
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/source/gdi/bitmap3.cxx?rev=1416557&r1=1416556&r2=1416557&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/source/gdi/bitmap3.cxx (original)
+++ openoffice/trunk/main/vcl/source/gdi/bitmap3.cxx Mon Dec 3 15:18:47 2012
@@ -2481,29 +2481,42 @@ sal_Bool Bitmap::ImplScaleConvolution(
{
const sal_uInt32 nInBetweenSizeHorFirst(nHeight * nNewWidth);
const sal_uInt32 nInBetweenSizeVerFirst(nNewHeight * nWidth);
+ Bitmap aSource(*this);
if(nInBetweenSizeHorFirst < nInBetweenSizeVerFirst)
{
if(bScaleHor)
{
- bResult = ImplScaleConvolutionHor(*this, aResult, fScaleX,
aKernel);
+ bResult = ImplScaleConvolutionHor(aSource, aResult, fScaleX,
aKernel);
}
if(bResult && bScaleVer)
{
- bResult = ImplScaleConvolutionVer(*this, aResult, fScaleY,
aKernel);
+ if(bScaleHor)
+ {
+ // copy partial result, independent of color depth
+ aSource = aResult;
+ }
+
+ bResult = ImplScaleConvolutionVer(aSource, aResult, fScaleY,
aKernel);
}
}
else
{
if(bScaleVer)
{
- bResult = ImplScaleConvolutionVer(*this, aResult, fScaleY,
aKernel);
+ bResult = ImplScaleConvolutionVer(aSource, aResult, fScaleY,
aKernel);
}
if(bResult && bScaleHor)
{
- bResult = ImplScaleConvolutionHor(*this, aResult, fScaleX,
aKernel);
+ if(bScaleVer)
+ {
+ // copy partial result, independent of color depth
+ aSource = aResult;
+ }
+
+ bResult = ImplScaleConvolutionHor(aSource, aResult, fScaleX,
aKernel);
}
}
}