Skip to content

Commit

Permalink
simplify some BitmapEx constructions
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Noel Grandin committed Nov 28, 2023
1 parent 1ca6f51 commit f4edd62
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
5 changes: 1 addition & 4 deletions svx/source/dialog/_bmpmask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion vcl/source/graphic/GraphicObject2.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ void GraphicObject::ImplTransformBitmap( BitmapEx& rBmpEx,

if( rBmpEx.IsAlpha() )
{
aBmpEx2 = BitmapEx( rBmpEx.GetBitmap(), rBmpEx.GetAlphaMask() );
aBmpEx2 = rBmpEx;
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion vcl/source/rendercontext/drawmode.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ BitmapEx GetBitmapEx(BitmapEx const& rBitmapEx, DrawModeFlags nDrawMode)
}
else
{
aBmpEx = BitmapEx(aColorBmp, aBmpEx.GetAlphaMask());
aBmpEx = BitmapEx(aColorBmp);
}
}

Expand Down
3 changes: 1 addition & 2 deletions vcl/workben/vcldemo.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1406,8 +1406,7 @@ class DemoRenderer
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);
Expand Down

0 comments on commit f4edd62

Please sign in to comment.