summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.com>2015-10-15 22:21:09 +0200
committerCaolán McNamara <caolanm@redhat.com>2015-10-22 15:54:14 +0000
commit6b7ae3f8dd917d4c3a77c8adda502ca98f86c683 (patch)
treee55dc34d49339a1bf368d77b9889757d29df4ab1
parente5314175b3860d2416840e1008305d3f91cee91a (diff)
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@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--vcl/source/gdi/impimage.cxx27
1 files changed, 24 insertions, 3 deletions
diff --git a/vcl/source/gdi/impimage.cxx b/vcl/source/gdi/impimage.cxx
index ce6323fd5be9..4acbc6236476 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 );
}
}