diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2014-04-17 02:56:10 +1000 |
---|---|---|
committer | Chris Sherlock <chris.sherlock79@gmail.com> | 2014-04-17 03:15:53 +1000 |
commit | bc3625fce46e3e4529b2eb7daabc5c66d7b1cbcc (patch) | |
tree | dcd5d82951aaf04891a5f51420bb936569c1139f /vcl | |
parent | c1bc990aa5fd2a40191dae9683db7b0cd3e9a0d0 (diff) |
fdo#74702 Move common mask functionality to ApplyMask
There is code in OutputDevice that essentially carries out the same
functionality as ImplPrintMask, but for VirtualDevice and Window
instances. Therefore, renamed ImplPrintMask to ApplyMask and moved
OutputDevice functionality into new protected function ApplyMask.
Change-Id: Ia88469e9b149f7819dfc538ecbe014198e4534f6
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/gdi/print.cxx | 6 | ||||
-rw-r--r-- | vcl/source/outdev/mask.cxx | 28 |
2 files changed, 14 insertions, 20 deletions
diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx index 7adfcdef8bce..d25a28e5dde4 100644 --- a/vcl/source/gdi/print.cxx +++ b/vcl/source/gdi/print.cxx @@ -801,9 +801,9 @@ void Printer::ImplInitDisplay( const Window* pWindow ) mnDPIY = mpDisplayDev->mnDPIY; } -void Printer::ImplPrintMask( const Bitmap& rMask, const Color& rMaskColor, - const Point& rDestPt, const Size& rDestSize, - const Point& rSrcPtPixel, const Size& rSrcSizePixel ) +void Printer::ApplyMask( const Bitmap& rMask, const Color& rMaskColor, + const Point& rDestPt, const Size& rDestSize, + const Point& rSrcPtPixel, const Size& rSrcSizePixel ) { Point aPt; Point aDestPt( LogicToPixel( rDestPt ) ); diff --git a/vcl/source/outdev/mask.cxx b/vcl/source/outdev/mask.cxx index f8562b2df3ab..20f97d356e86 100644 --- a/vcl/source/outdev/mask.cxx +++ b/vcl/source/outdev/mask.cxx @@ -96,13 +96,15 @@ void OutputDevice::DrawMask( const Point& rDestPt, const Size& rDestSize, OUTDEV_INIT(); - if ( OUTDEV_PRINTER == meOutDevType ) - { - ImplPrintMask( rBitmap, rMaskColor, rDestPt, rDestSize, rSrcPtPixel, rSrcSizePixel ); - return; - } + ApplyMask( rBitmap, rMaskColor, rDestPt, rDestSize, rSrcPtPixel, rSrcSizePixel ); + +} - const ImpBitmap* pImpBmp = rBitmap.ImplGetImpBitmap(); +void OutputDevice::ApplyMask( const Bitmap& rMask, const Color& rMaskColor, + const Point& rDestPt, const Size& rDestSize, + const Point& rSrcPtPixel, const Size& rSrcSizePixel ) +{ + const ImpBitmap* pImpBmp = rMask.ImplGetImpBitmap(); if ( pImpBmp ) { SalTwoRect aPosAry; @@ -125,7 +127,7 @@ void OutputDevice::DrawMask( const Point& rDestPt, const Size& rDestSize, if( nMirrFlags ) { - Bitmap aTmp( rBitmap ); + Bitmap aTmp( rMask ); aTmp.Mirror( nMirrFlags ); mpGraphics->DrawMask( aPosAry, *aTmp.ImplGetImpBitmap()->ImplGetSalBitmap(), ImplColorToSal( rMaskColor ) , this); @@ -140,7 +142,7 @@ void OutputDevice::DrawMask( const Point& rDestPt, const Size& rDestSize, // TODO: Use mask here if( mpAlphaVDev ) { - const Bitmap& rMask( rBitmap.CreateMask( rMaskColor ) ); + const Bitmap& rAlphaMask( rMask.CreateMask( rMaskColor ) ); // #i25167# Restrict mask painting to _opaque_ areas // of the mask, otherwise we spoil areas where no @@ -151,16 +153,8 @@ void OutputDevice::DrawMask( const Point& rDestPt, const Size& rDestSize, rDestSize, rSrcPtPixel, rSrcSizePixel, - BitmapEx( rMask, rMask ) ); + BitmapEx( rAlphaMask, rMask ) ); } } -void OutputDevice::ImplPrintMask( const Bitmap& /*rMask*/, const Color& /*rMaskColor*/, - const Point& /*rDestPt*/, const Size& /*rDestSize*/, - const Point& /*rSrcPtPixel*/, const Size& /*rSrcSizePixel*/ ) -{ - // let's leave this for Printer - return; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |