summaryrefslogtreecommitdiff
path: root/vcl/source/gdi/outdev2.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/gdi/outdev2.cxx')
-rw-r--r--vcl/source/gdi/outdev2.cxx23
1 files changed, 22 insertions, 1 deletions
diff --git a/vcl/source/gdi/outdev2.cxx b/vcl/source/gdi/outdev2.cxx
index 759c3b47b57f..8ec9c211919a 100644
--- a/vcl/source/gdi/outdev2.cxx
+++ b/vcl/source/gdi/outdev2.cxx
@@ -1001,7 +1001,25 @@ void OutputDevice::ImplDrawBitmapEx( const Point& rDestPt, const Size& rDestSize
if(aBmpEx.IsAlpha())
{
- ImplDrawAlpha( aBmpEx.GetBitmap(), aBmpEx.GetAlpha(), rDestPt, rDestSize, rSrcPtPixel, rSrcSizePixel );
+ Size aDestSizePixel(LogicToPixel(rDestSize));
+
+ BitmapEx aScaledBitmapEx(aBmpEx);
+ Point aSrcPtPixel(rSrcPtPixel);
+ Size aSrcSizePixel(rSrcSizePixel);
+
+ // we have beautiful scaling algorithms, let's use them
+ if (aDestSizePixel != rSrcSizePixel && rSrcSizePixel.Width() != 0 && rSrcSizePixel.Height() != 0)
+ {
+ double fScaleX = double(aDestSizePixel.Width()) / rSrcSizePixel.Width();
+ double fScaleY = double(aDestSizePixel.Height()) / rSrcSizePixel.Height();
+
+ aScaledBitmapEx.Scale(fScaleX, fScaleY);
+
+ aSrcSizePixel = aDestSizePixel;
+ aSrcPtPixel.X() = rSrcPtPixel.X() * fScaleX;
+ aSrcPtPixel.Y() = rSrcPtPixel.Y() * fScaleY;
+ }
+ ImplDrawAlpha(aScaledBitmapEx.GetBitmap(), aScaledBitmapEx.GetAlpha(), rDestPt, rDestSize, aSrcPtPixel, aSrcSizePixel);
return;
}
@@ -2063,6 +2081,9 @@ void OutputDevice::ImplDrawAlpha( const Bitmap& rBmp, const AlphaMask& rAlpha,
if( !bNativeAlpha
&& !aBmpRect.Intersection( Rectangle( rSrcPtPixel, rSrcSizePixel ) ).IsEmpty() )
{
+ // The scaling in this code path produces really ugly results - it
+ // does the most trivial scaling with no smoothing.
+
GDIMetaFile* pOldMetaFile = mpMetaFile;
const bool bOldMap = mbMap;
mpMetaFile = NULL; // fdo#55044 reset before GetBitmap!