summaryrefslogtreecommitdiff
path: root/vcl/source/bitmap/bitmap.cxx
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2019-02-15 13:14:32 +0100
committerTomaž Vajngerl <quikee@gmail.com>2019-04-03 11:57:08 +0200
commit86ea64f216819696cd86d1926aff0a138ace2baf (patch)
treedb513803abc9dc255d27c0f08cba6d6d0c9ef1d9 /vcl/source/bitmap/bitmap.cxx
parent994b41a6c69d20637dcb95894c385f5c0102d600 (diff)
Support for native 32bit Bitmap in VCL and SVP (cairo) backend
This adds basic support for 32bit bitmaps for the SVP backend. For other backends the support is disabled for now as we need to add it for each backend separately and enable support. When this patch is applied it is possible to a Bitmap with bit count 32, but currently no input filter uses this with the exception of the new PngImageReader(libpng based), which is used only for the icons. For a general support more things need to be implemented and tested: - conversion back and fourth between 32-bit and 24-bit + 8bit alpha (or other supported pairs) - 'raw' export of the bitmap needs to be handeled properly (like in SVM import/export) so it creates the correct image. - input filters need to be checked and converted if this is necessary - look for possible bugs when drawing transparent bitmaps - check of UNO API Change-Id: I7a7be0e6134dfdd9a7aeaef897131bb6e710ae7e Reviewed-on: https://gerrit.libreoffice.org/69289 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl/source/bitmap/bitmap.cxx')
-rw-r--r--vcl/source/bitmap/bitmap.cxx14
1 files changed, 12 insertions, 2 deletions
diff --git a/vcl/source/bitmap/bitmap.cxx b/vcl/source/bitmap/bitmap.cxx
index c26cf89c3b66..bf391f339750 100644
--- a/vcl/source/bitmap/bitmap.cxx
+++ b/vcl/source/bitmap/bitmap.cxx
@@ -260,9 +260,19 @@ sal_uInt16 Bitmap::GetBitCount() const
{
if (!mxSalBmp)
return 0;
+
sal_uInt16 nBitCount = mxSalBmp->GetBitCount();
- return ( nBitCount <= 4 ) ? ( ( nBitCount <= 1 ) ? 1 : 4 ):
- ( ( nBitCount <= 8 ) ? 8 : 24);
+ if (nBitCount <= 1)
+ return 1;
+ if (nBitCount <= 4)
+ return 4;
+ if (nBitCount <= 8)
+ return 8;
+ if (nBitCount <= 24)
+ return 24;
+ if (nBitCount <= 32)
+ return 32;
+ return 0;
}
bool Bitmap::HasGreyPalette() const