[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

Tomaž Vajngerl tomaz.vajngerl at collabora.com
Thu Oct 22 08:54:42 PDT 2015


 vcl/source/gdi/impimage.cxx |   27 ++++++++++++++++++++++++---
 1 file changed, 24 insertions(+), 3 deletions(-)

New commits:
commit 6b7ae3f8dd917d4c3a77c8adda502ca98f86c683
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date:   Thu Oct 15 22:21:09 2015 +0200

    tdf#94384 change the black icons fix for LO 5.0
    
    commit 15195fb801b354a2f2356aa3cea0a06b9eb1e066 removed the Windows
    specific codepath in ImplUpdateDisplayBmp, but it is much safer for
    LO 5.0 to skip the problematic codepath only when OpenGL is enabled.
    
    The codepath will stay removed only in master.
    
    Change-Id: I438e8194f5ebfee2c58193aeb7fd00e1d44b9690
    Reviewed-on: https://gerrit.libreoffice.org/19403
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/source/gdi/impimage.cxx b/vcl/source/gdi/impimage.cxx
index ce6323f..4acbc62 100644
--- a/vcl/source/gdi/impimage.cxx
+++ b/vcl/source/gdi/impimage.cxx
@@ -29,6 +29,10 @@
 #include <image.h>
 #include <boost/scoped_array.hpp>
 
+#if defined WNT
+#include <vcl/opengl/OpenGLHelper.hxx>
+#endif
+
 #define IMPSYSIMAGEITEM_MASK        ( 0x01 )
 #define IMPSYSIMAGEITEM_ALPHA       ( 0x02 )
 
@@ -327,11 +331,28 @@ void ImplImageBmp::Draw( sal_uInt16 nPos, OutputDevice* pOutDev,
     }
 }
 
-void ImplImageBmp::ImplUpdateDisplayBmp(OutputDevice*)
+void ImplImageBmp::ImplUpdateDisplayBmp( OutputDevice*
+#if defined WNT
+pOutDev
+#endif
+)
 {
-    if (!mpDisplayBmp && !maBmpEx.IsEmpty())
+    if( !mpDisplayBmp && !maBmpEx.IsEmpty() )
     {
-        mpDisplayBmp = new BitmapEx(maBmpEx);
+#if defined WNT
+        if( !maBmpEx.IsAlpha() && !OpenGLHelper::isVCLOpenGLEnabled())
+        {
+            // FIXME: this looks like rather an obsolete code-path to me.
+            const Bitmap aBmp( maBmpEx.GetBitmap().CreateDisplayBitmap( pOutDev ) );
+
+            if( maBmpEx.IsTransparent() )
+                mpDisplayBmp = new BitmapEx( aBmp, maBmpEx.GetMask().CreateDisplayBitmap( pOutDev ) );
+            else
+                mpDisplayBmp = new BitmapEx( aBmp );
+        }
+        else
+#endif
+            mpDisplayBmp = new BitmapEx( maBmpEx );
     }
 }
 


More information about the Libreoffice-commits mailing list