[Libreoffice-commits] core.git: Branch 'libreoffice-4-2-6' - vcl/source

Michael Stahl mstahl at redhat.com
Wed Jul 23 01:01:09 PDT 2014


 vcl/source/gdi/outdev2.cxx |   27 +--------------------------
 1 file changed, 1 insertion(+), 26 deletions(-)

New commits:
commit 7249420f98baa1cd839354fc07923595d0188841
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Jul 10 17:05:39 2014 +0200

    fdo#80498: vcl: Revert "fdo#74124: Scale the pictures before calling ...
    
    ... ImplDrawAlpha()."
    
    This reverts commit 3cf3700b7a903e88f5296076c40ae854bce91cdc.
    
    It may look nicer but is unusably slow when scrolling in Writer.
    
    (same as master commit ee36fc7add892690c95a969530ecdcfc1bc9decc)
    
    Conflicts:
    	vcl/source/gdi/outdev2.cxx
    
    Change-Id: Ieb3d0b9dedeb3f1688eb30668e59750f3b569d9b
    Reviewed-on: https://gerrit.libreoffice.org/10205
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    Tested-by: Michael Meeks <michael.meeks at collabora.com>
    (cherry picked from commit 1c269727b470c03f0ea538cad7e1331fd569a579)
    Reviewed-on: https://gerrit.libreoffice.org/10341
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/source/gdi/outdev2.cxx b/vcl/source/gdi/outdev2.cxx
index 48ec303..759c3b4 100644
--- a/vcl/source/gdi/outdev2.cxx
+++ b/vcl/source/gdi/outdev2.cxx
@@ -1001,29 +1001,7 @@ void OutputDevice::ImplDrawBitmapEx( const Point& rDestPt, const Size& rDestSize
 
     if(aBmpEx.IsAlpha())
     {
-        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 = std::abs(aDestSizePixel.Width()  / double(rSrcSizePixel.Width()));
-            double fScaleY = std::abs(aDestSizePixel.Height() / double(rSrcSizePixel.Height()));
-
-            aScaledBitmapEx.Scale(fScaleX, fScaleY);
-
-            // Negative size values are used for mirroring, but Scale already takes
-            // care of mirroring so convert all negative values to positive.
-            aSrcSizePixel = Size(std::abs(aDestSizePixel.Width()),
-                                 std::abs(aDestSizePixel.Height()));
-
-            aSrcPtPixel.X() = rSrcPtPixel.X() * fScaleX;
-            aSrcPtPixel.Y() = rSrcPtPixel.Y() * fScaleY;
-        }
-        ImplDrawAlpha(aScaledBitmapEx.GetBitmap(), aScaledBitmapEx.GetAlpha(), rDestPt, rDestSize, aSrcPtPixel, aSrcSizePixel);
+        ImplDrawAlpha( aBmpEx.GetBitmap(), aBmpEx.GetAlpha(), rDestPt, rDestSize, rSrcPtPixel, rSrcSizePixel );
         return;
     }
 
@@ -2085,9 +2063,6 @@ 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!


More information about the Libreoffice-commits mailing list