Kaydet (Commit) 529ab257 authored tarafından Armin Le Grand's avatar Armin Le Grand Kaydeden (comit) Caolán McNamara

Small correction in scaling code seen while debugging something else

(cherry picked from commit 101e1cce)

Change-Id: Ib373406a44c00d812dc754d8091c94cb6a64a1b0
üst 4696292b
...@@ -2395,39 +2395,43 @@ sal_Bool Bitmap::ImplScaleConvolution( ...@@ -2395,39 +2395,43 @@ sal_Bool Bitmap::ImplScaleConvolution(
{ {
const sal_uInt32 nInBetweenSizeHorFirst(nHeight * nNewWidth); const sal_uInt32 nInBetweenSizeHorFirst(nHeight * nNewWidth);
const sal_uInt32 nInBetweenSizeVerFirst(nNewHeight * nWidth); const sal_uInt32 nInBetweenSizeVerFirst(nNewHeight * nWidth);
Bitmap aSource(*this);
Bitmap aInterm;
if(nInBetweenSizeHorFirst < nInBetweenSizeVerFirst) if(nInBetweenSizeHorFirst < nInBetweenSizeVerFirst)
{ {
if(bScaleHor) if(bScaleHor)
{ {
bResult = ImplScaleConvolutionHor(*this, aInterm, fScaleX, aKernel); bResult = ImplScaleConvolutionHor(aSource, aResult, fScaleX, aKernel);
} }
else
aInterm = *this;
if(bResult && bScaleVer) 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 else
{ {
if(bScaleVer) if(bScaleVer)
{ {
bResult = ImplScaleConvolutionVer(*this, aInterm, fScaleY, aKernel); bResult = ImplScaleConvolutionVer(aSource, aResult, fScaleY, aKernel);
} }
else
aInterm = *this;
if(bResult && bScaleHor) 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;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment