[Libreoffice-commits] core.git: Branch 'feature/opengl-vcl' - vcl/quartz vcl/source vcl/win

Jan Holesovsky kendy at collabora.com
Fri Nov 14 11:44:07 PST 2014


 vcl/quartz/salgdicommon.cxx    |    6 ++++++
 vcl/source/outdev/bitmap.cxx   |    8 ++++----
 vcl/win/source/gdi/gdiimpl.cxx |   11 -----------
 3 files changed, 10 insertions(+), 15 deletions(-)

New commits:
commit 0630ed73aa4c29447b10fdc509e693d1475b76a3
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Fri Nov 14 20:35:44 2014 +0100

    vcl: The backend should decide whether fast alpha drawing is available.
    
    The unx drawAlphaBitmap() already already checks that the source and
    destination have the same size.
    
    Windows and OpenGL should be able to handle that without trouble.
    
    OS X would need some additional code, so added an early return for the case
    the source and result sizes do not match.
    
    Change-Id: Ib09654aaa9c9064c232cff5094fcaa1190e931c6

diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx
index ad15432..6a8d953 100644
--- a/vcl/quartz/salgdicommon.cxx
+++ b/vcl/quartz/salgdicommon.cxx
@@ -568,6 +568,12 @@ bool AquaSalGraphics::drawAlphaBitmap( const SalTwoRect& rTR,
 {
     DBG_DRAW_OPERATION("drawAlphaBitmap", true);
 
+    if (rTR.mnSrcWidth != rTR.mnDestWidth || rTR.mnSrcHeight != rTR.mnDestHeight)
+    {
+        // TODO - would be better to scale it by the native code
+        return false;
+    }
+
     // An image mask can't have a depth > 8 bits (should be 1 to 8 bits)
     if( rAlphaBmp.GetBitCount() > 8 )
     {
diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx
index 9a2e56d..4b0583b 100644
--- a/vcl/source/outdev/bitmap.cxx
+++ b/vcl/source/outdev/bitmap.cxx
@@ -524,10 +524,10 @@ void OutputDevice::DrawDeviceBitmap( const Point& rDestPt, const Size& rDestSize
 
                 if (bTryDirectPaint)
                 {
-                    // only paint direct when no scaling and no MapMode, else the
+                    // only paint direct when no MapMode, else the
                     // more expensive conversions may be done for short-time Bitmap/BitmapEx
                     // used for buffering only
-                    if (IsMapMode() || aPosAry.mnSrcWidth != aPosAry.mnDestWidth || aPosAry.mnSrcHeight != aPosAry.mnDestHeight)
+                    if (IsMapMode())
                     {
                         bTryDirectPaint = false;
                     }
@@ -663,10 +663,10 @@ void OutputDevice::DrawDeviceAlphaBitmap( const Bitmap& rBmp, const AlphaMask& r
 
         if (bTryDirectPaint)
         {
-            // only paint direct when no scaling and no MapMode, else the
+            // only paint direct when no MapMode, else the
             // more expensive conversions may be done for short-time Bitmap/BitmapEx
             // used for buffering only
-            if (IsMapMode() || rSrcSizePixel.Width() != aOutSz.Width() || rSrcSizePixel.Height() != aOutSz.Height())
+            if (IsMapMode())
             {
                 bTryDirectPaint = false;
             }
diff --git a/vcl/win/source/gdi/gdiimpl.cxx b/vcl/win/source/gdi/gdiimpl.cxx
index 7be39e6..48dd4b1 100644
--- a/vcl/win/source/gdi/gdiimpl.cxx
+++ b/vcl/win/source/gdi/gdiimpl.cxx
@@ -774,17 +774,6 @@ void WinSalGraphicsImpl::drawBitmap( const SalTwoRect& rPosAry,
     DBG_ASSERT( !mrParent.isPrinter(), "No transparency print possible!" );
     bool bTryDirectPaint(!mrParent.isPrinter() && !mbXORMode);
 
-    if(bTryDirectPaint)
-    {
-        // only paint direct when no scaling and no MapMode, else the
-        // more expensive conversions may be done for short-time Bitmap/BitmapEx
-        // used for buffering only
-        if(rPosAry.mnSrcWidth == rPosAry.mnDestWidth && rPosAry.mnSrcHeight == rPosAry.mnDestHeight)
-        {
-            bTryDirectPaint = false;
-        }
-    }
-
     // try to draw using GdiPlus directly
     if(bTryDirectPaint && drawAlphaBitmap(rPosAry, rSSalBitmap, rSTransparentBitmap))
     {


More information about the Libreoffice-commits mailing list