diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2006-09-08 07:33:54 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2006-09-08 07:33:54 +0000 |
commit | 335edf6b9837107b04c6a8de3c01b651bbef008a (patch) | |
tree | f854a3dc0466de2fa30ccd5d49ca502d6f9e2d21 /vcl/source/gdi/bmpacc3.cxx | |
parent | 32c239b70d929b25319eb8fc82191419562b649c (diff) |
INTEGRATION: CWS pngperf (1.6.18); FILE MERGED
2006/08/21 15:23:19 hdu 1.6.18.3: #i67660# get rid of warning on wntmsci10.pro
2006/08/21 10:48:51 hdu 1.6.18.2: #i67660# get rid of assertions about non-matching color format
2005/09/27 10:13:57 hdu 1.6.18.1: #i54953# use fast bitmap buffer erase if available
Diffstat (limited to 'vcl/source/gdi/bmpacc3.cxx')
-rw-r--r-- | vcl/source/gdi/bmpacc3.cxx | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/vcl/source/gdi/bmpacc3.cxx b/vcl/source/gdi/bmpacc3.cxx index 3a4347b519a1..48f6ca059267 100644 --- a/vcl/source/gdi/bmpacc3.cxx +++ b/vcl/source/gdi/bmpacc3.cxx @@ -4,9 +4,9 @@ * * $RCSfile: bmpacc3.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: rt $ $Date: 2005-09-09 11:54:48 $ + * last change: $Author: vg $ $Date: 2006-09-08 08:33:54 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -48,6 +48,9 @@ #ifndef _SV_BMPACC_HXX #include <bmpacc.hxx> #endif +#ifndef _SV_BMPFAST_HXX +#include <bmpfast.hxx> +#endif // --------------------- // - BitmapWriteAccess - @@ -123,6 +126,16 @@ Color BitmapWriteAccess::GetFillColor() const void BitmapWriteAccess::Erase( const Color& rColor ) { + // convert the color format from RGB to palette index if needed + // TODO: provide and use Erase( BitmapColor& method) + BitmapColor aColor = rColor; + if( HasPalette() ) + aColor = BitmapColor( (BYTE)GetBestPaletteIndex( rColor) ); + // try fast bitmap method first + if( ImplFastEraseBitmap( *mpBuffer, aColor ) ) + return; + + // use the canonical method to clear the bitmap BitmapColor* pOldFillColor = mpFillColor ? new BitmapColor( *mpFillColor ) : NULL; const Point aPoint; const Rectangle aRect( aPoint, maBitmap.GetSizePixel() ); |