summaryrefslogtreecommitdiff
path: root/canvas
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2021-03-13 12:00:28 +0900
committerTomaž Vajngerl <quikee@gmail.com>2021-03-13 12:17:49 +0100
commit68bc6a5dd68006ab86e7ef26f9e5d241cb118879 (patch)
treedebd00d1a05228759974b2d09666dfcccb379ab3 /canvas
parenta73f24f47aea2dfa57459424f48b11b2b835e334 (diff)
add PixelFormat enum that replaces bit count in Bitmap/BitmapEx
Bit count for the image is a numeric value (sal_uInt16) but only a handful of values make sense - namely 1,4,8,24 and 32. This replaces the numeric value with an enum, which only accepts those values and checks the correct values are used at compile time. Change-Id: I0fc137c62bce3b0d021f05019a1648da628521bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112408 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'canvas')
-rw-r--r--canvas/source/vcl/canvasbitmap.cxx5
1 files changed, 1 insertions, 4 deletions
diff --git a/canvas/source/vcl/canvasbitmap.cxx b/canvas/source/vcl/canvasbitmap.cxx
index 1de5800fa653..9ae37c2c495a 100644
--- a/canvas/source/vcl/canvasbitmap.cxx
+++ b/canvas/source/vcl/canvasbitmap.cxx
@@ -39,10 +39,7 @@ namespace vclcanvas
{
// create bitmap for given reference device
// ========================================
- const sal_uInt16 nBitCount( sal_uInt16(24U) );
- const BitmapPalette* pPalette = nullptr;
-
- Bitmap aBitmap( rSize, nBitCount, pPalette );
+ Bitmap aBitmap(rSize, vcl::PixelFormat::N24_BPP);
// only create alpha channel bitmap, if factory requested
// that. Providing alpha-channeled bitmaps by default has,