summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2023-01-09 21:59:27 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-01-12 06:52:55 +0000
commitc68606ca09d22caea7c37417d97c076524fecb38 (patch)
tree859cbd182128d28e43ece475aee5d46dac65cc6f /vcl
parent21734247d58a6e915b058d8fa55ece949d049613 (diff)
maAlphaMask in BitmapEx should be AlphaMask
Change-Id: I12dd1881c2896ab2970a0d149048a36d1aee9c9d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145243 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/qa/cppunit/canvasbitmaptest.cxx5
-rw-r--r--vcl/source/bitmap/BitmapEx.cxx17
2 files changed, 6 insertions, 16 deletions
diff --git a/vcl/qa/cppunit/canvasbitmaptest.cxx b/vcl/qa/cppunit/canvasbitmaptest.cxx
index 32481620d2dc..d45cd20dff04 100644
--- a/vcl/qa/cppunit/canvasbitmaptest.cxx
+++ b/vcl/qa/cppunit/canvasbitmaptest.cxx
@@ -758,7 +758,8 @@ void CanvasBitmapTest::runTest()
{
Bitmap aBitmap = aBmp.GetBitmap();
BitmapReadAccess* pBmpAcc = aBitmap.AcquireReadAccess();
- BitmapReadAccess* pAlphaAcc = aBmp.GetAlphaMask().AcquireReadAccess();
+ AlphaMask aBitmapAlpha = aBmp.GetAlphaMask();
+ BitmapReadAccess* pAlphaAcc = aBitmapAlpha.AcquireReadAccess();
CPPUNIT_ASSERT_MESSAGE( "Bitmap has invalid BitmapReadAccess",
pBmpAcc);
@@ -778,7 +779,7 @@ void CanvasBitmapTest::runTest()
CPPUNIT_ASSERT_EQUAL_MESSAGE("(9,2) correct alpha content",
BitmapColor(253), pAlphaAcc->GetPixel(2,9));
- aBmp.GetAlphaMask().ReleaseAccess(pAlphaAcc);
+ aBitmapAlpha.ReleaseAccess(pAlphaAcc);
Bitmap::ReleaseAccess(pBmpAcc);
}
}
diff --git a/vcl/source/bitmap/BitmapEx.cxx b/vcl/source/bitmap/BitmapEx.cxx
index cf50c1976c3a..b8f96acbcfbd 100644
--- a/vcl/source/bitmap/BitmapEx.cxx
+++ b/vcl/source/bitmap/BitmapEx.cxx
@@ -210,11 +210,6 @@ Bitmap BitmapEx::GetBitmap( Color aTransparentReplaceColor ) const
return aRetBmp;
}
-AlphaMask BitmapEx::GetAlphaMask() const
-{
- return AlphaMask(maAlphaMask);
-}
-
sal_Int64 BitmapEx::GetSizeBytes() const
{
sal_Int64 nSizeBytes = maBitmap.GetSizeBytes();
@@ -326,7 +321,7 @@ bool BitmapEx::Rotate( Degree10 nAngle10, const Color& rFillColor )
if( maAlphaMask.IsEmpty() )
{
maAlphaMask = Bitmap(GetSizePixel(), vcl::PixelFormat::N8_BPP, &Bitmap::GetGreyPalette(256));
- maAlphaMask.Erase( COL_BLACK );
+ maAlphaMask.Erase( 0 );
}
if( bRet && !maAlphaMask.IsEmpty() )
@@ -459,15 +454,9 @@ bool BitmapEx::Erase( const Color& rFillColor )
{
// Respect transparency on fill color
if( rFillColor.IsTransparent() )
- {
- const Color aFill( 255 - rFillColor.GetAlpha(), 255 - rFillColor.GetAlpha(), 255 - rFillColor.GetAlpha() );
- maAlphaMask.Erase( aFill );
- }
+ maAlphaMask.Erase( 255 - rFillColor.GetAlpha() );
else
- {
- const Color aBlack( COL_BLACK );
- maAlphaMask.Erase( aBlack );
- }
+ maAlphaMask.Erase( 0 );
}
}