include/vcl/bitmap/BitmapFilter.hxx | 13 ++++++------- include/vcl/bitmap/BitmapShadowFilter.hxx | 1 + vcl/backendtest/GraphicsRenderTests.cxx | 16 ++++++++-------- vcl/backendtest/VisualBackendTest.cxx | 4 ++-- vcl/backendtest/outputdevice/bitmap.cxx | 4 ++-- vcl/backendtest/outputdevice/common.cxx | 4 ++-- vcl/inc/test/outputdevice.hxx | 4 ++-- vcl/qa/cppunit/BackendTest.cxx | 23 ++++++----------------- vcl/qa/cppunit/BitmapFilterTest.cxx | 23 +++++++++++------------ vcl/qa/cppunit/BitmapProcessorTest.cxx | 7 +++---- vcl/qa/cppunit/BitmapTest.cxx | 4 +--- vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx | 8 ++++---- vcl/source/bitmap/BitmapEx.cxx | 16 ++++++++-------- vcl/source/bitmap/bitmapfilter.cxx | 9 --------- 14 files changed, 56 insertions(+), 80 deletions(-)
New commits: commit 744d6e93b85b713922c2b48bb47177b362325909 Author: Noel Grandin <[email protected]> AuthorDate: Thu Sep 4 21:36:31 2025 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Fri Sep 5 09:16:36 2025 +0200 BitmapEx->Bitmap in OutputDeviceTestCommon Change-Id: Id0ba95660869e809f59fc5d74e97d181f759f377 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190605 Reviewed-by: Noel Grandin <[email protected]> Tested-by: Jenkins diff --git a/vcl/backendtest/GraphicsRenderTests.cxx b/vcl/backendtest/GraphicsRenderTests.cxx index 80b8998991e7..2e367cdfcbc8 100644 --- a/vcl/backendtest/GraphicsRenderTests.cxx +++ b/vcl/backendtest/GraphicsRenderTests.cxx @@ -832,17 +832,17 @@ void GraphicsRenderTests::testDrawBlend24bpp() OUString aTestName = u"testDrawBlend24bpp"_ustr; GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestBitmap aOutDevTest; - BitmapEx aBitmapEx = aOutDevTest.setupDrawBlend(vcl::PixelFormat::N24_BPP); + Bitmap aBitmap = aOutDevTest.setupDrawBlend(vcl::PixelFormat::N24_BPP); if (!SHOULD_ASSERT) { appendTestResult(aTestName, u"SKIPPED"_ustr); return; } - vcl::test::TestResult eResult = vcl::test::OutputDeviceTestBitmap::checkBlend(aBitmapEx); + vcl::test::TestResult eResult = vcl::test::OutputDeviceTestBitmap::checkBlend(aBitmap); appendTestResult(aTestName, returnTestStatus(eResult), - (m_aStoreResultantBitmap ? aBitmapEx.GetBitmap() : Bitmap())); + (m_aStoreResultantBitmap ? aBitmap.CreateColorBitmap() : Bitmap())); if (m_aStoreResultantBitmap) - exportBitmapToImage(m_aUserInstallPath + aTestName + ".png", Bitmap(aBitmapEx)); + exportBitmapToImage(m_aUserInstallPath + aTestName + ".png", aBitmap); } void GraphicsRenderTests::testDrawXor() @@ -1621,18 +1621,18 @@ void GraphicsRenderTests::testDrawBlend32bpp() OUString aTestName = u"testDrawBlend32bpp"_ustr; GraphicsTestZone zone(aTestName); vcl::test::OutputDeviceTestBitmap aOutDevTest; - BitmapEx aBitmapEx = aOutDevTest.setupDrawBlend(vcl::PixelFormat::N32_BPP); + Bitmap aBitmap = aOutDevTest.setupDrawBlend(vcl::PixelFormat::N32_BPP); if (!SHOULD_ASSERT) { appendTestResult(aTestName, u"SKIPPED"_ustr); return; } - vcl::test::TestResult eResult = vcl::test::OutputDeviceTestBitmap::checkBlend(aBitmapEx); + vcl::test::TestResult eResult = vcl::test::OutputDeviceTestBitmap::checkBlend(aBitmap); appendTestResult(aTestName, returnTestStatus(eResult), - (m_aStoreResultantBitmap ? aBitmapEx.GetBitmap() : Bitmap())); + (m_aStoreResultantBitmap ? aBitmap.CreateColorBitmap() : Bitmap())); if (m_aStoreResultantBitmap) { - exportBitmapToImage(m_aUserInstallPath + aTestName + ".png", Bitmap(aBitmapEx)); + exportBitmapToImage(m_aUserInstallPath + aTestName + ".png", aBitmap); } } diff --git a/vcl/backendtest/VisualBackendTest.cxx b/vcl/backendtest/VisualBackendTest.cxx index 55fdd16712cc..2dbf3223fd79 100644 --- a/vcl/backendtest/VisualBackendTest.cxx +++ b/vcl/backendtest/VisualBackendTest.cxx @@ -510,9 +510,9 @@ public: aRectangle = aRegions[index++]; { vcl::test::OutputDeviceTestBitmap aOutDevTest; - BitmapEx aBitmap = aOutDevTest.setupDrawBlend(vcl::PixelFormat::N24_BPP); + Bitmap aBitmap = aOutDevTest.setupDrawBlend(vcl::PixelFormat::N24_BPP); assertAndSetBackground(vcl::test::OutputDeviceTestBitmap::checkBlend(aBitmap), aRectangle, rRenderContext); - drawBitmapScaledAndCentered(aRectangle, aBitmap.GetBitmap(), rRenderContext); + drawBitmapScaledAndCentered(aRectangle, aBitmap.CreateColorBitmap(), rRenderContext); } } diff --git a/vcl/backendtest/outputdevice/bitmap.cxx b/vcl/backendtest/outputdevice/bitmap.cxx index 4ee9cc528dac..2c2562cf7266 100644 --- a/vcl/backendtest/outputdevice/bitmap.cxx +++ b/vcl/backendtest/outputdevice/bitmap.cxx @@ -139,7 +139,7 @@ Bitmap OutputDeviceTestBitmap::setupDrawMask(vcl::PixelFormat aBitmapFormat) return mpVirtualDevice->GetBitmap(maVDRectangle.TopLeft(), maVDRectangle.GetSize()); } -BitmapEx OutputDeviceTestBitmap::setupDrawBlend(vcl::PixelFormat aBitmapFormat) +Bitmap OutputDeviceTestBitmap::setupDrawBlend(vcl::PixelFormat aBitmapFormat) { Size aBitmapSize(9, 9); Bitmap aBitmap(aBitmapSize, aBitmapFormat); @@ -172,7 +172,7 @@ BitmapEx OutputDeviceTestBitmap::setupDrawBlend(vcl::PixelFormat aBitmapFormat) mpVirtualDevice->DrawBitmapEx(aPoint, Bitmap(aBitmap, aAlpha)); - return BitmapEx(mpVirtualDevice->GetBitmap(maVDRectangle.TopLeft(), maVDRectangle.GetSize())); + return mpVirtualDevice->GetBitmap(maVDRectangle.TopLeft(), maVDRectangle.GetSize()); } } // end namespace vcl::test diff --git a/vcl/backendtest/outputdevice/common.cxx b/vcl/backendtest/outputdevice/common.cxx index 8b9d4b865ef7..c2a477de5f62 100644 --- a/vcl/backendtest/outputdevice/common.cxx +++ b/vcl/backendtest/outputdevice/common.cxx @@ -1650,7 +1650,7 @@ TestResult OutputDeviceTestBitmap::checkMask(Bitmap& rBitmap) return checkRectangle(rBitmap); } -TestResult OutputDeviceTestBitmap::checkBlend(const BitmapEx& rBitmapEx) +TestResult OutputDeviceTestBitmap::checkBlend(const Bitmap& rBitmap) { const Color aBlendedColor(0xEE, 0xEE, 0x33); @@ -1659,7 +1659,7 @@ TestResult OutputDeviceTestBitmap::checkBlend(const BitmapEx& rBitmapEx) COL_BLACK, COL_BLACK, COL_YELLOW, constBackgroundColor, constBackgroundColor, aBlendedColor, constBackgroundColor }; - Bitmap aBitmap(rBitmapEx.GetBitmap()); + Bitmap aBitmap(rBitmap.CreateColorBitmap()); return checkRectangles(aBitmap, aExpected); } diff --git a/vcl/inc/test/outputdevice.hxx b/vcl/inc/test/outputdevice.hxx index 15da4b10c778..ece5306fb8d8 100644 --- a/vcl/inc/test/outputdevice.hxx +++ b/vcl/inc/test/outputdevice.hxx @@ -116,13 +116,13 @@ public: Bitmap setupDrawBitmap(vcl::PixelFormat aBitmapFormat, bool isBitmapGreyScale = false); Bitmap setupDrawBitmapExWithAlpha(vcl::PixelFormat aBitmapFormat); Bitmap setupDrawMask(vcl::PixelFormat aBitmapFormat); - BitmapEx setupDrawBlend(vcl::PixelFormat aBitmapFormat); + Bitmap setupDrawBlend(vcl::PixelFormat aBitmapFormat); static TestResult checkTransformedBitmap(Bitmap& rBitmap); static TestResult checkComplexTransformedBitmap(Bitmap& rBitmap); static TestResult checkBitmapExWithAlpha(Bitmap& rBitmap); static TestResult checkMask(Bitmap& rBitmap); - static TestResult checkBlend(const BitmapEx& rBitmap); + static TestResult checkBlend(const Bitmap& rBitmap); static TestResult checkTransformedBitmap8bppGreyScale(Bitmap& rBitmap); }; diff --git a/vcl/qa/cppunit/BackendTest.cxx b/vcl/qa/cppunit/BackendTest.cxx index 212baaf49cdf..e31a15077c65 100644 --- a/vcl/qa/cppunit/BackendTest.cxx +++ b/vcl/qa/cppunit/BackendTest.cxx @@ -29,17 +29,6 @@ class BackendTest : public test::BootstrapFixture // "xdg-open ./workdir/CppunitTest/vcl_backend_test.test.core/" static constexpr const bool mbExportBitmap = false; - void exportImage(OUString const& rsFilename, BitmapEx const& rBitmapEx) - { - if (mbExportBitmap) - { - Bitmap aBitmap(rBitmapEx); - aBitmap.Scale(Size(128, 128), BmpScaleFlag::Fast); - SvFileStream aStream(rsFilename, StreamMode::WRITE | StreamMode::TRUNC); - GraphicFilter::GetGraphicFilter().compressAsPNG(aBitmap, aStream); - } - } - void exportImage(OUString const& rsFilename, Bitmap const& rBitmap) { if (mbExportBitmap) @@ -526,9 +515,9 @@ public: if (getDefaultDeviceBitCount() < 24) return; vcl::test::OutputDeviceTestBitmap aOutDevTest; - BitmapEx aBitmapEx = aOutDevTest.setupDrawBlend(vcl::PixelFormat::N24_BPP); - auto eResult = vcl::test::OutputDeviceTestBitmap::checkBlend(aBitmapEx); - exportImage(u"08-06_blend_test_24bpp.png"_ustr, aBitmapEx); + Bitmap aBitmap = aOutDevTest.setupDrawBlend(vcl::PixelFormat::N24_BPP); + auto eResult = vcl::test::OutputDeviceTestBitmap::checkBlend(aBitmap); + exportImage(u"08-06_blend_test_24bpp.png"_ustr, aBitmap); if (SHOULD_ASSERT) CPPUNIT_ASSERT(eResult != vcl::test::TestResult::Failed); } @@ -586,9 +575,9 @@ public: if (getDefaultDeviceBitCount() < 24) return; vcl::test::OutputDeviceTestBitmap aOutDevTest; - BitmapEx aBitmapEx = aOutDevTest.setupDrawBlend(vcl::PixelFormat::N32_BPP); - auto eResult = vcl::test::OutputDeviceTestBitmap::checkBlend(aBitmapEx); - exportImage(u"09-05_blend_test_32bpp.png"_ustr, aBitmapEx); + Bitmap aBitmap = aOutDevTest.setupDrawBlend(vcl::PixelFormat::N32_BPP); + auto eResult = vcl::test::OutputDeviceTestBitmap::checkBlend(aBitmap); + exportImage(u"09-05_blend_test_32bpp.png"_ustr, aBitmap); if (SHOULD_ASSERT) CPPUNIT_ASSERT(eResult != vcl::test::TestResult::Failed); } diff --git a/vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx b/vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx index 299c93d88e68..39080667c3e9 100644 --- a/vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx +++ b/vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx @@ -191,8 +191,8 @@ void BitmapRenderTest::testAlphaVirtualDevice() CPPUNIT_ASSERT_EQUAL(Color(ColorAlpha, 0x00, 0x00, 0x00, 0x00), pAlphaVirtualDevice->GetPixel(Point(1, 1))); - // Get a BitmapEx from the VirDev -> Colors should have alpha - BitmapEx aBitmap(pAlphaVirtualDevice->GetBitmap(Point(), Size(4, 4))); + // Get a Bitmap from the VirDev -> Colors should have alpha + Bitmap aBitmap(pAlphaVirtualDevice->GetBitmap(Point(), Size(4, 4))); CPPUNIT_ASSERT_EQUAL(tools::Long(4), aBitmap.GetSizePixel().Width()); CPPUNIT_ASSERT_EQUAL(tools::Long(4), aBitmap.GetSizePixel().Height()); Color aColor = aBitmap.GetPixelColor(1, 1); @@ -210,7 +210,7 @@ void BitmapRenderTest::testAlphaVirtualDevice() CPPUNIT_ASSERT_EQUAL(Color(0x0022ff55), aColor); #endif - // Read back the BitmapEx and check the opaque pixel + // Read back the Bitmap and check the opaque pixel aBitmap = pAlphaVirtualDevice->GetBitmap(Point(), Size(4, 4)); CPPUNIT_ASSERT_EQUAL(tools::Long(4), aBitmap.GetSizePixel().Width()); CPPUNIT_ASSERT_EQUAL(tools::Long(4), aBitmap.GetSizePixel().Height()); @@ -233,7 +233,7 @@ void BitmapRenderTest::testAlphaVirtualDevice() CPPUNIT_ASSERT_EQUAL(Color(ColorTransparency, 0x4422FF55), aColor); #endif - // Read back the BitmapEx and check the semi-transparent pixel + // Read back the Bitmap and check the semi-transparent pixel aBitmap = pAlphaVirtualDevice->GetBitmap(Point(), Size(4, 4)); CPPUNIT_ASSERT_EQUAL(tools::Long(4), aBitmap.GetSizePixel().Width()); CPPUNIT_ASSERT_EQUAL(tools::Long(4), aBitmap.GetSizePixel().Height()); commit c8d666c1ef9daf593282d4ad1c289e4bbbf5a788 Author: Noel Grandin <[email protected]> AuthorDate: Thu Sep 4 21:10:06 2025 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Fri Sep 5 09:16:28 2025 +0200 drop BitmapEx method in BitmapFilter since we can use Bitmap now Change-Id: I8711511e1194792de088a0093680b8e577be6a8a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190603 Reviewed-by: Noel Grandin <[email protected]> Tested-by: Jenkins diff --git a/include/vcl/bitmap/BitmapFilter.hxx b/include/vcl/bitmap/BitmapFilter.hxx index d8a41bd97342..4271a23ba0e4 100644 --- a/include/vcl/bitmap/BitmapFilter.hxx +++ b/include/vcl/bitmap/BitmapFilter.hxx @@ -10,7 +10,7 @@ #pragma once -#include <vcl/bitmapex.hxx> +#include <vcl/bitmap.hxx> #include <functional> class Animation; @@ -50,8 +50,8 @@ void generateStripRanges( your new filter from this and implement the filtering functionality in the execute() function. - The execute function takes the bitmapex that you want to apply the filter to, and - returns a brand new, filtered, BitmapEx instance. + The execute function takes the Bitmap that you want to apply the filter to, and + returns a brand new, filtered, Bitmap instance. The actual filters parameterisation is expected to be done in the constructor. So, to take a simple example, if you want to make every fourth pixel a different color you @@ -59,9 +59,9 @@ void generateStripRanges( member variable that the Bitmap4thColorReplaceFilter would then use in its execute() statement. - The BitmapFilter class has a static convenience Filter function that takes a BitmapEx - and the desired filter, which filters the BitmapEx parameter, then overwrite this BitmapEx - instance. If the filter fails (BitmapEx is empty) then it returns false. + The BitmapFilter class has a static convenience Filter function that takes a Bitmap + and the desired filter, which filters the Bitmap parameter, then overwrite this Bitmap + instance. If the filter fails (Bitmap is empty) then it returns false. */ class VCL_DLLPUBLIC BitmapFilter @@ -72,7 +72,6 @@ public: virtual Bitmap execute(Bitmap const& rBitmap) const = 0; - static bool Filter(BitmapEx& rBmpEx, BitmapFilter const& rFilter); static bool Filter(Bitmap& rBmp, BitmapFilter const& rFilter); static bool Filter(Animation& rBmpEx, BitmapFilter const& rFilter); }; diff --git a/include/vcl/bitmap/BitmapShadowFilter.hxx b/include/vcl/bitmap/BitmapShadowFilter.hxx index be96a5d5bd99..ca5875be5af1 100644 --- a/include/vcl/bitmap/BitmapShadowFilter.hxx +++ b/include/vcl/bitmap/BitmapShadowFilter.hxx @@ -11,6 +11,7 @@ #pragma once #include <vcl/bitmap/BitmapFilter.hxx> +#include <tools/color.hxx> /** If the alpha is beyond a certain threshold, make it fully transparent */ diff --git a/vcl/qa/cppunit/BitmapFilterTest.cxx b/vcl/qa/cppunit/BitmapFilterTest.cxx index db07129f36cc..5fe0278c95b8 100644 --- a/vcl/qa/cppunit/BitmapFilterTest.cxx +++ b/vcl/qa/cppunit/BitmapFilterTest.cxx @@ -104,9 +104,8 @@ void BitmapFilterTest::testClampAlpha() aWriteAccess->Erase(COL_RED); } - BitmapEx aBitmapEx24Bit(aBitmap24Bit); - BitmapFilter::Filter(aBitmapEx24Bit, BitmapAlphaClampFilter(0x7F)); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt8>(0xFF), aBitmapEx24Bit.GetAlpha(0, 0)); + BitmapFilter::Filter(aBitmap24Bit, BitmapAlphaClampFilter(0x7F)); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt8>(0xFF), aBitmap24Bit.GetPixelColor(0, 0).GetAlpha()); } void BitmapFilterTest::testBlurCorrectness() @@ -636,24 +635,24 @@ void BitmapFilterTest::testArithmeticBlendFilter() } { - BitmapEx aResBitmapEx(aRedBitmap); - BitmapFilter::Filter(aResBitmapEx, BitmapArithmeticBlendFilter(aRedBitmap, 0, 0, 0, 0.5)); + Bitmap aResBitmap(aRedBitmap); + BitmapFilter::Filter(aResBitmap, BitmapArithmeticBlendFilter(aRedBitmap, 0, 0, 0, 0.5)); CPPUNIT_ASSERT_EQUAL(Color(ColorAlpha, 0x7F, 0xFF, 0xFF, 0xFF), - aResBitmapEx.GetPixelColor(0, 0)); + aResBitmap.GetPixelColor(0, 0)); } // Different colors { - BitmapEx aResBitmapEx(aRedBitmap); - BitmapFilter::Filter(aResBitmapEx, BitmapArithmeticBlendFilter(aGreenBitmap, 0, 0, 0, 0)); + Bitmap aResBitmap(aRedBitmap); + BitmapFilter::Filter(aResBitmap, BitmapArithmeticBlendFilter(aGreenBitmap, 0, 0, 0, 0)); CPPUNIT_ASSERT_EQUAL(Color(ColorAlpha, 0x00, 0x00, 0x00, 0x00), - aResBitmapEx.GetPixelColor(0, 0)); + aResBitmap.GetPixelColor(0, 0)); } { - BitmapEx aResBitmapEx(aRedBitmap); - BitmapFilter::Filter(aResBitmapEx, BitmapArithmeticBlendFilter(aGreenBitmap, 1, 0, 0, 0)); - CPPUNIT_ASSERT_EQUAL(COL_BLACK, aResBitmapEx.GetPixelColor(0, 0)); + Bitmap aResBitmap(aRedBitmap); + BitmapFilter::Filter(aResBitmap, BitmapArithmeticBlendFilter(aGreenBitmap, 1, 0, 0, 0)); + CPPUNIT_ASSERT_EQUAL(COL_BLACK, aResBitmap.GetPixelColor(0, 0)); } { diff --git a/vcl/qa/cppunit/BitmapProcessorTest.cxx b/vcl/qa/cppunit/BitmapProcessorTest.cxx index efc3f8aa71b5..213f1e2b2d31 100644 --- a/vcl/qa/cppunit/BitmapProcessorTest.cxx +++ b/vcl/qa/cppunit/BitmapProcessorTest.cxx @@ -38,8 +38,7 @@ void BitmapProcessorTest::testDisabledImage() pWriteAccess->Erase(Color(ColorTransparency, 0x00, 0x00, 0xFF, 0x00)); } BitmapDisabledImageFilter aDisabledImageFilter; - BitmapEx aDisabledBitmapEx(aDisabledImageFilter.execute(aBitmap)); - Bitmap aDisabledBitmap(aDisabledBitmapEx.GetBitmap()); + Bitmap aDisabledBitmap(aDisabledImageFilter.execute(aBitmap)); { BitmapScopedReadAccess pReadAccess(aDisabledBitmap); Color aColor(pReadAccess->GetPixel(0, 0)); @@ -59,9 +58,9 @@ void BitmapProcessorTest::testDisabledImage() pWriteAccess->Erase(Color(ColorTransparency, 0x00, 0xAA, 0xAA, 0xAA)); } - BitmapEx aBitmapEx(aBitmap, aMask); + Bitmap aBitmap2(aBitmap, aMask); BitmapDisabledImageFilter aDisabledImageFilter; - Bitmap aDisabledBitmap(aDisabledImageFilter.execute(Bitmap(aBitmapEx))); + Bitmap aDisabledBitmap(aDisabledImageFilter.execute(aBitmap2)); { BitmapScopedReadAccess pReadAccess(aDisabledBitmap); Color aColor(pReadAccess->GetPixel(0, 0)); diff --git a/vcl/qa/cppunit/BitmapTest.cxx b/vcl/qa/cppunit/BitmapTest.cxx index f280ed05f3ba..0610c5cfd2b2 100644 --- a/vcl/qa/cppunit/BitmapTest.cxx +++ b/vcl/qa/cppunit/BitmapTest.cxx @@ -175,9 +175,7 @@ void BitmapTest::testMonochrome() { Bitmap aBmp = createTestBitmap(); - BitmapEx aBmpEx(aBmp); - BitmapFilter::Filter(aBmpEx, BitmapMonochromeFilter(63)); - aBmp = aBmpEx.GetBitmap(); + BitmapFilter::Filter(aBmp, BitmapMonochromeFilter(63)); BitmapReadAccess aBmpReadAccess(aBmp); CPPUNIT_ASSERT_EQUAL_MESSAGE("Black pixel wrong monochrome value", BitmapColor(COL_BLACK), diff --git a/vcl/source/bitmap/BitmapEx.cxx b/vcl/source/bitmap/BitmapEx.cxx index 49ee91688046..61f7db99a63b 100644 --- a/vcl/source/bitmap/BitmapEx.cxx +++ b/vcl/source/bitmap/BitmapEx.cxx @@ -109,19 +109,19 @@ BitmapEx::BitmapEx( const Bitmap& rBmp, const Bitmap& rMask ) : } else if( rMask.getPixelFormat() == vcl::PixelFormat::N8_BPP ) { - BitmapEx aMaskEx(rMask); - BitmapFilter::Filter(aMaskEx, BitmapMonochromeFilter(255)); - aMaskEx.Invert(); - maAlphaMask = aMaskEx.GetBitmap(); + Bitmap aMask(rMask); + BitmapFilter::Filter(aMask, BitmapMonochromeFilter(255)); + aMask.Invert(); + maAlphaMask = aMask; } else { // convert to alpha bitmap SAL_WARN("vcl", "BitmapEx: forced mask to monochrome"); - BitmapEx aMaskEx(rMask); - BitmapFilter::Filter(aMaskEx, BitmapMonochromeFilter(255)); - aMaskEx.Invert(); - maAlphaMask = aMaskEx.GetBitmap(); + Bitmap aMask(rMask); + BitmapFilter::Filter(aMask, BitmapMonochromeFilter(255)); + aMask.Invert(); + maAlphaMask = aMask; } if (!maBitmap.IsEmpty() && maBitmap.GetSizePixel() != maAlphaMask.GetSizePixel()) diff --git a/vcl/source/bitmap/bitmapfilter.cxx b/vcl/source/bitmap/bitmapfilter.cxx index 51c9bbce2051..31e85d8647b0 100644 --- a/vcl/source/bitmap/bitmapfilter.cxx +++ b/vcl/source/bitmap/bitmapfilter.cxx @@ -17,15 +17,6 @@ BitmapFilter::BitmapFilter() {} BitmapFilter::~BitmapFilter() {} -bool BitmapFilter::Filter(BitmapEx& rBmpEx, BitmapFilter const& rFilter) -{ - Bitmap aBitmap(rBmpEx); - bool bRet = Filter(aBitmap, rFilter); - if (bRet) - rBmpEx = BitmapEx(aBitmap); - return bRet; -} - bool BitmapFilter::Filter(Bitmap& rBmp, BitmapFilter const& rFilter) { Bitmap aTmpBmp(rFilter.execute(rBmp));
