simplify some BitmapEx constructions

using the color bitmap __and__ the alpha from another BitmapEx
is equivalent to just doing a straight copy/assign

Change-Id: I134ab8a1197ed538823afc4a8cd28b3d5986c6b3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160019
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin 2023-11-28 12:43:25 +02:00
parent 1ca6f51567
commit f4edd6258d
4 changed files with 4 additions and 8 deletions

View File

@ -994,10 +994,7 @@ Graphic SvxBmpMask::Mask( const Graphic& rGraphic )
if ( aBitmapEx.GetSizePixel().Width() && aBitmapEx.GetSizePixel().Height() )
{
ImpMask( aBitmapEx );
if ( aGraphic.IsTransparent() )
aGraphic = Graphic( BitmapEx( aBitmapEx.GetBitmap(), aBitmapEx.GetAlphaMask() ) );
else
aGraphic = aBitmapEx;
aGraphic = Graphic( aBitmapEx );
}
}
}

View File

@ -457,7 +457,7 @@ void GraphicObject::ImplTransformBitmap( BitmapEx& rBmpEx,
if( rBmpEx.IsAlpha() )
{
aBmpEx2 = BitmapEx( rBmpEx.GetBitmap(), rBmpEx.GetAlphaMask() );
aBmpEx2 = rBmpEx;
}
else
{

View File

@ -269,7 +269,7 @@ BitmapEx GetBitmapEx(BitmapEx const& rBitmapEx, DrawModeFlags nDrawMode)
}
else
{
aBmpEx = BitmapEx(aColorBmp, aBmpEx.GetAlphaMask());
aBmpEx = BitmapEx(aColorBmp);
}
}

View File

@ -1406,8 +1406,7 @@ public:
rDev.DrawBitmap(aBelow, aGrey);
aBelow.Move(aGrey.GetSizePixel().Width(),0);
BitmapEx aGreyMask(aSrc.GetBitmap(),
aSrc.GetAlphaMask());
BitmapEx aGreyMask(aSrc);
rDev.DrawBitmapEx(aBelow, aGreyMask);
aLocation.Move(aSrc.GetSizePixel().Width()*6,0);