diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-01 15:04:45 +0200 |
---|---|---|
committer | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2017-11-28 00:12:52 -0500 |
commit | af8e50a21ad47aa15fe3773c053735f8321fcf46 (patch) | |
tree | f04e1f1fdd97c2ba1f523675c6aeb0111a025402 /vcl | |
parent | e540ccfb5eb43bd4a3d6920074dce8436720ba8e (diff) |
convert BmpCombine to scoped enum and drop unused
Change-Id: Ic67474683a25a25e5753777f4bbbeded6ceba414
Reviewed-on: https://gerrit.libreoffice.org/33793
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
(cherry picked from commit 52360bf8dd567598593cb212ac85f0c919315618)
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/filter/wmf/winmtf.cxx | 4 | ||||
-rw-r--r-- | vcl/source/gdi/bitmap.cxx | 87 |
2 files changed, 4 insertions, 87 deletions
diff --git a/vcl/source/filter/wmf/winmtf.cxx b/vcl/source/filter/wmf/winmtf.cxx index c265da3be3da..d061fb75b5a2 100644 --- a/vcl/source/filter/wmf/winmtf.cxx +++ b/vcl/source/filter/wmf/winmtf.cxx @@ -1582,11 +1582,11 @@ void WinMtfOutput::ImplDrawBitmap( const Point& rPos, const Size& rSize, const B if ( rBitmap.GetTransparentColor() == Color( COL_WHITE ) ) { - aMask.CombineSimple( rBitmap.GetMask(), BMP_COMBINE_OR ); + aMask.CombineSimple( rBitmap.GetMask(), BmpCombine::Or ); } else { - aMask.CombineSimple( rBitmap.GetMask(), BMP_COMBINE_AND ); + aMask.CombineSimple( rBitmap.GetMask(), BmpCombine::And ); } aBmpEx = BitmapEx( rBitmap.GetBitmap(), aMask ); diff --git a/vcl/source/gdi/bitmap.cxx b/vcl/source/gdi/bitmap.cxx index a7ac32d52e94..ee4dafdcee92 100644 --- a/vcl/source/gdi/bitmap.cxx +++ b/vcl/source/gdi/bitmap.cxx @@ -1735,31 +1735,7 @@ bool Bitmap::CombineSimple( const Bitmap& rMask, BmpCombine eCombine ) switch( eCombine ) { - case BMP_COMBINE_COPY: - { - for( long nY = 0L; nY < nHeight; nY++ ) for( long nX = 0L; nX < nWidth; nX++ ) - { - if( pMaskAcc->GetPixel( nY, nX ) == aMaskBlack ) - pAcc->SetPixel( nY, nX, aBlack ); - else - pAcc->SetPixel( nY, nX, aWhite ); - } - } - break; - - case BMP_COMBINE_INVERT: - { - for( long nY = 0L; nY < nHeight; nY++ ) for( long nX = 0L; nX < nWidth; nX++ ) - { - if( pAcc->GetPixel( nY, nX ) == aBlack ) - pAcc->SetPixel( nY, nX, aWhite ); - else - pAcc->SetPixel( nY, nX, aBlack ); - } - } - break; - - case BMP_COMBINE_AND: + case BmpCombine::And: { for( long nY = 0L; nY < nHeight; nY++ ) for( long nX = 0L; nX < nWidth; nX++ ) { @@ -1771,19 +1747,7 @@ bool Bitmap::CombineSimple( const Bitmap& rMask, BmpCombine eCombine ) } break; - case BMP_COMBINE_NAND: - { - for( long nY = 0L; nY < nHeight; nY++ ) for( long nX = 0L; nX < nWidth; nX++ ) - { - if( pMaskAcc->GetPixel( nY, nX ) != aMaskBlack && pAcc->GetPixel( nY, nX ) != aBlack ) - pAcc->SetPixel( nY, nX, aBlack ); - else - pAcc->SetPixel( nY, nX, aWhite ); - } - } - break; - - case BMP_COMBINE_OR: + case BmpCombine::Or: { for( long nY = 0L; nY < nHeight; nY++ ) for( long nX = 0L; nX < nWidth; nX++ ) { @@ -1795,53 +1759,6 @@ bool Bitmap::CombineSimple( const Bitmap& rMask, BmpCombine eCombine ) } break; - case BMP_COMBINE_NOR: - { - for( long nY = 0L; nY < nHeight; nY++ ) for( long nX = 0L; nX < nWidth; nX++ ) - { - if( pMaskAcc->GetPixel( nY, nX ) != aMaskBlack || pAcc->GetPixel( nY, nX ) != aBlack ) - pAcc->SetPixel( nY, nX, aBlack ); - else - pAcc->SetPixel( nY, nX, aWhite ); - } - } - break; - - case BMP_COMBINE_XOR: - { - for( long nY = 0L; nY < nHeight; nY++ ) for( long nX = 0L; nX < nWidth; nX++ ) - { - aPixel = pAcc->GetPixel( nY, nX ); - aMaskPixel = pMaskAcc->GetPixel( nY, nX ); - - if( ( aMaskPixel != aMaskBlack && aPixel == aBlack ) || - ( aMaskPixel == aMaskBlack && aPixel != aBlack ) ) - { - pAcc->SetPixel( nY, nX, aWhite ); - } - else - pAcc->SetPixel( nY, nX, aBlack ); - } - } - break; - - case BMP_COMBINE_NXOR: - { - for( long nY = 0L; nY < nHeight; nY++ ) for( long nX = 0L; nX < nWidth; nX++ ) - { - aPixel = pAcc->GetPixel( nY, nX ); - aMaskPixel = pMaskAcc->GetPixel( nY, nX ); - - if( ( aMaskPixel != aMaskBlack && aPixel == aBlack ) || - ( aMaskPixel == aMaskBlack && aPixel != aBlack ) ) - { - pAcc->SetPixel( nY, nX, aBlack ); - } - else - pAcc->SetPixel( nY, nX, aWhite ); - } - } - break; } bRet = true; |