include/vcl/outdev.hxx | 6 +++--- include/vcl/print.hxx | 6 +++--- vcl/source/gdi/print.cxx | 6 +++--- vcl/source/outdev/mask.cxx | 28 +++++++++++----------------- 4 files changed, 20 insertions(+), 26 deletions(-)
New commits: commit bc3625fce46e3e4529b2eb7daabc5c66d7b1cbcc Author: Chris Sherlock <chris.sherloc...@gmail.com> Date: Thu Apr 17 02:56:10 2014 +1000 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 diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index 420fe44..3034fb3 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -848,9 +848,9 @@ public: protected: OutputDevice(); - virtual void ImplPrintMask ( const Bitmap& rMask, const Color& rMaskColor, - const Point& rDestPt, const Size& rDestSize, - const Point& rSrcPtPixel, const Size& rSrcSizePixel ); + virtual void ApplyMask ( const Bitmap& rMask, const Color& rMaskColor, + const Point& rDestPt, const Size& rDestSize, + const Point& rSrcPtPixel, const Size& rSrcSizePixel ); virtual bool UsePolyPolygonForComplexGradient() = 0; diff --git a/include/vcl/print.hxx b/include/vcl/print.hxx index 6309f12..23c656d 100644 --- a/include/vcl/print.hxx +++ b/include/vcl/print.hxx @@ -283,9 +283,9 @@ protected: void SetSelfAsQueuePrinter( bool bQueuePrinter ) { mbIsQueuePrinter = bQueuePrinter; } bool IsQueuePrinter() const { return mbIsQueuePrinter; } - virtual void ImplPrintMask ( const Bitmap& rMask, const Color& rMaskColor, - const Point& rDestPt, const Size& rDestSize, - const Point& rSrcPtPixel, const Size& rSrcSizePixel ) SAL_OVERRIDE; + virtual void ApplyMask ( const Bitmap& rMask, const Color& rMaskColor, + const Point& rDestPt, const Size& rDestSize, + const Point& rSrcPtPixel, const Size& rSrcSizePixel ) SAL_OVERRIDE; bool DrawTransformBitmapExDirect( const basegfx::B2DHomMatrix& aFullTransform, diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx index 7adfcde..d25a28e 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 f8562b2..20f97d3 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: */ _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits