diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2019-09-24 21:38:51 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-09-26 03:04:01 +0200 |
commit | 78b9dac2ee77bf6efc1298962cbeca284db5b00a (patch) | |
tree | 120d13b666f6d2a67a4e79b5dd05b65a13bd2458 /vcl/quartz | |
parent | 3a7d479c4c852499e8e4e2bc4273f02aec5051be (diff) |
remove internal use of 16-bit packed formats
none of our supported hardware uses these any more
Change-Id: Ic95d6df619a05df0bec1f5870596cb2bb3bcc6cb
Reviewed-on: https://gerrit.libreoffice.org/79476
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/quartz')
-rw-r--r-- | vcl/quartz/salbmp.cxx | 55 | ||||
-rw-r--r-- | vcl/quartz/salgdicommon.cxx | 2 |
2 files changed, 6 insertions, 51 deletions
diff --git a/vcl/quartz/salbmp.cxx b/vcl/quartz/salbmp.cxx index 710a9eb408ee..117c038c844e 100644 --- a/vcl/quartz/salbmp.cxx +++ b/vcl/quartz/salbmp.cxx @@ -45,10 +45,6 @@ #include "saldatabasic.hxx" #endif -static const unsigned long k16BitRedColorMask = 0x00007c00; -static const unsigned long k16BitGreenColorMask = 0x000003e0; -static const unsigned long k16BitBlueColorMask = 0x0000001f; - static const unsigned long k32BitRedColorMask = 0x00ff0000; static const unsigned long k32BitGreenColorMask = 0x0000ff00; static const unsigned long k32BitBlueColorMask = 0x000000ff; @@ -56,7 +52,7 @@ static const unsigned long k32BitBlueColorMask = 0x000000ff; static bool isValidBitCount( sal_uInt16 nBitCount ) { return (nBitCount == 1) || (nBitCount == 4) || (nBitCount == 8) || - (nBitCount == 16) || (nBitCount == 24) || (nBitCount == 32); + (nBitCount == 24) || (nBitCount == 32); } QuartzSalBitmap::QuartzSalBitmap() @@ -216,9 +212,9 @@ bool QuartzSalBitmap::CreateContext() CGBitmapInfo aCGBmpInfo = kCGImageAlphaNoneSkipFirst; // convert data into something accepted by CGBitmapContextCreate() - size_t bitsPerComponent = (mnBits == 16) ? 5 : 8; + size_t bitsPerComponent = 8; sal_uInt32 nContextBytesPerRow = mnBytesPerRow; - if( (mnBits == 16) || (mnBits == 32) ) + if( mnBits == 32 ) { // no conversion needed for truecolor m_pContextBuffer = m_pUserBuffer; @@ -279,11 +275,10 @@ bool QuartzSalBitmap::AllocateUserData() case 1: mnBytesPerRow = (mnWidth + 7) >> 3; break; case 4: mnBytesPerRow = (mnWidth + 1) >> 1; break; case 8: mnBytesPerRow = mnWidth; break; - case 16: mnBytesPerRow = mnWidth << 1; break; case 24: mnBytesPerRow = (mnWidth << 1) + mnWidth; break; case 32: mnBytesPerRow = mnWidth << 2; break; default: - OSL_FAIL("vcl::QuartzSalBitmap::AllocateUserData(), illegal bitcount!"); + assert(false && "vcl::QuartzSalBitmap::AllocateUserData(), illegal bitcount!"); } } @@ -371,34 +366,6 @@ public: } }; -class ImplPixelFormat16 : public ImplPixelFormat -// currently R5G6B5-format for 16bit depth -{ - sal_uInt16* pData; -public: - - virtual void StartLine( sal_uInt8* pLine ) override - { - pData = reinterpret_cast<sal_uInt16*>(pLine); - } - virtual void SkipPixel( sal_uInt32 nPixel ) override - { - pData += nPixel; - } - virtual Color ReadPixel() override - { - const Color c( (*pData & 0xf800) >> 8, (*pData & 0x07e0) >> 3 , (*pData & 0x001f) << 3 ); - pData++; - return c; - } - virtual void WritePixel( Color nColor ) override - { - *pData++ = (( nColor.GetRed() & 0xf8 ) << 8 ) | - (( nColor.GetGreen() & 0xfc ) << 3 ) | - (( nColor.GetBlue() & 0xf8 ) >> 3 ); - } -}; - class ImplPixelFormat8 : public ImplPixelFormat { private: @@ -544,7 +511,6 @@ std::unique_ptr<ImplPixelFormat> ImplPixelFormat::GetFormat( sal_uInt16 nBits, c case 1: return std::make_unique<ImplPixelFormat1>( rPalette ); case 4: return std::make_unique<ImplPixelFormat4>( rPalette ); case 8: return std::make_unique<ImplPixelFormat8>( rPalette ); - case 16: return std::make_unique<ImplPixelFormat16>(); case 24: return std::make_unique<ImplPixelFormat24>(); case 32: return std::make_unique<ImplPixelFormat32>(); default: @@ -745,18 +711,6 @@ BitmapBuffer* QuartzSalBitmap::AcquireBuffer( BitmapAccessMode /*nMode*/ ) case 8: pBuffer->mnFormat = ScanlineFormat::N8BitPal; break; - case 16: - { - pBuffer->mnFormat = ScanlineFormat::N16BitTcMsbMask; - ColorMaskElement aRedMask(k16BitRedColorMask); - aRedMask.CalcMaskShift(); - ColorMaskElement aGreenMask(k16BitGreenColorMask); - aGreenMask.CalcMaskShift(); - ColorMaskElement aBlueMask(k16BitBlueColorMask); - aBlueMask.CalcMaskShift(); - pBuffer->maColorMask = ColorMask(aRedMask, aGreenMask, aBlueMask); - break; - } case 24: pBuffer->mnFormat = ScanlineFormat::N24BitTcBgr; break; @@ -772,6 +726,7 @@ BitmapBuffer* QuartzSalBitmap::AcquireBuffer( BitmapAccessMode /*nMode*/ ) pBuffer->maColorMask = ColorMask(aRedMask, aGreenMask, aBlueMask); break; } + default: assert(false); } // some BitmapBuffer users depend on a complete palette diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx index eee568533259..19f74464622b 100644 --- a/vcl/quartz/salgdicommon.cxx +++ b/vcl/quartz/salgdicommon.cxx @@ -1846,7 +1846,7 @@ void XorEmulation::SetTarget( int nWidth, int nHeight, int nTargetDepth, { nBitDepth = 32; } - int nBytesPerRow = (nBitDepth == 16) ? 2 : 4; + int nBytesPerRow = 4; const size_t nBitsPerComponent = (nBitDepth == 16) ? 5 : 8; if( nBitDepth <= 8 ) { |