summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/outdev/bitmap.cxx29
-rw-r--r--vcl/source/rendercontext/drawmode.cxx13
2 files changed, 28 insertions, 14 deletions
diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx
index f80ccb0a52bf..bf0b6031afdf 100644
--- a/vcl/source/outdev/bitmap.cxx
+++ b/vcl/source/outdev/bitmap.cxx
@@ -83,7 +83,34 @@ void OutputDevice::DrawBitmap( const Point& rDestPt, const Size& rDestSize,
return;
}
- Bitmap aBmp(vcl::drawmode::GetBitmap(rBitmap, GetDrawMode()));
+ Bitmap aBmp( rBitmap );
+
+ if ( mnDrawMode & ( DrawModeFlags::BlackBitmap | DrawModeFlags::WhiteBitmap |
+ DrawModeFlags::GrayBitmap ) )
+ {
+ if ( mnDrawMode & ( DrawModeFlags::BlackBitmap | DrawModeFlags::WhiteBitmap ) )
+ {
+ sal_uInt8 cCmpVal;
+
+ if ( mnDrawMode & DrawModeFlags::BlackBitmap )
+ cCmpVal = 0;
+ else
+ cCmpVal = 255;
+
+ Color aCol( cCmpVal, cCmpVal, cCmpVal );
+ Push( PushFlags::LINECOLOR | PushFlags::FILLCOLOR );
+ SetLineColor( aCol );
+ SetFillColor( aCol );
+ DrawRect( tools::Rectangle( rDestPt, rDestSize ) );
+ Pop();
+ return;
+ }
+ else if( !aBmp.IsEmpty() )
+ {
+ if ( mnDrawMode & DrawModeFlags::GrayBitmap )
+ aBmp.Convert( BmpConversion::N8BitGreys );
+ }
+ }
if ( mpMetaFile )
{
diff --git a/vcl/source/rendercontext/drawmode.cxx b/vcl/source/rendercontext/drawmode.cxx
index 9b2b9236b92a..b1b85d33f52f 100644
--- a/vcl/source/rendercontext/drawmode.cxx
+++ b/vcl/source/rendercontext/drawmode.cxx
@@ -221,19 +221,6 @@ vcl::Font GetFont(vcl::Font const& rFont, DrawModeFlags nDrawMode,
return aFont;
}
-Bitmap GetBitmap(Bitmap const& rBitmap, DrawModeFlags nDrawMode)
-{
- Bitmap aBmp(rBitmap);
-
- if (nDrawMode & DrawModeFlags::GrayBitmap)
- {
- if (!aBmp.IsEmpty())
- aBmp.Convert(BmpConversion::N8BitGreys);
- }
-
- return aBmp;
-}
-
BitmapEx GetBitmapEx(BitmapEx const& rBitmapEx, DrawModeFlags nDrawMode)
{
BitmapEx aBmpEx(rBitmapEx);