summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-10-18 09:53:15 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-10-18 13:38:36 +0200
commit25f4ef5aa5488869b3bad045ba203c6b22b2e2f0 (patch)
tree78a15cc5a92192c10392039f10734a0b189d13d2
parentec2e02cfa41510c3d30b118cbf7595c84a046d03 (diff)
tdf#157792 followup
avoid doing some extra Invert() operations by creating an AlphaMask instead of a Bitmap to pass to the BitmapEx constructor. Change-Id: I1af3a5e65010b346fa0d0c56836d567e51c9b58b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158106 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--cppcanvas/source/mtfrenderer/implrenderer.cxx2
-rw-r--r--drawinglayer/source/tools/wmfemfhelper.cxx2
-rw-r--r--filter/source/msfilter/mstoolbar.cxx2
-rw-r--r--svx/source/dialog/_bmpmask.cxx4
-rw-r--r--svx/source/dialog/_contdlg.cxx4
-rw-r--r--vcl/source/graphic/GraphicObject2.cxx2
6 files changed, 8 insertions, 8 deletions
diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx
index 6bd99840f0a8..d3cfe793f45f 100644
--- a/cppcanvas/source/mtfrenderer/implrenderer.cxx
+++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx
@@ -208,7 +208,7 @@ namespace
aWhite, rMaskColor
};
- Bitmap aMask( rBitmap.CreateMask( aWhite ));
+ AlphaMask aMask( rBitmap.CreateAlphaMask( aWhite ));
Bitmap aSolid( rBitmap.GetSizePixel(),
vcl::PixelFormat::N8_BPP,
&aBiLevelPalette );
diff --git a/drawinglayer/source/tools/wmfemfhelper.cxx b/drawinglayer/source/tools/wmfemfhelper.cxx
index aa48149219f3..31bad2a0abd4 100644
--- a/drawinglayer/source/tools/wmfemfhelper.cxx
+++ b/drawinglayer/source/tools/wmfemfhelper.cxx
@@ -642,7 +642,7 @@ namespace wmfemfhelper
aWhite, rMaskColor
};
- Bitmap aMask(rBitmap.CreateMask(aWhite));
+ AlphaMask aMask(rBitmap.CreateAlphaMask(aWhite));
Bitmap aSolid(rBitmap.GetSizePixel(), vcl::PixelFormat::N8_BPP, &aBiLevelPalette);
aSolid.Erase(rMaskColor);
diff --git a/filter/source/msfilter/mstoolbar.cxx b/filter/source/msfilter/mstoolbar.cxx
index aa781c4717c8..fa78dce52443 100644
--- a/filter/source/msfilter/mstoolbar.cxx
+++ b/filter/source/msfilter/mstoolbar.cxx
@@ -303,7 +303,7 @@ void TBCData::ImportToolBarControl( CustomToolBarImportHelper& helper, std::vect
// according to the spec:
// "the iconMask is white in all the areas in which the icon is
// displayed as transparent and is black in all other areas."
- aBitEx = BitmapEx(aBitEx.GetBitmap(), rMaskBase.CreateMask(COL_WHITE));
+ aBitEx = BitmapEx(aBitEx.GetBitmap(), rMaskBase.CreateAlphaMask(COL_WHITE));
}
}
diff --git a/svx/source/dialog/_bmpmask.cxx b/svx/source/dialog/_bmpmask.cxx
index ba11eeacd1da..1db7e661cdd7 100644
--- a/svx/source/dialog/_bmpmask.cxx
+++ b/svx/source/dialog/_bmpmask.cxx
@@ -612,10 +612,10 @@ BitmapEx SvxBmpMask::ImpMaskTransparent( const BitmapEx& rBitmapEx, const Color&
EnterWait();
BitmapEx aBmpEx;
- Bitmap aMask( rBitmapEx.GetBitmap().CreateMask( rColor, nTol ) );
+ AlphaMask aMask( rBitmapEx.GetBitmap().CreateAlphaMask( rColor, nTol ) );
if( rBitmapEx.IsAlpha() )
- aMask.CombineOr( rBitmapEx.GetAlphaMask() );
+ aMask.AlphaCombineOr( rBitmapEx.GetAlphaMask() );
aBmpEx = BitmapEx( rBitmapEx.GetBitmap(), aMask );
LeaveWait();
diff --git a/svx/source/dialog/_contdlg.cxx b/svx/source/dialog/_contdlg.cxx
index ec122e3b1373..725ce095c9ed 100644
--- a/svx/source/dialog/_contdlg.cxx
+++ b/svx/source/dialog/_contdlg.cxx
@@ -631,10 +631,10 @@ IMPL_LINK( SvxSuperContourDlg, PipetteClickHdl, ContourWindow&, rWnd, void )
{
const tools::Long nTol = static_cast<tools::Long>(m_xMtfTolerance->get_value(FieldUnit::PERCENT) * 255 / 100);
- Bitmap aMask = aGraphic.GetBitmapEx().GetBitmap().CreateMask( rColor, nTol );
+ AlphaMask aMask = aGraphic.GetBitmapEx().GetBitmap().CreateAlphaMask( rColor, nTol );
if( aGraphic.IsTransparent() )
- aMask.CombineOr( aGraphic.GetBitmapEx().GetAlphaMask() );
+ aMask.AlphaCombineOr( aGraphic.GetBitmapEx().GetAlphaMask() );
if( !aMask.IsEmpty() )
{
diff --git a/vcl/source/graphic/GraphicObject2.cxx b/vcl/source/graphic/GraphicObject2.cxx
index a654baeba6bf..02a9374759bf 100644
--- a/vcl/source/graphic/GraphicObject2.cxx
+++ b/vcl/source/graphic/GraphicObject2.cxx
@@ -321,7 +321,7 @@ bool GraphicObject::ImplDrawTiled(OutputDevice& rOut, const tools::Rectangle& rA
AlphaMask( aVDev->GetBitmap( Point(0,0), aVDev->GetOutputSize() ) ) );
else
aTileBitmap = BitmapEx( aTileBitmap.GetBitmap(),
- aVDev->GetBitmap( Point(0,0), aVDev->GetOutputSize() ).CreateMask( COL_WHITE ) );
+ aVDev->GetBitmap( Point(0,0), aVDev->GetOutputSize() ).CreateAlphaMask( COL_WHITE ) );
}
}