From 6588c30ed4477627b2623560ca867682b189bc80 Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Mon, 26 Feb 2024 21:45:35 +0900 Subject: vcl: separate scanline direction from ScanlineFormat MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ScanlineFormat enum is used to indicate 2 things - scanline format type and scanline direction (TopDown or BottomUp). This makes it complex to manipulate with (using bit arithmetics) and hard to use in general for no benefit, so this commit separates direction out from the ScanlineFormat into ScanlineDirection enum. ScanlineFormat is now just a simple enum class (not a bit field). Change-Id: Iad55d0a4c8c07b71221c2facf7cf6a2d518fec0c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163943 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl --- vcl/headless/svpbmp.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'vcl/headless/svpbmp.cxx') diff --git a/vcl/headless/svpbmp.cxx b/vcl/headless/svpbmp.cxx index 178ea129c655..328822f78c77 100644 --- a/vcl/headless/svpbmp.cxx +++ b/vcl/headless/svpbmp.cxx @@ -57,17 +57,17 @@ static std::optional ImplCreateDIB( switch (ePixelFormat) { case vcl::PixelFormat::N8_BPP: - pDIB->mnFormat = ScanlineFormat::N8BitPal; + pDIB->meFormat = ScanlineFormat::N8BitPal; break; case vcl::PixelFormat::N24_BPP: - pDIB->mnFormat = SVP_24BIT_FORMAT; + pDIB->meFormat = SVP_24BIT_FORMAT; break; case vcl::PixelFormat::N32_BPP: - pDIB->mnFormat = SVP_CAIRO_FORMAT; + pDIB->meFormat = SVP_CAIRO_FORMAT; break; case vcl::PixelFormat::INVALID: assert(false); - pDIB->mnFormat = SVP_CAIRO_FORMAT; + pDIB->meFormat = SVP_CAIRO_FORMAT; break; } @@ -75,7 +75,7 @@ static std::optional ImplCreateDIB( if (ePixelFormat <= vcl::PixelFormat::N8_BPP) nColors = vcl::numberOfColors(ePixelFormat); - pDIB->mnFormat |= ScanlineFormat::TopDown; + pDIB->meDirection = ScanlineDirection::TopDown; pDIB->mnWidth = rSize.Width(); pDIB->mnHeight = rSize.Height(); tools::Long nScanlineBase; -- cgit