summaryrefslogtreecommitdiff
path: root/vcl/quartz
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-11-17 13:03:23 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-11-23 14:25:59 +0000
commitc43a3a58677b467274ce6c21d7db1a6c0cc65cb4 (patch)
tree3bb61dc498bd5ff72df4be4e0003ab284b0cc655 /vcl/quartz
parentb0f5416d7ee7c988d316df7ffa0318fa6514e4de (diff)
establish that Virtual Devices either match Physical Device depth or ...
are 1 or (rarely) 8 bit and lock that down. Change-Id: I3d946ebef34ffb71c5adea7aa420af50e9584e05
Diffstat (limited to 'vcl/quartz')
-rw-r--r--vcl/quartz/salvd.cxx25
1 files changed, 18 insertions, 7 deletions
diff --git a/vcl/quartz/salvd.cxx b/vcl/quartz/salvd.cxx
index 485ac2018757..b7717fa0f433 100644
--- a/vcl/quartz/salvd.cxx
+++ b/vcl/quartz/salvd.cxx
@@ -38,7 +38,7 @@
SalVirtualDevice* AquaSalInstance::CreateVirtualDevice( SalGraphics* pGraphics,
long &nDX, long &nDY,
- sal_uInt16 nBitCount,
+ DeviceFormat eFormat,
const SystemGraphicsData *pData )
{
// #i92075# can be called first in a thread
@@ -48,29 +48,29 @@ SalVirtualDevice* AquaSalInstance::CreateVirtualDevice( SalGraphics* pGraphics,
if( pData )
{
return new AquaSalVirtualDevice( static_cast< AquaSalGraphics* >( pGraphics ),
- nDX, nDY, nBitCount, pData );
+ nDX, nDY, eFormat, pData );
}
else
{
- AquaSalVirtualDevice* pNew = new AquaSalVirtualDevice( NULL, nDX, nDY, nBitCount, NULL );
+ AquaSalVirtualDevice* pNew = new AquaSalVirtualDevice( NULL, nDX, nDY, eFormat, NULL );
pNew->SetSize( nDX, nDY );
return pNew;
}
#else
return new AquaSalVirtualDevice( static_cast< AquaSalGraphics* >( pGraphics ),
- nDX, nDY, nBitCount, pData );
+ nDX, nDY, eFormat, pData );
#endif
}
AquaSalVirtualDevice::AquaSalVirtualDevice( AquaSalGraphics* pGraphic, long &nDX, long &nDY,
- sal_uInt16 nBitCount, const SystemGraphicsData *pData )
+ DeviceFormat eFormat, const SystemGraphicsData *pData )
: mbGraphicsUsed( false )
, mxBitmapContext( nullptr )
, mnBitmapDepth( 0 )
, mxLayer( nullptr )
{
SAL_INFO( "vcl.virdev", "AquaSalVirtualDevice::AquaSalVirtualDevice() this=" << this
- << " size=(" << nDX << "x" << nDY << ") bitcount=" << nBitCount <<
+ << " size=(" << nDX << "x" << nDY << ") bitcount=" << static_cast<int>(eFormat) <<
" pData=" << pData << " context=" << (pData ? pData->rCGContext : nullptr) );
if( pGraphic && pData && pData->rCGContext )
@@ -110,7 +110,18 @@ AquaSalVirtualDevice::AquaSalVirtualDevice( AquaSalGraphics* pGraphic, long &nDX
// create empty new virtual device
mbForeignContext = false; // the mxContext is created within VCL
mpGraphics = new AquaSalGraphics(); // never fails
- mnBitmapDepth = nBitCount;
+ switch (eFormat)
+ {
+ case DeviceFormat::BITMASK:
+ mnBitmapDepth = 1;
+ break;
+ case DeviceFormat::GRAYSCALE:
+ mnBitmapDepth = 8;
+ break;
+ default:
+ mnBitmapDepth = 0;
+ break;
+ }
#ifdef MACOSX
// inherit resolution from reference device
if( pGraphic )