diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2019-11-20 15:37:11 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2019-11-27 09:55:18 +0100 |
commit | d9879200ca3c0167b982ffecfa927bfac46b94c6 (patch) | |
tree | 3974b0c552e9da6dbf39bb044a79dd450add69d1 | |
parent | 6a0f8d88053bd7d33bc7d2032fb682f5579d10d0 (diff) |
handle properly true 32bit bitmaps in some places
I.e. those created with vcl::BackendCapabilities::mbSupportsBitmap32 set.
But there are quite possibly many more places that do not expect
that the Bitmap itself would contain alpha.
Change-Id: I83db37b3d346f42565f96b9bbf81c71b97b6bf8b
-rw-r--r-- | drawinglayer/source/texture/texture3d.cxx | 3 | ||||
-rw-r--r-- | vcl/source/gdi/bitmapex.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/generic/window/salframe.cxx | 1 |
3 files changed, 6 insertions, 0 deletions
diff --git a/drawinglayer/source/texture/texture3d.cxx b/drawinglayer/source/texture/texture3d.cxx index 3c5f7d5e29bf..8874d3425599 100644 --- a/drawinglayer/source/texture/texture3d.cxx +++ b/drawinglayer/source/texture/texture3d.cxx @@ -23,6 +23,7 @@ #include <drawinglayer/texture/texture3d.hxx> #include <vcl/bitmapaccess.hxx> +#include <vcl/BitmapTools.hxx> #include <drawinglayer/primitive3d/hatchtextureprimitive3d.hxx> #include <sal/log.hxx> @@ -76,6 +77,8 @@ namespace drawinglayer mbIsAlpha(false), mbIsTransparent(maBitmapEx.IsTransparent()) { + if(vcl::bitmap::convertBitmap32To24Plus8(maBitmapEx,maBitmapEx)) + mbIsTransparent = maBitmapEx.IsTransparent(); // #121194# Todo: use alpha channel, too (for 3d) maBitmap = maBitmapEx.GetBitmap(); diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx index f37499dff0b8..b4d7c106b37c 100644 --- a/vcl/source/gdi/bitmapex.cxx +++ b/vcl/source/gdi/bitmapex.cxx @@ -689,6 +689,8 @@ sal_uInt8 BitmapEx::GetTransparency(sal_Int32 nX, sal_Int32 nY) const { if (nX >= 0 && nX < GetSizePixel().Width() && nY >= 0 && nY < GetSizePixel().Height()) { + if (maBitmap.GetBitCount() == 32) + return GetPixelColor(nX, nY).GetTransparency(); switch(meTransparent) { case TransparentType::NONE: diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx index 8ac555009541..8b8f029b1897 100644 --- a/vcl/unx/generic/window/salframe.cxx +++ b/vcl/unx/generic/window/salframe.cxx @@ -261,6 +261,7 @@ static void CreateNetWmAppIcon( sal_uInt16 nIcon, NetWmIconData& netwm_icon ) if( aIcon.IsEmpty()) continue; + vcl::bitmap::convertBitmap32To24Plus8(aIcon, aIcon); Bitmap icon = aIcon.GetBitmap(); AlphaMask mask; switch( aIcon.GetTransparentType()) |