summaryrefslogtreecommitdiff
path: root/vcl/source/gdi/print.cxx
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2014-03-23 21:50:42 +1100
committerChris Sherlock <chris.sherlock79@gmail.com>2014-03-26 12:31:22 +0000
commit4d1111aafe4c153ca52d045d726799d4b1753142 (patch)
treef3fc0bb6a2cb1e6a5a5d471e2b6cb155c1cc118d /vcl/source/gdi/print.cxx
parent12d30ef0ca9418d6dfa75e2a95f5213961b2fa21 (diff)
fdo#74702 Move device specific bitmap drawing to its own function
Device specific drawing has been moved to its own function. VirtualDevice and Window draw in the same way, so can be shared in OutputDevice, however Printer has its only specific ways of drawing so it needs its own method. Change-Id: I051fee029a1ec022a131bb12588189178c4109b2 Reviewed-on: https://gerrit.libreoffice.org/8724 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
Diffstat (limited to 'vcl/source/gdi/print.cxx')
-rw-r--r--vcl/source/gdi/print.cxx21
1 files changed, 21 insertions, 0 deletions
diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx
index 25f20a7a14db..a65524b63605 100644
--- a/vcl/source/gdi/print.cxx
+++ b/vcl/source/gdi/print.cxx
@@ -229,6 +229,27 @@ bool Printer::TransformReduceBitmapExTargetRange(
return true;
}
+void Printer::DrawDeviceBitmap( const Point& rDestPt, const Size& rDestSize,
+ const Point& rSrcPtPixel, const Size& rSrcSizePixel,
+ BitmapEx& rBmpEx )
+{
+ if( rBmpEx.IsAlpha() )
+ {
+ // #107169# For true alpha bitmaps, no longer masking the
+ // bitmap, but perform a full alpha blend against a white
+ // background here.
+ Bitmap aBmp( rBmpEx.GetBitmap() );
+ aBmp.Blend( rBmpEx.GetAlpha(), Color( COL_WHITE) );
+ DrawBitmap( rDestPt, rDestSize, rSrcPtPixel, rSrcSizePixel, aBmp );
+ }
+ else
+ {
+ Bitmap aBmp( rBmpEx.GetBitmap() ), aMask( rBmpEx.GetMask() );
+ aBmp.Replace( aMask, Color( COL_WHITE ) );
+ ImplPrintTransparent( aBmp, aMask, rDestPt, rDestSize, rSrcPtPixel, rSrcSizePixel );
+ }
+}
+
void Printer::DrawOutDev( const Point& /*rDestPt*/, const Size& /*rDestSize*/,
const Point& /*rSrcPt*/, const Size& /*rSrcSize*/ )
{