summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorPatrick Luby <pluby@openoffice.org>2001-01-06 17:11:35 +0000
committerPatrick Luby <pluby@openoffice.org>2001-01-06 17:11:35 +0000
commit848b4d007f0646a008eb2fb65831b70b7a5a0d25 (patch)
tree2373dcf179f255c4be530958b27ad5435696313c /vcl
parent438e238245cde6d4177500841b97ceb75b88260a (diff)
Made mnBitCount data member reflect true pixel depth of GWorld instead of changing it to 24 for 16 and 32 bit pixel depths.
Diffstat (limited to 'vcl')
-rw-r--r--vcl/aqua/source/gdi/salbmp.cxx26
1 files changed, 19 insertions, 7 deletions
diff --git a/vcl/aqua/source/gdi/salbmp.cxx b/vcl/aqua/source/gdi/salbmp.cxx
index d8b7aa232c03..8dc91bb0993e 100644
--- a/vcl/aqua/source/gdi/salbmp.cxx
+++ b/vcl/aqua/source/gdi/salbmp.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: salbmp.cxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: pluby $ $Date: 2001-01-06 02:56:38 $
+ * last change: $Author: pluby $ $Date: 2001-01-06 18:11:35 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -118,8 +118,7 @@ BOOL SalBitmap::Create( const Size& rSize, USHORT nBitCount, const BitmapPalette
if ( mhPixMap )
{
- USHORT nBits = (**mhPixMap).pixelSize;
- mnBitCount = ( nBits <= 8 ) ? nBits : 24;
+ mnBitCount = (**mhPixMap).pixelSize;
maSize = rSize;
bRet = TRUE;
}
@@ -138,14 +137,27 @@ BOOL SalBitmap::Create( const Size& rSize, USHORT nBitCount, const BitmapPalette
BOOL SalBitmap::Create( const SalBitmap& rSalBmp )
{
- return Create( rSalBmp, rSalBmp.mnBitCount );
+ return Create( rSalBmp, rSalBmp.GetBitCount() );
}
// ------------------------------------------------------------------
BOOL SalBitmap::Create( const SalBitmap& rSalBmp, SalGraphics* pGraphics )
{
- return Create( rSalBmp, rSalBmp.mnBitCount );
+ USHORT nBitCount = 0;
+
+ if ( pGraphics && pGraphics->maGraphicsData.mpCGrafPort )
+ {
+ mhPixMap = GetPortPixMap( pGraphics->maGraphicsData.mpCGrafPort );
+
+ if ( mhPixMap )
+ nBitCount = (**mhPixMap).pixelSize;
+ }
+
+ if ( !nBitCount )
+ nBitCount = rSalBmp.GetBitCount();
+
+ return Create( rSalBmp, nBitCount );
}
// ------------------------------------------------------------------
@@ -225,7 +237,7 @@ BitmapBuffer* SalBitmap::AcquireBuffer( BOOL bReadOnly )
LockPortBits( pGraphics->maGraphicsData.mpCGrafPort );
pBuffer->mnFormat = BMP_FORMAT_TOP_DOWN;
- pBuffer->mnBitCount = ( nBits <= 8 ) ? nBits : 24;
+ pBuffer->mnBitCount = nBits;
switch ( nBits )
{