diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2014-04-08 08:12:49 +1000 |
---|---|---|
committer | Chris Sherlock <chris.sherlock79@gmail.com> | 2014-04-08 08:15:02 +1000 |
commit | 97043e70ef96d1fe8f42eb352a97149f77b73ac6 (patch) | |
tree | a431224525d5eb3a9e462af3be8123e9560ceb34 /vcl/source/gdi/outdev2.cxx | |
parent | 702d79a3f8fd3c5e4b433195908317075c87ad9d (diff) |
Remove unnecessary ImplDrawMask function in OutputDevice
Every DrawMask variant calls on a final DrawMask - we duplicate code
and there is an unnecessary private ImplDrawMask function in
OutputDevice. We should just forward calls to DrawMask.
Change-Id: Ice24598e3a437ca51a047f6006acc5a66198ff22
Diffstat (limited to 'vcl/source/gdi/outdev2.cxx')
-rw-r--r-- | vcl/source/gdi/outdev2.cxx | 85 |
1 files changed, 21 insertions, 64 deletions
diff --git a/vcl/source/gdi/outdev2.cxx b/vcl/source/gdi/outdev2.cxx index dfbba665258e..daf4e2c5ac8b 100644 --- a/vcl/source/gdi/outdev2.cxx +++ b/vcl/source/gdi/outdev2.cxx @@ -1146,84 +1146,24 @@ void OutputDevice::DrawDeviceBitmap( const Point& rDestPt, const Size& rDestSize void OutputDevice::DrawMask( const Point& rDestPt, const Bitmap& rBitmap, const Color& rMaskColor ) { - if( ImplIsRecordLayout() ) - return; - const Size aSizePix( rBitmap.GetSizePixel() ); - ImplDrawMask( rDestPt, PixelToLogic( aSizePix ), Point(), aSizePix, rBitmap, rMaskColor, META_MASK_ACTION ); - - if( mpAlphaVDev ) - { - const Bitmap& rMask( rBitmap.CreateMask( rMaskColor ) ); - - // #i25167# Restrict mask painting to _opaque_ areas - // of the mask, otherwise we spoil areas where no - // bitmap content was ever visible. Interestingly - // enough, this can be achieved by taking the mask as - // the transparency mask of itself - mpAlphaVDev->DrawBitmapEx( rDestPt, - PixelToLogic( aSizePix ), - BitmapEx( rMask, rMask ) ); - } + DrawMask( rDestPt, PixelToLogic( aSizePix ), Point(), aSizePix, rBitmap, rMaskColor, META_MASK_ACTION ); } void OutputDevice::DrawMask( const Point& rDestPt, const Size& rDestSize, const Bitmap& rBitmap, const Color& rMaskColor ) { - if( ImplIsRecordLayout() ) - return; - - ImplDrawMask( rDestPt, rDestSize, Point(), rBitmap.GetSizePixel(), rBitmap, rMaskColor, META_MASKSCALE_ACTION ); - - // TODO: Use mask here - if( mpAlphaVDev ) - { - const Bitmap& rMask( rBitmap.CreateMask( rMaskColor ) ); - - // #i25167# Restrict mask painting to _opaque_ areas - // of the mask, otherwise we spoil areas where no - // bitmap content was ever visible. Interestingly - // enough, this can be achieved by taking the mask as - // the transparency mask of itself - mpAlphaVDev->DrawBitmapEx( rDestPt, - rDestSize, - BitmapEx( rMask, rMask ) ); - } + DrawMask( rDestPt, rDestSize, Point(), rBitmap.GetSizePixel(), rBitmap, rMaskColor, META_MASKSCALE_ACTION ); } void OutputDevice::DrawMask( const Point& rDestPt, const Size& rDestSize, const Point& rSrcPtPixel, const Size& rSrcSizePixel, - const Bitmap& rBitmap, const Color& rMaskColor ) + const Bitmap& rBitmap, const Color& rMaskColor, + const sal_uLong nAction ) { if( ImplIsRecordLayout() ) return; - ImplDrawMask( rDestPt, rDestSize, rSrcPtPixel, rSrcSizePixel, rBitmap, rMaskColor, META_MASKSCALEPART_ACTION ); - - // TODO: Use mask here - if( mpAlphaVDev ) - { - const Bitmap& rMask( rBitmap.CreateMask( rMaskColor ) ); - - // #i25167# Restrict mask painting to _opaque_ areas - // of the mask, otherwise we spoil areas where no - // bitmap content was ever visible. Interestingly - // enough, this can be achieved by taking the mask as - // the transparency mask of itself - mpAlphaVDev->DrawBitmapEx( rDestPt, - rDestSize, - rSrcPtPixel, - rSrcSizePixel, - BitmapEx( rMask, rMask ) ); - } -} - -void OutputDevice::ImplDrawMask( const Point& rDestPt, const Size& rDestSize, - const Point& rSrcPtPixel, const Size& rSrcSizePixel, - const Bitmap& rBitmap, const Color& rMaskColor, - const sal_uLong nAction ) -{ - if( ROP_INVERT == meRasterOp ) { DrawRect( Rectangle( rDestPt, rDestSize ) ); @@ -1293,6 +1233,23 @@ void OutputDevice::ImplDrawMask( const Point& rDestPt, const Size& rDestSize, } } + + // TODO: Use mask here + if( mpAlphaVDev ) + { + const Bitmap& rMask( rBitmap.CreateMask( rMaskColor ) ); + + // #i25167# Restrict mask painting to _opaque_ areas + // of the mask, otherwise we spoil areas where no + // bitmap content was ever visible. Interestingly + // enough, this can be achieved by taking the mask as + // the transparency mask of itself + mpAlphaVDev->DrawBitmapEx( rDestPt, + rDestSize, + rSrcPtPixel, + rSrcSizePixel, + BitmapEx( rMask, rMask ) ); + } } namespace |