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
This commit is contained in:
@@ -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 );
|
||||
|
@@ -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()
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user