summaryrefslogtreecommitdiff
path: root/canvas
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2021-03-27 10:14:13 +0900
committerTomaž Vajngerl <quikee@gmail.com>2021-04-02 06:28:39 +0200
commit88a177f827eba204dea92b631032411de8213ee4 (patch)
tree3107896970ac35f9fd1cb3804634efdef78c2313 /canvas
parent465b8b0e9ad4b0c9c7701dee2820a99c5d00b5bf (diff)
vcl: remove GetBitCount and GetColorCount from Bitmap{Ex}
We can cast the PixelFormat enum to int for the same information and we can use the enum to reduce ambiguity when possible. Change-Id: I6ea648139465568cdeb12e5f5f75c7b609365bf4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113188 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'canvas')
-rw-r--r--canvas/source/directx/dx_vcltools.cxx2
-rw-r--r--canvas/source/vcl/spritehelper.cxx4
2 files changed, 3 insertions, 3 deletions
diff --git a/canvas/source/directx/dx_vcltools.cxx b/canvas/source/directx/dx_vcltools.cxx
index 707d358e5869..d29043070ef3 100644
--- a/canvas/source/directx/dx_vcltools.cxx
+++ b/canvas/source/directx/dx_vcltools.cxx
@@ -166,7 +166,7 @@ namespace dxcanvas::tools
"::dxcanvas::tools::bitmapFromVCLBitmapEx(): "
"Unable to acquire read access to bitmap" );
- if( rBmpEx.IsAlpha() || rBmpEx.GetMask().GetBitCount() == 8 )
+ if (rBmpEx.IsAlpha() || rBmpEx.GetMask().getPixelFormat() == vcl::PixelFormat::N8_BPP)
{
Bitmap aAlpha( rBmpEx.IsAlpha() ? rBmpEx.GetAlpha().GetBitmap() : rBmpEx.GetMask());
diff --git a/canvas/source/vcl/spritehelper.cxx b/canvas/source/vcl/spritehelper.cxx
index e8d4fa726e10..7f7035769db2 100644
--- a/canvas/source/vcl/spritehelper.cxx
+++ b/canvas/source/vcl/spritehelper.cxx
@@ -147,7 +147,7 @@ namespace vclcanvas
// bitmasks are much faster than alphamasks on some platforms
// so convert to bitmask if useful
- bool convertTo1Bpp = aMask.GetBitCount() != 1;
+ bool convertTo1Bpp = aMask.getPixelFormat() != vcl::PixelFormat::N1_BPP;
#ifdef MACOSX
convertTo1Bpp = false;
#endif
@@ -166,7 +166,7 @@ namespace vclcanvas
// Note: since we retrieved aBmp and aMask
// directly from an OutDev, it's already a
// 'display bitmap' on windows.
- if( aMask.GetBitCount() == 1 )
+ if (aMask.getPixelFormat() == vcl::PixelFormat::N1_BPP)
maContent = BitmapEx( aBmp.GetBitmap(), aMask.GetBitmap() );
else
maContent = BitmapEx( aBmp.GetBitmap(), AlphaMask( aMask.GetBitmap()) );