summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2014-04-08 08:12:49 +1000
committerChris Sherlock <chris.sherlock79@gmail.com>2014-04-08 08:15:02 +1000
commit97043e70ef96d1fe8f42eb352a97149f77b73ac6 (patch)
treea431224525d5eb3a9e462af3be8123e9560ceb34
parent702d79a3f8fd3c5e4b433195908317075c87ad9d (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
-rw-r--r--include/vcl/outdev.hxx7
-rw-r--r--vcl/source/gdi/metaact.cxx2
-rw-r--r--vcl/source/gdi/outdev2.cxx85
3 files changed, 24 insertions, 70 deletions
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index 6d60af5a4596..94805c709168 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -730,10 +730,6 @@ public:
SAL_DLLPRIVATE void ImplDrawBitmapEx ( const Point& rDestPt, const Size& rDestSize,
const Point& rSrcPtPixel, const Size& rSrcSizePixel,
const BitmapEx& rBitmapEx, const sal_uLong nAction );
- SAL_DLLPRIVATE void ImplDrawMask ( const Point& rDestPt, const Size& rDestSize,
- const Point& rSrcPtPixel, const Size& rSrcSizePixel,
- const Bitmap& rBitmap, const Color& rMaskColor,
- const sal_uLong nAction );
SAL_DLLPRIVATE void ImplDrawAlpha ( const Bitmap& rBmp, const AlphaMask& rAlpha,
const Point& rDestPt, const Size& rDestSize,
const Point& rSrcPtPixel, const Size& rSrcSizePixel );
@@ -1104,7 +1100,8 @@ public:
const Bitmap& rBitmap, const Color& rMaskColor );
void 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,
+ sal_uLong nAction );
void DrawImage( const Point& rPos,
const Image& rImage, sal_uInt16 nStyle = 0 );
diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx
index e563a37168ac..5f52aad45187 100644
--- a/vcl/source/gdi/metaact.cxx
+++ b/vcl/source/gdi/metaact.cxx
@@ -1917,7 +1917,7 @@ MetaMaskScalePartAction::MetaMaskScalePartAction( const Point& rDstPt, const Siz
void MetaMaskScalePartAction::Execute( OutputDevice* pOut )
{
- pOut->DrawMask( maDstPt, maDstSz, maSrcPt, maSrcSz, maBmp, maColor );
+ pOut->DrawMask( maDstPt, maDstSz, maSrcPt, maSrcSz, maBmp, maColor, META_MASKSCALE_ACTION );
}
MetaAction* MetaMaskScalePartAction::Clone()
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