summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2008-05-30 09:05:52 +0000
committerOliver Bolte <obo@openoffice.org>2008-05-30 09:05:52 +0000
commitcec34297b62c1a2f10f9e728a1b6f9e2da26f3d5 (patch)
tree2b26b43a4a3f39679c31f97d5eab78b692f977ad
parentc5515a1ed4fc81391f0a0c852f867c97a5f329b7 (diff)
INTEGRATION: CWS aquabmpfix01 (1.21.218); FILE MERGED
2008/05/13 14:03:24 hdu 1.21.218.4: #100000# remove compile warnings 2008/05/09 11:08:07 hdu 1.21.218.3: RESYNC: (1.21-1.22); FILE MERGED 2008/04/25 15:42:07 hdu 1.21.218.2: #i87689# refactor AquaSalGraphic to avoid excessive Quartz bitmap operations 2008/03/13 15:42:18 hdu 1.21.218.1: #i87002# allow grey-only AquaSalBitmaps to avoid unneeded conversions
-rw-r--r--vcl/source/gdi/bitmap.cxx20
1 files changed, 18 insertions, 2 deletions
diff --git a/vcl/source/gdi/bitmap.cxx b/vcl/source/gdi/bitmap.cxx
index bacea96c8df4..2d12a67efedf 100644
--- a/vcl/source/gdi/bitmap.cxx
+++ b/vcl/source/gdi/bitmap.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: bitmap.cxx,v $
- * $Revision: 1.22 $
+ * $Revision: 1.23 $
*
* This file is part of OpenOffice.org.
*
@@ -162,7 +162,7 @@ Bitmap::~Bitmap()
// ------------------------------------------------------------------
-const BitmapPalette& Bitmap::GetGreyPalette( USHORT nEntries )
+const BitmapPalette& Bitmap::GetGreyPalette( int nEntries )
{
static BitmapPalette aGreyPalette2;
static BitmapPalette aGreyPalette4;
@@ -232,6 +232,22 @@ const BitmapPalette& Bitmap::GetGreyPalette( USHORT nEntries )
// ------------------------------------------------------------------
+bool BitmapPalette::IsGreyPalette() const
+{
+ // TODO: add an IsGreyPalette flag to BitmapPalette
+ // TODO: unless this causes problems binary compatibility
+ const int nEntryCount = GetEntryCount();
+ if( !nEntryCount ) // NOTE: an empty palette means 1:1 mapping
+ return true;
+ const BitmapPalette& rGreyPalette = Bitmap::GetGreyPalette( nEntryCount );
+ if( rGreyPalette == *this )
+ return true;
+ // TODO: is it worth to compare the entries?
+ return false;
+}
+
+// ------------------------------------------------------------------
+
Bitmap& Bitmap::operator=( const Bitmap& rBitmap )
{
maPrefSize = rBitmap.maPrefSize;