summaryrefslogtreecommitdiff
path: root/vcl/source/outdev
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-05-20 09:40:34 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-05-25 13:19:25 +0000
commitd9ac7def8ba320853e8865535a7a14f9af77521e (patch)
tree4aef3ff57b2208fd01633f838c83afe727c26544 /vcl/source/outdev
parent102196f06400864ef49af961352b5c285ee1f3ab (diff)
Convert BMP_FORMAT to scoped enum
Change-Id: I751ab762b6e6f961e9e73a8a2ca92a3f5a5eb1c8 Reviewed-on: https://gerrit.libreoffice.org/25189 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'vcl/source/outdev')
-rw-r--r--vcl/source/outdev/bitmap.cxx20
-rw-r--r--vcl/source/outdev/transparent.cxx8
2 files changed, 15 insertions, 13 deletions
diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx
index f538ca03a5c2..a3e05715b239 100644
--- a/vcl/source/outdev/bitmap.cxx
+++ b/vcl/source/outdev/bitmap.cxx
@@ -766,21 +766,23 @@ public:
{
if (pSource && pSourceAlpha && pDestination)
{
- unsigned long nSourceFormat = pSource->GetScanlineFormat();
- unsigned long nDestinationFormat = pDestination->GetScanlineFormat();
+ ScanlineFormat nSourceFormat = pSource->GetScanlineFormat();
+ ScanlineFormat nDestinationFormat = pDestination->GetScanlineFormat();
switch (nSourceFormat)
{
- case BMP_FORMAT_24BIT_TC_RGB:
- case BMP_FORMAT_24BIT_TC_BGR:
+ case ScanlineFormat::N24BitTcRgb:
+ case ScanlineFormat::N24BitTcBgr:
{
- if ( (nSourceFormat == BMP_FORMAT_24BIT_TC_BGR && nDestinationFormat == BMP_FORMAT_32BIT_TC_BGRA)
- || (nSourceFormat == BMP_FORMAT_24BIT_TC_RGB && nDestinationFormat == BMP_FORMAT_32BIT_TC_RGBA))
+ if ( (nSourceFormat == ScanlineFormat::N24BitTcBgr && nDestinationFormat == ScanlineFormat::N32BitTcBgra)
+ || (nSourceFormat == ScanlineFormat::N24BitTcRgb && nDestinationFormat == ScanlineFormat::N32BitTcRgba))
{
blendBitmap24(pDestination, pSource, pSourceAlpha, nDstWidth, nDstHeight);
return true;
}
}
+ break;
+ default: break;
}
}
return false;
@@ -971,8 +973,8 @@ void OutputDevice::DrawDeviceAlphaBitmapSlowPath(const Bitmap& rBitmap, const Al
Bitmap::ScopedReadAccess pBitmapReadAccess(const_cast<Bitmap&>(rBitmap));
AlphaMask::ScopedReadAccess pAlphaReadAccess(const_cast<AlphaMask&>(rAlpha));
- DBG_ASSERT( pAlphaReadAccess->GetScanlineFormat() == BMP_FORMAT_8BIT_PAL ||
- pAlphaReadAccess->GetScanlineFormat() == BMP_FORMAT_8BIT_TC_MASK,
+ DBG_ASSERT( pAlphaReadAccess->GetScanlineFormat() == ScanlineFormat::N8BitPal ||
+ pAlphaReadAccess->GetScanlineFormat() == ScanlineFormat::N8BitTcMask,
"OutputDevice::ImplDrawAlpha(): non-8bit alpha no longer supported!" );
// #i38887# reading from screen may sometimes fail
@@ -1553,7 +1555,7 @@ Bitmap OutputDevice::BlendBitmap(
{
switch( pP->GetScanlineFormat() )
{
- case BMP_FORMAT_8BIT_PAL:
+ case ScanlineFormat::N8BitPal:
{
for( nY = 0; nY < nDstHeight; nY++ )
{
diff --git a/vcl/source/outdev/transparent.cxx b/vcl/source/outdev/transparent.cxx
index addf0d634708..0f06d065e33c 100644
--- a/vcl/source/outdev/transparent.cxx
+++ b/vcl/source/outdev/transparent.cxx
@@ -494,8 +494,8 @@ void OutputDevice::EmulateDrawTransparent ( const tools::PolyPolygon& rPolyPoly,
pMap[ i ] = BitmapColor( (sal_uInt8) rPal.GetBestIndex( aCol.Merge( aFillCol, cTrans ) ) );
}
- if( pR->GetScanlineFormat() == BMP_FORMAT_1BIT_MSB_PAL &&
- pW->GetScanlineFormat() == BMP_FORMAT_8BIT_PAL )
+ if( pR->GetScanlineFormat() == ScanlineFormat::N1BitMsbPal &&
+ pW->GetScanlineFormat() == ScanlineFormat::N8BitPal )
{
const sal_uInt8 cBlack = aBlack.GetIndex();
@@ -536,8 +536,8 @@ void OutputDevice::EmulateDrawTransparent ( const tools::PolyPolygon& rPolyPoly,
}
else
{
- if( pR->GetScanlineFormat() == BMP_FORMAT_1BIT_MSB_PAL &&
- pW->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_BGR )
+ if( pR->GetScanlineFormat() == ScanlineFormat::N1BitMsbPal &&
+ pW->GetScanlineFormat() == ScanlineFormat::N24BitTcBgr )
{
const sal_uInt8 cBlack = aBlack.GetIndex();