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

New commits:
commit 6b7ae3f8dd917d4c3a77c8adda502ca98f86c683
Author: Tomaž Vajngerl <[email protected]>
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 <[email protected]>
    Tested-by: Caolán McNamara <[email protected]>

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 );
     }
 }
 
_______________________________________________
Libreoffice-commits mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to