canvas/source/vcl/canvasbitmap.cxx | 2 canvas/source/vcl/canvashelper.cxx | 6 +- cppcanvas/source/mtfrenderer/implrenderer.cxx | 2 drawinglayer/source/processor2d/cairopixelprocessor2d.cxx | 2 drawinglayer/source/tools/converters.cxx | 2 drawinglayer/source/tools/wmfemfhelper.cxx | 33 +++++------ filter/source/msfilter/mstoolbar.cxx | 2 filter/source/svg/svgwriter.cxx | 40 +++++++------- filter/source/svg/svgwriter.hxx | 2 framework/source/fwe/classes/addonsoptions.cxx | 2 include/vcl/bitmap.hxx | 4 + include/vcl/metaact.hxx | 12 ++-- include/vcl/outdev.hxx | 2 include/vcl/print.hxx | 2 oox/source/drawingml/fillproperties.cxx | 2 oox/source/export/drawingml.cxx | 2 slideshow/source/engine/shapes/gdimtftools.cxx | 8 +- svx/source/dialog/_bmpmask.cxx | 4 - svx/source/dialog/_contdlg.cxx | 2 svx/source/svdraw/svdfmtf.cxx | 4 - svx/source/xoutdev/_xoutbmp.cxx | 2 vcl/qa/cppunit/GraphicMemoryTest.cxx | 2 vcl/qa/cppunit/GraphicTest.cxx | 2 vcl/qa/cppunit/canvasbitmaptest.cxx | 4 - vcl/qa/cppunit/png/PngFilterTest.cxx | 2 vcl/source/bitmap/BitmapTools.cxx | 2 vcl/source/bitmap/bitmap.cxx | 17 +++++ vcl/source/bitmap/dibtools.cxx | 4 - vcl/source/filter/eps/eps.cxx | 6 +- vcl/source/filter/ixbm/xbmread.cxx | 2 vcl/source/filter/ixpm/xpmread.cxx | 2 vcl/source/filter/svm/SvmReader.cxx | 6 +- vcl/source/filter/svm/SvmWriter.cxx | 6 +- vcl/source/filter/wmf/emfwr.cxx | 9 +-- vcl/source/filter/wmf/wmfwr.cxx | 9 +-- vcl/source/gdi/gdimetafiletools.cxx | 14 ++-- vcl/source/gdi/gdimtf.cxx | 14 ++-- vcl/source/gdi/metaact.cxx | 6 +- vcl/source/gdi/mtfxmldump.cxx | 12 ---- vcl/source/gdi/pdfwriter_impl2.cxx | 6 +- vcl/source/gdi/print.cxx | 15 ++--- vcl/source/graphic/GraphicObject2.cxx | 2 vcl/source/graphic/UnoGraphic.cxx | 2 vcl/source/graphic/UnoGraphicProvider.cxx | 2 vcl/source/outdev/bitmapex.cxx | 36 ++++++------ vcl/source/treelist/transfer.cxx | 2 46 files changed, 167 insertions(+), 154 deletions(-)
New commits: commit c0afb3514f1e60093190468a81088b32f288a9e8 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Fri Aug 29 15:12:07 2025 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Fri Aug 29 17:53:22 2025 +0200 add new Bitmap constructors to move the logic of constructing a new Bitmap from an existing Bitmap and an AlphaMask, into vcl, where it can later be optimised Change-Id: I2af1c6d1a35d968abdd07546448f7e211772e70b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190366 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/canvas/source/vcl/canvasbitmap.cxx b/canvas/source/vcl/canvasbitmap.cxx index dd6dbc77bc25..be97416eebb3 100644 --- a/canvas/source/vcl/canvasbitmap.cxx +++ b/canvas/source/vcl/canvasbitmap.cxx @@ -49,7 +49,7 @@ namespace vclcanvas { AlphaMask aAlpha ( rSize ); - maCanvasHelper.init( Bitmap(BitmapEx( aBitmap, aAlpha )), + maCanvasHelper.init( Bitmap( aBitmap, aAlpha ), rDevice, rOutDevProvider ); } diff --git a/canvas/source/vcl/canvashelper.cxx b/canvas/source/vcl/canvashelper.cxx index e2e7f28755ea..602d385755fe 100644 --- a/canvas/source/vcl/canvashelper.cxx +++ b/canvas/source/vcl/canvashelper.cxx @@ -721,7 +721,7 @@ namespace vclcanvas // when Skia is enabled. AlphaMask aAlpha( aBmp.CreateAlphaMask() ); aAlpha.Invert(); - aBmp = Bitmap(BitmapEx( aBmp.CreateColorBitmap(), aAlpha )); + aBmp = Bitmap( aBmp.CreateColorBitmap(), aAlpha ); // HACK. Normally, CanvasHelper does not care about // actually what mp2ndOutDev is... well, here we do & @@ -947,8 +947,8 @@ namespace vclcanvas rOutDev.EnableMapMode( false ); rOutDev.SetAntialiasing( AntialiasingFlags::Enable ); - Bitmap aBitmap( BitmapEx(rOutDev.GetBitmap(aRect.TopLeft(), - aRect.GetSize())).GetBitmap() ); + Bitmap aBitmap( rOutDev.GetBitmap(aRect.TopLeft(), + aRect.GetSize()).CreateColorBitmap() ); BitmapScopedReadAccess pReadAccess( aBitmap ); diff --git a/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx b/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx index 955caedf06b0..d0f70a509177 100644 --- a/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx +++ b/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx @@ -2121,7 +2121,7 @@ void CairoPixelProcessor2D::processMarkerArrayPrimitive2D( aBitmap2.Erase(Color(aReplacementColor)); if (rMarker.HasAlpha()) - aBitmap = Bitmap(BitmapEx(aBitmap2, rMarker.CreateAlphaMask())); + aBitmap = Bitmap(aBitmap2, rMarker.CreateAlphaMask()); else aBitmap = std::move(aBitmap2); } diff --git a/drawinglayer/source/tools/converters.cxx b/drawinglayer/source/tools/converters.cxx index 45a7b422c23e..33861573ac94 100644 --- a/drawinglayer/source/tools/converters.cxx +++ b/drawinglayer/source/tools/converters.cxx @@ -303,7 +303,7 @@ Bitmap convertToBitmap(drawinglayer::primitive2d::Primitive2DContainer&& rSeq, aAlpha.Invert(); } // return combined result - return Bitmap(BitmapEx(aRetval, aAlpha)); + return Bitmap(aRetval, aAlpha); } else return aRetval; diff --git a/filter/source/msfilter/mstoolbar.cxx b/filter/source/msfilter/mstoolbar.cxx index da405567dca2..e63cf40fdcd3 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." - aBit = Bitmap(BitmapEx(aBit.CreateColorBitmap(), rMaskBase.CreateAlphaMask(COL_WHITE))); + aBit = Bitmap(aBit.CreateColorBitmap(), rMaskBase.CreateAlphaMask(COL_WHITE)); } } diff --git a/framework/source/fwe/classes/addonsoptions.cxx b/framework/source/fwe/classes/addonsoptions.cxx index 5286a5af9047..694a6fefa524 100644 --- a/framework/source/fwe/classes/addonsoptions.cxx +++ b/framework/source/fwe/classes/addonsoptions.cxx @@ -1576,7 +1576,7 @@ Bitmap AddonsOptions_Impl::ReadImageFromURL(const OUString& aImageURL) { // Support non-transparent bitmaps to be downward compatible with OOo 1.1.x addons if( !aBitmap.HasAlpha() ) - aBitmap = Bitmap(BitmapEx( aBitmap.CreateColorBitmap(), COL_LIGHTMAGENTA )); + aBitmap = Bitmap( aBitmap.CreateColorBitmap(), COL_LIGHTMAGENTA ); aImage = aBitmap; } diff --git a/include/vcl/bitmap.hxx b/include/vcl/bitmap.hxx index 5fd2e04b1e44..d5fd388efca3 100644 --- a/include/vcl/bitmap.hxx +++ b/include/vcl/bitmap.hxx @@ -37,6 +37,7 @@ #include <algorithm> #include <memory> +class AlphaMask; class BitmapEx; namespace basegfx { class BColorModifierStack; } namespace com::sun::star::rendering { @@ -120,6 +121,9 @@ public: Bitmap( const Bitmap& rBitmap, Point aSrc, Size aSize ); explicit Bitmap( const BitmapEx& rBitmapEx ); Bitmap( const Size& rSizePixel, vcl::PixelFormat ePixelFormat, const BitmapPalette* pPal = nullptr ); + Bitmap( const Bitmap& rBmp, const Bitmap& rMask ); + Bitmap( const Bitmap& rBmp, const AlphaMask& rAlphaMask ); + Bitmap( const Bitmap& rBmp, const Color& rTransparentColor ); SAL_DLLPRIVATE explicit Bitmap( std::shared_ptr<SalBitmap> xSalBitmap ); ~Bitmap(); diff --git a/oox/source/drawingml/fillproperties.cxx b/oox/source/drawingml/fillproperties.cxx index 27e2f14e042c..db8509e49040 100644 --- a/oox/source/drawingml/fillproperties.cxx +++ b/oox/source/drawingml/fillproperties.cxx @@ -215,7 +215,7 @@ Reference<XGraphic> lclApplyBlackWhiteEffect(const BlipFillProperties& aBlipProp Bitmap aTmpBmp(aBitmap.CreateColorBitmap()); BitmapFilter::Filter(aTmpBmp, BitmapMonochromeFilter{ nThreshold }); - aReturnGraphic = ::Graphic(Bitmap(BitmapEx(aTmpBmp, aMask))); + aReturnGraphic = ::Graphic(Bitmap(aTmpBmp, aMask)); } else { diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 256eeb958aa2..a87a97977480 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -3327,7 +3327,7 @@ void DrawingML::WriteParagraphNumbering(const Reference< XPropertySet >& rXPropS Bitmap aSourceBitmap(aGraphic.GetBitmap()); aSourceBitmap.Scale(aDestRect.GetSize()); tools::Rectangle aSourceRect(Point(0, 0), aDestRect.GetSize()); - Bitmap aDestBitmap(BitmapEx(Bitmap(aDestSize, vcl::PixelFormat::N24_BPP), aMask)); + Bitmap aDestBitmap(Bitmap(aDestSize, vcl::PixelFormat::N24_BPP), aMask); aDestBitmap.CopyPixel(aDestRect, aSourceRect, aSourceBitmap); Graphic aDestGraphic(aDestBitmap); sRelationId = writeGraphicToStorage(aDestGraphic); diff --git a/slideshow/source/engine/shapes/gdimtftools.cxx b/slideshow/source/engine/shapes/gdimtftools.cxx index 8ecdba8d3b6d..e7c33528dc31 100644 --- a/slideshow/source/engine/shapes/gdimtftools.cxx +++ b/slideshow/source/engine/shapes/gdimtftools.cxx @@ -375,11 +375,11 @@ bool getAnimationFromGraphic( VectorOfMtfAnimationFrames& o_rFrames, AlphaMask aAlphaMask(pVDevMask->GetBitmap(aEmptyPoint, aAnimSize)); pMtf->AddAction( new MetaBmpExAction( aEmptyPoint, - Bitmap(BitmapEx( + Bitmap( pVDev->GetBitmap( aEmptyPoint, aAnimSize ), - aAlphaMask)))); + aAlphaMask))); } else { @@ -387,11 +387,11 @@ bool getAnimationFromGraphic( VectorOfMtfAnimationFrames& o_rFrames, aAlphaMask.Invert(); // convert from transparency to alpha pMtf->AddAction( new MetaBmpExAction( aEmptyPoint, - Bitmap(BitmapEx( + Bitmap( pVDev->GetBitmap( aEmptyPoint, aAnimSize ), - aAlphaMask)))); + aAlphaMask))); } mnLoadedFrames = i+1; } diff --git a/svx/source/dialog/_contdlg.cxx b/svx/source/dialog/_contdlg.cxx index c85af2188ffc..82cf3469e9de 100644 --- a/svx/source/dialog/_contdlg.cxx +++ b/svx/source/dialog/_contdlg.cxx @@ -651,7 +651,7 @@ IMPL_LINK( SvxSuperContourDlg, PipetteClickHdl, ContourWindow&, rWnd, void ) aRedoGraphic = Graphic(); aUndoGraphic = aGraphic; Bitmap aBmp = aGraphic.GetBitmap().CreateColorBitmap(); - aGraphic = Graphic( Bitmap(BitmapEx( aBmp, aMask )) ); + aGraphic = Graphic( Bitmap( aBmp, aMask ) ); mnGrfChanged++; bNewContour = (xQBox->run() == RET_YES); diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx index 073927aacc23..1435c160ceaa 100644 --- a/svx/source/svdraw/svdfmtf.cxx +++ b/svx/source/svdraw/svdfmtf.cxx @@ -1592,7 +1592,7 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaFloatTransparentAction const & rAct) aNewMask = AlphaMask(aBitmap.GetSizePixel(), &nTransparence); } - aBitmap = Bitmap(BitmapEx(aBitmap.CreateColorBitmap(), aNewMask)); + aBitmap = Bitmap(aBitmap.CreateColorBitmap(), aNewMask); } else { diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx index 5d8eb2680da0..f86031bd540c 100644 --- a/svx/source/xoutdev/_xoutbmp.cxx +++ b/svx/source/xoutdev/_xoutbmp.cxx @@ -316,7 +316,7 @@ ErrCode XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileName, pVDev->SetRasterOp( RasterOp::Xor ); pVDev->DrawBitmap( aPt, aSize, aBitmap ); - aGraphic = Bitmap(BitmapEx( aBitmap, pVDev->GetBitmap( aPt, aSize ) )); + aGraphic = Bitmap( aBitmap, pVDev->GetBitmap( aPt, aSize ) ); } else { diff --git a/vcl/qa/cppunit/GraphicMemoryTest.cxx b/vcl/qa/cppunit/GraphicMemoryTest.cxx index b5b664062c38..4bad9a81f524 100644 --- a/vcl/qa/cppunit/GraphicMemoryTest.cxx +++ b/vcl/qa/cppunit/GraphicMemoryTest.cxx @@ -35,7 +35,7 @@ Bitmap createBitmap(Size aSize, bool bAlpha = false) sal_uInt8 uAlphaValue = 0x80; AlphaMask aAlphaMask(aSize, &uAlphaValue); - return Bitmap(BitmapEx(aBitmap, aAlphaMask)); + return Bitmap(aBitmap, aAlphaMask); } else { diff --git a/vcl/qa/cppunit/GraphicTest.cxx b/vcl/qa/cppunit/GraphicTest.cxx index e45912a9a400..21cc2e55a051 100644 --- a/vcl/qa/cppunit/GraphicTest.cxx +++ b/vcl/qa/cppunit/GraphicTest.cxx @@ -65,7 +65,7 @@ Bitmap createBitmap(bool alpha = false) sal_uInt8 uAlphaValue = 0x80; AlphaMask aAlphaMask(Size(120, 100), &uAlphaValue); - return Bitmap(BitmapEx(aBitmap, aAlphaMask)); + return Bitmap(aBitmap, aAlphaMask); } else { diff --git a/vcl/qa/cppunit/canvasbitmaptest.cxx b/vcl/qa/cppunit/canvasbitmaptest.cxx index 0f46b002ecf9..6f47d60b1d04 100644 --- a/vcl/qa/cppunit/canvasbitmaptest.cxx +++ b/vcl/qa/cppunit/canvasbitmaptest.cxx @@ -686,7 +686,7 @@ void CanvasBitmapTest::runTest() } } - xBmp.set( new VclCanvasBitmap(Bitmap(BitmapEx(aBitmap,aMask))) ); + xBmp.set( new VclCanvasBitmap(Bitmap(aBitmap,aMask)) ); checkCanvasBitmap( xBmp, "masked bitmap", nDepth ); @@ -704,7 +704,7 @@ void CanvasBitmapTest::runTest() } } - xBmp.set( new VclCanvasBitmap(Bitmap(BitmapEx(aBitmap,aAlpha))) ); + xBmp.set( new VclCanvasBitmap(Bitmap(aBitmap,aAlpha)) ); checkCanvasBitmap( xBmp, "alpha bitmap", nDepth ); } diff --git a/vcl/qa/cppunit/png/PngFilterTest.cxx b/vcl/qa/cppunit/png/PngFilterTest.cxx index c772ca7f599d..161600f36b93 100644 --- a/vcl/qa/cppunit/png/PngFilterTest.cxx +++ b/vcl/qa/cppunit/png/PngFilterTest.cxx @@ -1978,7 +1978,7 @@ void PngFilterTest::testTdf153180MonochromeFilterPngExport() Bitmap aTmpBmp(aBitmap.CreateColorBitmap()); BitmapFilter::Filter(aTmpBmp, BitmapMonochromeFilter{ sal_uInt8{ 127 } }); - Graphic aGraphicAfterFilter{ Bitmap(BitmapEx(aTmpBmp, aAlphaMask)) }; + Graphic aGraphicAfterFilter{ Bitmap(aTmpBmp, aAlphaMask) }; CPPUNIT_ASSERT(aGraphicAfterFilter.IsAlpha()); // export the resulting graphic diff --git a/vcl/source/bitmap/BitmapTools.cxx b/vcl/source/bitmap/BitmapTools.cxx index a7c97f8dce12..2946b3357f93 100644 --- a/vcl/source/bitmap/BitmapTools.cxx +++ b/vcl/source/bitmap/BitmapTools.cxx @@ -627,7 +627,7 @@ void DrawAndClipBitmap(const Point& rPos, const Size& rSize, const Bitmap& rBitm { // no mask yet, create and add new mask. For better quality, use Alpha, // this allows the drawn mask being processed with AntiAliasing (AAed) - aBmp = Bitmap(BitmapEx(rBitmap, aVDevMask)); + aBmp = Bitmap(rBitmap, aVDevMask); } } diff --git a/vcl/source/bitmap/bitmap.cxx b/vcl/source/bitmap/bitmap.cxx index 9e252731200e..ba2f35895503 100644 --- a/vcl/source/bitmap/bitmap.cxx +++ b/vcl/source/bitmap/bitmap.cxx @@ -227,6 +227,23 @@ void Bitmap::loadFromIconTheme( const OUString& rIconName ) SAL_WARN_IF( !bSuccess, "vcl", "BitmapEx::BitmapEx(): could not load image " << rIconName << " via icon theme " << aIconTheme); } +Bitmap::Bitmap( const Bitmap& rBmp, const Bitmap& rMask ) +{ + *this = Bitmap(BitmapEx(rBmp, rMask)); +} + +Bitmap::Bitmap( const Bitmap& rBmp, const AlphaMask& rAlphaMask ) +{ + *this = Bitmap(BitmapEx(rBmp, rAlphaMask)); +} + + +Bitmap::Bitmap( const Bitmap& rBmp, const Color& rTransparentColor ) +{ + *this = Bitmap(BitmapEx(rBmp, rTransparentColor)); +} + + #ifdef DBG_UTIL namespace diff --git a/vcl/source/bitmap/dibtools.cxx b/vcl/source/bitmap/dibtools.cxx index 97b3b7d49000..ba2d87fafd2e 100644 --- a/vcl/source/bitmap/dibtools.cxx +++ b/vcl/source/bitmap/dibtools.cxx @@ -1728,7 +1728,7 @@ bool ReadDIBBitmapEx( bRetval = ImplReadDIB(aMask, nullptr, rIStm, true); if(bRetval && !aMask.IsEmpty()) - rTarget = Bitmap(BitmapEx(aBmp, aMask)); + rTarget = Bitmap(aBmp, aMask); break; } @@ -1743,7 +1743,7 @@ bool ReadDIBBitmapEx( if(bRetval) { - rTarget = Bitmap(BitmapEx(aBmp, aTransparentColor)); + rTarget = Bitmap(aBmp, aTransparentColor); } break; } diff --git a/vcl/source/filter/ixbm/xbmread.cxx b/vcl/source/filter/ixbm/xbmread.cxx index 2f0e2417de3c..e2cb29b3ade9 100644 --- a/vcl/source/filter/ixbm/xbmread.cxx +++ b/vcl/source/filter/ixbm/xbmread.cxx @@ -339,7 +339,7 @@ ReadState XBMReader::ReadXBM(Bitmap& rBitmap) mpWriteAccess.reset(); aBlackBmp.Erase( COL_BLACK ); - rBitmap = Bitmap(BitmapEx(aBlackBmp, maBitmap)); + rBitmap = Bitmap(aBlackBmp, maBitmap); eReadState = XBMREAD_OK; } diff --git a/vcl/source/filter/ixpm/xpmread.cxx b/vcl/source/filter/ixpm/xpmread.cxx index b1a2e19a5ac7..b358d4cdbc10 100644 --- a/vcl/source/filter/ixpm/xpmread.cxx +++ b/vcl/source/filter/ixpm/xpmread.cxx @@ -226,7 +226,7 @@ ReadState XPMReader::ReadXPM(Bitmap& rBitmap) if (mpMaskWriterAccess) { mpMaskWriterAccess.reset(); - rBitmap = Bitmap(BitmapEx(maBitmap, maMaskBitmap)); + rBitmap = Bitmap(maBitmap, maMaskBitmap); } else { diff --git a/vcl/source/gdi/gdimetafiletools.cxx b/vcl/source/gdi/gdimetafiletools.cxx index 624437d3a35c..803c1d4eda0f 100644 --- a/vcl/source/gdi/gdimetafiletools.cxx +++ b/vcl/source/gdi/gdimetafiletools.cxx @@ -226,7 +226,7 @@ namespace Size( basegfx::fround<tools::Long>(aLogicBitmapRange.getWidth()), basegfx::fround<tools::Long>(aLogicBitmapRange.getHeight())), - Bitmap(BitmapEx(rBitmapEx.GetBitmap(), aAlpha)))); + Bitmap(rBitmapEx.GetBitmap(), aAlpha))); return true; } @@ -340,7 +340,7 @@ namespace Size( basegfx::fround<tools::Long>(aLogicBitmapRange.getWidth()), basegfx::fround<tools::Long>(aLogicBitmapRange.getHeight())), - Bitmap(BitmapEx(rBitmap.CreateColorBitmap(), aAlpha)))); + Bitmap(rBitmap.CreateColorBitmap(), aAlpha))); return true; } diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index 68ae6d37312d..640658f3c29b 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -1772,7 +1772,7 @@ Bitmap GDIMetaFile::ImplBmpMonoFnc( const Bitmap& rBmp, const void* pBmpParam ) aBmp.Erase( static_cast<const ImplBmpMonoParam*>(pBmpParam)->aColor ); if( rBmp.HasAlpha() ) - return Bitmap(BitmapEx( aBmp, rBmp.CreateAlphaMask() )); + return Bitmap( aBmp, rBmp.CreateAlphaMask() ); else return aBmp; } diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx index 607c3a21b642..d359913d4938 100644 --- a/vcl/source/gdi/pdfwriter_impl2.cxx +++ b/vcl/source/gdi/pdfwriter_impl2.cxx @@ -520,7 +520,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa xVDev.disposeAndClear(); Graphic aGraphic = i_pOutDevData ? i_pOutDevData->GetCurrentGraphic() : Graphic(); - implWriteBitmapEx( rPos, rSize, Bitmap(BitmapEx( aPaint.GetBitmap(), aAlpha )), aGraphic, pDummyVDev, i_rContext ); + implWriteBitmapEx( rPos, rSize, Bitmap(aPaint.GetBitmap(), aAlpha ), aGraphic, pDummyVDev, i_rContext ); } } } diff --git a/vcl/source/graphic/GraphicObject2.cxx b/vcl/source/graphic/GraphicObject2.cxx index 03dda1b16d81..c617b49a915a 100644 --- a/vcl/source/graphic/GraphicObject2.cxx +++ b/vcl/source/graphic/GraphicObject2.cxx @@ -517,7 +517,7 @@ void GraphicObject::ImplTransformBitmap( Bitmap& rBmp, aMask.Erase(255); // #104115# Always generate transparent bitmap, we need the border transparent - aBmp2 = Bitmap(BitmapEx( rBmp.CreateColorBitmap(), aMask )); + aBmp2 = Bitmap(rBmp.CreateColorBitmap(), aMask ); // #104115# Add opaque mask to source bitmap, otherwise the destination remains transparent rBmp = aBmp2; diff --git a/vcl/source/graphic/UnoGraphic.cxx b/vcl/source/graphic/UnoGraphic.cxx index 796b2d610ac4..34c876aba699 100644 --- a/vcl/source/graphic/UnoGraphic.cxx +++ b/vcl/source/graphic/UnoGraphic.cxx @@ -202,7 +202,7 @@ uno::Reference< graphic::XGraphic > SAL_CALL Graphic::colorChange( Bitmap aBitmap2(aBitmap); AlphaMask aMask(aBitmap2.CreateAlphaMask(aColorFrom, nTolerance)); aBitmap2.Replace(aColorFrom, aColorTo, nTolerance); - aReturnGraphic = ::Graphic(Bitmap(BitmapEx(aBitmap2, aMask))); + aReturnGraphic = ::Graphic(Bitmap(aBitmap2, aMask)); } else { diff --git a/vcl/source/graphic/UnoGraphicProvider.cxx b/vcl/source/graphic/UnoGraphicProvider.cxx index 8639a2484dc1..267bf6813711 100644 --- a/vcl/source/graphic/UnoGraphicProvider.cxx +++ b/vcl/source/graphic/UnoGraphicProvider.cxx @@ -85,7 +85,7 @@ Bitmap GetBitmap(const css::uno::Reference<css::awt::XBitmap>& xBitmap) if (Bitmap aMask = BitmapFromDIB(xBitmap->getMaskDIB()); !aMask.IsEmpty()) { aMask.Invert(); // Convert from transparency to alpha - return Bitmap(BitmapEx(BitmapFromDIB(xBitmap->getDIB()), aMask)); + return Bitmap(BitmapFromDIB(xBitmap->getDIB()), aMask); } Bitmap aBmp; diff --git a/vcl/source/treelist/transfer.cxx b/vcl/source/treelist/transfer.cxx index 91948d023de4..35bf5a4da89f 100644 --- a/vcl/source/treelist/transfer.cxx +++ b/vcl/source/treelist/transfer.cxx @@ -1613,7 +1613,7 @@ bool TransferableDataHelper::GetBitmap(const DataFlavor& rFlavor, Bitmap& rBmp) } else { - rBmp = Bitmap(BitmapEx(aBitmap, aMask)); + rBmp = Bitmap(aBitmap, aMask); } } commit 232d7631e86bf5d0a21aca899f6a0239aa9486be Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Fri Aug 29 07:57:05 2025 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Fri Aug 29 17:53:10 2025 +0200 BitmapEx->Bitmap in MetaBmpExScalePartAction now that Bitmap can handle transparency Change-Id: Idbbfe20aff2ff40f19b6cb30ece678bf282a6698 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190365 Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> Tested-by: Jenkins diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx index 4f345843ce34..0dac361ec561 100644 --- a/cppcanvas/source/mtfrenderer/implrenderer.cxx +++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx @@ -2236,7 +2236,7 @@ namespace cppcanvas::internal // crop bitmap to given source rectangle (no // need to copy and convert the whole bitmap) - Bitmap aBmp( pAct->GetBitmapEx() ); + Bitmap aBmp( pAct->GetBitmap() ); const ::tools::Rectangle aCropRect( pAct->GetSrcPoint(), pAct->GetSrcSize() ); aBmp.Crop( aCropRect ); diff --git a/drawinglayer/source/tools/wmfemfhelper.cxx b/drawinglayer/source/tools/wmfemfhelper.cxx index efc016ed9d63..11765941ef65 100644 --- a/drawinglayer/source/tools/wmfemfhelper.cxx +++ b/drawinglayer/source/tools/wmfemfhelper.cxx @@ -605,13 +605,13 @@ namespace wmfemfhelper /** helper to create BitmapPrimitive2D based on current context */ static void createBitmapPrimitive( - const BitmapEx& rBitmapEx, + const Bitmap& rBitmap, const Point& rPoint, const Size& rSize, TargetHolder& rTarget, PropertyHolder const & rProperties) { - if(rBitmapEx.IsEmpty()) + if(rBitmap.IsEmpty()) return; basegfx::B2DHomMatrix aObjectTransform; @@ -625,7 +625,7 @@ namespace wmfemfhelper rTarget.append( new drawinglayer::primitive2d::BitmapPrimitive2D( - Bitmap(rBitmapEx), + rBitmap, aObjectTransform)); } @@ -1920,9 +1920,9 @@ namespace wmfemfhelper { /** CHECKED, WORKS WELL */ const MetaBmpScaleAction* pA = static_cast<const MetaBmpScaleAction*>(pAction); - const BitmapEx aBitmapEx(pA->GetBitmap()); + const Bitmap aBitmap(pA->GetBitmap()); - createBitmapPrimitive(aBitmapEx, pA->GetPoint(), pA->GetSize(), rTargetHolders.Current(), rPropertyHolders.Current()); + createBitmapPrimitive(aBitmap, pA->GetPoint(), pA->GetSize(), rTargetHolders.Current(), rPropertyHolders.Current()); break; } @@ -1942,8 +1942,7 @@ namespace wmfemfhelper aCroppedBitmap.Crop(aCropRectangle); } - const BitmapEx aCroppedBitmapEx(aCroppedBitmap); - createBitmapPrimitive(aCroppedBitmapEx, pA->GetDestPoint(), pA->GetDestSize(), rTargetHolders.Current(), rPropertyHolders.Current()); + createBitmapPrimitive(aCroppedBitmap, pA->GetDestPoint(), pA->GetDestSize(), rTargetHolders.Current(), rPropertyHolders.Current()); } break; @@ -1964,7 +1963,7 @@ namespace wmfemfhelper const MetaBmpExScaleAction* pA = static_cast<const MetaBmpExScaleAction*>(pAction); const Bitmap& rBitmap = pA->GetBitmap(); - createBitmapPrimitive(BitmapEx(rBitmap), pA->GetPoint(), pA->GetSize(), rTargetHolders.Current(), rPropertyHolders.Current()); + createBitmapPrimitive(rBitmap, pA->GetPoint(), pA->GetSize(), rTargetHolders.Current(), rPropertyHolders.Current()); break; } @@ -1972,19 +1971,19 @@ namespace wmfemfhelper { /** CHECKED, WORKS WELL: Simply same as MetaActionType::BMPSCALEPART */ const MetaBmpExScalePartAction* pA = static_cast<const MetaBmpExScalePartAction*>(pAction); - const BitmapEx& rBitmapEx = pA->GetBitmapEx(); + const Bitmap& rBitmap = pA->GetBitmap(); - if(!rBitmapEx.IsEmpty()) + if(!rBitmap.IsEmpty()) { - BitmapEx aCroppedBitmapEx(rBitmapEx); + Bitmap aCroppedBitmap(rBitmap); const tools::Rectangle aCropRectangle(pA->GetSrcPoint(), pA->GetSrcSize()); if(!aCropRectangle.IsEmpty()) { - aCroppedBitmapEx.Crop(aCropRectangle); + aCroppedBitmap.Crop(aCropRectangle); } - createBitmapPrimitive(aCroppedBitmapEx, pA->GetDestPoint(), pA->GetDestSize(), rTargetHolders.Current(), rPropertyHolders.Current()); + createBitmapPrimitive(aCroppedBitmap, pA->GetDestPoint(), pA->GetDestSize(), rTargetHolders.Current(), rPropertyHolders.Current()); } break; @@ -2004,9 +2003,9 @@ namespace wmfemfhelper { /** CHECKED, WORKS WELL: Simply same as MetaActionType::BMPSCALE */ const MetaMaskScaleAction* pA = static_cast<const MetaMaskScaleAction*>(pAction); - const BitmapEx aBitmapEx(createMaskBmpEx(pA->GetBitmap(), pA->GetColor())); + const Bitmap aBitmap(createMaskBmpEx(pA->GetBitmap(), pA->GetColor())); - createBitmapPrimitive(aBitmapEx, pA->GetPoint(), pA->GetSize(), rTargetHolders.Current(), rPropertyHolders.Current()); + createBitmapPrimitive(aBitmap, pA->GetPoint(), pA->GetSize(), rTargetHolders.Current(), rPropertyHolders.Current()); break; } @@ -2026,8 +2025,8 @@ namespace wmfemfhelper aCroppedBitmap.Crop(aCropRectangle); } - const BitmapEx aCroppedBitmapEx(createMaskBmpEx(aCroppedBitmap, pA->GetColor())); - createBitmapPrimitive(aCroppedBitmapEx, pA->GetDestPoint(), pA->GetDestSize(), rTargetHolders.Current(), rPropertyHolders.Current()); + const Bitmap aCroppedBitmap2(createMaskBmpEx(aCroppedBitmap, pA->GetColor())); + createBitmapPrimitive(aCroppedBitmap2, pA->GetDestPoint(), pA->GetDestSize(), rTargetHolders.Current(), rPropertyHolders.Current()); } break; diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx index c62c6a70ea95..cf3234b115ee 100644 --- a/filter/source/svg/svgwriter.cxx +++ b/filter/source/svg/svgwriter.cxx @@ -2912,16 +2912,16 @@ void GetGraphicFromXShape(const css::uno::Reference<css::drawing::XShape>* pShap } } -void SVGActionWriter::ImplWriteBmp( const BitmapEx& rBmpEx, +void SVGActionWriter::ImplWriteBmp( const Bitmap& rBmp, const Point& rPt, const Size& rSz, const Point& rSrcPt, const Size& rSrcSz, const css::uno::Reference<css::drawing::XShape>* pShape ) { - if( rBmpEx.IsEmpty() ) + if( rBmp.IsEmpty() ) return; if( mpEmbeddedBitmapsMap && !mpEmbeddedBitmapsMap->empty()) { - BitmapChecksum nChecksum = rBmpEx.GetChecksum(); + BitmapChecksum nChecksum = rBmp.GetChecksum(); if( mpEmbeddedBitmapsMap->find( nChecksum ) != mpEmbeddedBitmapsMap->end() ) { // <use transform="translate(?) scale(?)" xlink:ref="?" > @@ -2956,14 +2956,14 @@ void SVGActionWriter::ImplWriteBmp( const BitmapEx& rBmpEx, } } - BitmapEx aBmpEx( rBmpEx ); - const tools::Rectangle aBmpRect( Point(), rBmpEx.GetSizePixel() ); + Bitmap aBmp( rBmp ); + const tools::Rectangle aBmpRect( Point(), rBmp.GetSizePixel() ); const tools::Rectangle aSrcRect( rSrcPt, rSrcSz ); if( aSrcRect != aBmpRect ) - aBmpEx.Crop( aSrcRect ); + aBmp.Crop( aSrcRect ); - if( aBmpEx.IsEmpty() ) + if( aBmp.IsEmpty() ) return; SvMemoryStream aOStm( 65535, 65535 ); @@ -2977,7 +2977,7 @@ void SVGActionWriter::ImplWriteBmp( const BitmapEx& rBmpEx, if (aGraphic.GetType() == GraphicType::Bitmap) { const Bitmap& rGraphicBitmap = aGraphic.GetBitmapRef(); - if (rGraphicBitmap == Bitmap(rBmpEx)) + if (rGraphicBitmap == rBmp) { bool bPNG = false; GfxLink aGfxLink = aGraphic.GetGfxLink(); @@ -2998,13 +2998,13 @@ void SVGActionWriter::ImplWriteBmp( const BitmapEx& rBmpEx, } } - const BitmapEx* pBitmap = &rBmpEx; - BitmapEx aNewBitmap; + const Bitmap* pBitmap = &rBmp; + Bitmap aNewBitmap; // for preview we generate downscaled images (1280x720 max) if (mbIsPreview) { - Size aSize = rBmpEx.GetSizePixel(); + Size aSize = rBmp.GetSizePixel(); double fX = static_cast<double>(aSize.getWidth()) / 1280; double fY = static_cast<double>(aSize.getHeight()) / 720; double fFactor = fX > fY ? fX : fY; @@ -3012,13 +3012,13 @@ void SVGActionWriter::ImplWriteBmp( const BitmapEx& rBmpEx, { aSize.setWidth(aSize.getWidth() / fFactor); aSize.setHeight(aSize.getHeight() / fFactor); - aNewBitmap = rBmpEx; + aNewBitmap = rBmp; aNewBitmap.Scale(aSize); pBitmap = &aNewBitmap; } } - if( !(bCached || GraphicConverter::Export( aOStm, Bitmap(*pBitmap), ConvertDataFormat::PNG ) == ERRCODE_NONE) ) + if( !(bCached || GraphicConverter::Export( aOStm, *pBitmap, ConvertDataFormat::PNG ) == ERRCODE_NONE) ) return; Point aPt; @@ -3409,7 +3409,7 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, { bFound = true; const MetaBmpScaleAction* pBmpScaleAction = static_cast<const MetaBmpScaleAction*>(pSubstAct); - ImplWriteBmp( BitmapEx(pBmpScaleAction->GetBitmap()), + ImplWriteBmp( pBmpScaleAction->GetBitmap(), pA->GetPoint(), pA->GetSize(), Point(), pBmpScaleAction->GetBitmap().GetSizePixel(), pxShape ); } @@ -3862,7 +3862,7 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, { const MetaBmpAction* pA = static_cast<const MetaBmpAction*>(pAction); - ImplWriteBmp( BitmapEx(pA->GetBitmap()), + ImplWriteBmp( pA->GetBitmap(), pA->GetPoint(), mpVDev->PixelToLogic( pA->GetBitmap().GetSizePixel() ), Point(), pA->GetBitmap().GetSizePixel(), pxShape ); } @@ -3882,7 +3882,7 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, } else { - ImplWriteBmp( BitmapEx(pA->GetBitmap()), + ImplWriteBmp( pA->GetBitmap(), pA->GetPoint(), pA->GetSize(), Point(), pA->GetBitmap().GetSizePixel(), pxShape ); } @@ -3896,7 +3896,7 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, { const MetaBmpScalePartAction* pA = static_cast<const MetaBmpScalePartAction*>(pAction); - ImplWriteBmp( BitmapEx(pA->GetBitmap()), + ImplWriteBmp( pA->GetBitmap(), pA->GetDestPoint(), pA->GetDestSize(), pA->GetSrcPoint(), pA->GetSrcSize(), pxShape ); } @@ -3909,7 +3909,7 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, { const MetaBmpExAction* pA = static_cast<const MetaBmpExAction*>(pAction); - ImplWriteBmp( BitmapEx(pA->GetBitmap()), + ImplWriteBmp( pA->GetBitmap(), pA->GetPoint(), mpVDev->PixelToLogic( pA->GetBitmap().GetSizePixel() ), Point(), pA->GetBitmap().GetSizePixel(), pxShape ); } @@ -3929,7 +3929,7 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, } else { - ImplWriteBmp( BitmapEx(pA->GetBitmap()), + ImplWriteBmp( pA->GetBitmap(), pA->GetPoint(), pA->GetSize(), Point(), pA->GetBitmap().GetSizePixel(), pxShape ); } @@ -3943,7 +3943,7 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, { const MetaBmpExScalePartAction* pA = static_cast<const MetaBmpExScalePartAction*>(pAction); - ImplWriteBmp( pA->GetBitmapEx(), + ImplWriteBmp( pA->GetBitmap(), pA->GetDestPoint(), pA->GetDestSize(), pA->GetSrcPoint(), pA->GetSrcSize(), pxShape ); } diff --git a/filter/source/svg/svgwriter.hxx b/filter/source/svg/svgwriter.hxx index 9c1e69fcf4bf..1ddd34ee7603 100644 --- a/filter/source/svg/svgwriter.hxx +++ b/filter/source/svg/svgwriter.hxx @@ -342,7 +342,7 @@ private: void ImplWriteMask( GDIMetaFile& rMtf, const Point& rDestPt, const Size& rDestSize, const Gradient& rGradient, sal_uInt32 nWriteFlags, const basegfx::BColorStops* pColorStops); void ImplWriteText( const Point& rPos, const OUString& rText, KernArraySpan pDXArray, tools::Long nWidth ); void ImplWriteText( const Point& rPos, const OUString& rText, KernArraySpan pDXArray, tools::Long nWidth, Color aTextColor ); - void ImplWriteBmp( const BitmapEx& rBmpEx, const Point& rPt, const Size& rSz, const Point& rSrcPt, const Size& rSrcSz, const css::uno::Reference<css::drawing::XShape>* pShape); + void ImplWriteBmp( const Bitmap& rBmp, const Point& rPt, const Size& rSz, const Point& rSrcPt, const Size& rSrcSz, const css::uno::Reference<css::drawing::XShape>* pShape); void ImplWriteActions( const GDIMetaFile& rMtf, sal_uInt32 nWriteFlags, diff --git a/include/vcl/metaact.hxx b/include/vcl/metaact.hxx index 78339cd517ee..74ece4d2f211 100644 --- a/include/vcl/metaact.hxx +++ b/include/vcl/metaact.hxx @@ -28,7 +28,7 @@ #include <vcl/dllapi.h> #include <vcl/rendercontext/State.hxx> -#include <vcl/bitmapex.hxx> +#include <vcl/bitmap.hxx> #include <vcl/font.hxx> #include <vcl/gdimtf.hxx> #include <vcl/gfxlink.hxx> @@ -853,7 +853,7 @@ class VCL_DLLPUBLIC MetaBmpExScalePartAction final : public MetaAction { private: - BitmapEx maBmpEx; + Bitmap maBmp; Point maDstPt; Size maDstSz; Point maSrcPt; @@ -873,22 +873,22 @@ public: MetaBmpExScalePartAction( const Point& rDstPt, const Size& rDstSz, const Point& rSrcPt, const Size& rSrcSz, - const BitmapEx& rBmpEx ); + const Bitmap& rBmp ); SAL_DLLPRIVATE virtual void Move( tools::Long nHorzMove, tools::Long nVertMove ) override; SAL_DLLPRIVATE virtual void Scale( double fScaleX, double fScaleY ) override; - const BitmapEx& GetBitmapEx() const { return maBmpEx; } + const Bitmap& GetBitmap() const { return maBmp; } const Point& GetDestPoint() const { return maDstPt; } const Size& GetDestSize() const { return maDstSz; } const Point& GetSrcPoint() const { return maSrcPt; } const Size& GetSrcSize() const { return maSrcSz; } - void SetBitmapEx(const BitmapEx& rBmpEx) { maBmpEx = rBmpEx; } + void SetBitmap(const Bitmap& rBmp) { maBmp = rBmp; } void SetDestPoint(const Point& rDstPt) { maDstPt = rDstPt; } void SetDestSize(const Size& rDstSz) { maDstSz = rDstSz; } void SetSrcPoint(const Point& rSrcPt) { maSrcPt = rSrcPt; } void SetSrcSize(const Size& rSrcSz) { maSrcSz = rSrcSz; } - bool IsTransparent() const override { return GetBitmapEx().IsAlpha(); } + bool IsTransparent() const override { return GetBitmap().HasAlpha(); } }; class SAL_DLLPUBLIC_RTTI MetaMaskAction final : public MetaAction diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index 0538198be64f..4ccca7cda929 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -1428,7 +1428,7 @@ protected: virtual void DrawDeviceBitmapEx( const Point& rDestPt, const Size& rDestSize, const Point& rSrcPtPixel, const Size& rSrcSizePixel, - BitmapEx& rBitmapEx ); + Bitmap& rBitmap ); virtual bool CanSubsampleBitmap() const { return true; } diff --git a/include/vcl/print.hxx b/include/vcl/print.hxx index 2dc9a2e5127b..a4d49341c9c0 100644 --- a/include/vcl/print.hxx +++ b/include/vcl/print.hxx @@ -171,7 +171,7 @@ protected: void DrawDeviceBitmapEx( const Point& rDestPt, const Size& rDestSize, const Point& rSrcPtPixel, const Size& rSrcSizePixel, - BitmapEx& rBitmapEx ) override; + Bitmap& rBitmap ) override; virtual void EmulateDrawTransparent( const tools::PolyPolygon& rPolyPoly, sal_uInt16 nTransparencePercent ) override; diff --git a/svx/source/dialog/_bmpmask.cxx b/svx/source/dialog/_bmpmask.cxx index 85a81ec022a8..feb9b54965a4 100644 --- a/svx/source/dialog/_bmpmask.cxx +++ b/svx/source/dialog/_bmpmask.cxx @@ -861,10 +861,10 @@ GDIMetaFile SvxBmpMask::ImpMask( const GDIMetaFile& rMtf ) case MetaActionType::BMPEXSCALEPART: { MetaBmpExScalePartAction* pAct = static_cast<MetaBmpExScalePartAction*>(pAction); - const BitmapEx aBmpEx( Mask( Bitmap(pAct->GetBitmapEx()) ).GetBitmap() ); + const Bitmap aBmp( Mask( pAct->GetBitmap() ).GetBitmap() ); pAct = new MetaBmpExScalePartAction( pAct->GetDestPoint(), pAct->GetDestSize(), - pAct->GetSrcPoint(), pAct->GetSrcSize(), aBmpEx ); + pAct->GetSrcPoint(), pAct->GetSrcSize(), aBmp ); aMtf.AddAction( pAct ); } break; diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx index 256460f1d6ac..073927aacc23 100644 --- a/svx/source/svdraw/svdfmtf.cxx +++ b/svx/source/svdraw/svdfmtf.cxx @@ -1329,7 +1329,7 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaBmpScalePartAction const & rAct) void ImpSdrGDIMetaFileImport::DoAction(MetaBmpExScalePartAction const & rAct) { tools::Rectangle aRect(rAct.GetDestPoint(),rAct.GetDestSize()); - Bitmap aBitmap(rAct.GetBitmapEx()); + Bitmap aBitmap(rAct.GetBitmap()); aRect.AdjustRight( 1 ); aRect.AdjustBottom( 1 ); diff --git a/vcl/source/filter/eps/eps.cxx b/vcl/source/filter/eps/eps.cxx index 63b9733b645b..35cfc27a788c 100644 --- a/vcl/source/filter/eps/eps.cxx +++ b/vcl/source/filter/eps/eps.cxx @@ -841,13 +841,13 @@ void PSWriter::ImplWriteActions( const GDIMetaFile& rMtf, VirtualDevice& rVDev ) case MetaActionType::BMPEXSCALEPART : { - BitmapEx aBitmapEx( static_cast<const MetaBmpExScalePartAction*>(pMA)->GetBitmapEx() ); + Bitmap aBitmapEx( static_cast<const MetaBmpExScalePartAction*>(pMA)->GetBitmap() ); aBitmapEx.Crop( tools::Rectangle( static_cast<const MetaBmpExScalePartAction*>(pMA)->GetSrcPoint(), static_cast<const MetaBmpExScalePartAction*>(pMA)->GetSrcSize() ) ); - Bitmap aBitmap( aBitmapEx.GetBitmap() ); + Bitmap aBitmap( aBitmapEx.CreateColorBitmap() ); if ( mbGrayScale ) aBitmap.Convert( BmpConversion::N8BitGreys ); - AlphaMask aMask( aBitmapEx.GetAlphaMask() ); + AlphaMask aMask( aBitmapEx.CreateAlphaMask() ); Point aPoint = static_cast<const MetaBmpExScalePartAction*>(pMA)->GetDestPoint(); Size aSize = static_cast<const MetaBmpExScalePartAction*>(pMA)->GetDestSize(); ImplBmp( &aBitmap, &aMask, aPoint, aSize.Width(), aSize.Height() ); diff --git a/vcl/source/filter/svm/SvmReader.cxx b/vcl/source/filter/svm/SvmReader.cxx index ad9b064aa226..a04b60f7f69a 100644 --- a/vcl/source/filter/svm/SvmReader.cxx +++ b/vcl/source/filter/svm/SvmReader.cxx @@ -975,8 +975,8 @@ rtl::Reference<MetaAction> SvmReader::BmpExScalePartHandler() rtl::Reference<MetaBmpExScalePartAction> pAction(new MetaBmpExScalePartAction); VersionCompatRead aCompat(mrStream); - BitmapEx aBmpEx; - ReadDIBBitmapEx(aBmpEx, mrStream); + Bitmap aBmp; + ReadDIBBitmapEx(aBmp, mrStream); TypeSerializer aSerializer(mrStream); Point aDstPoint; aSerializer.readPoint(aDstPoint); @@ -987,7 +987,7 @@ rtl::Reference<MetaAction> SvmReader::BmpExScalePartHandler() Size aSrcSize; aSerializer.readSize(aSrcSize); - pAction->SetBitmapEx(aBmpEx); + pAction->SetBitmap(aBmp); pAction->SetDestPoint(aDstPoint); pAction->SetDestSize(aDstSize); pAction->SetSrcPoint(aSrcPoint); diff --git a/vcl/source/filter/svm/SvmWriter.cxx b/vcl/source/filter/svm/SvmWriter.cxx index 296e856e5cb1..93ff80ce4b86 100644 --- a/vcl/source/filter/svm/SvmWriter.cxx +++ b/vcl/source/filter/svm/SvmWriter.cxx @@ -213,7 +213,7 @@ BitmapChecksum SvmWriter::GetChecksum(const GDIMetaFile& rMetaFile) ShortToSVBT16(static_cast<sal_uInt16>(pAct->GetType()), aBT16); nCrc = rtl_crc32(nCrc, aBT16, 2); - BCToBCOA(pAct->GetBitmapEx().GetChecksum(), aBCOA); + BCToBCOA(pAct->GetBitmap().GetChecksum(), aBCOA); nCrc = rtl_crc32(nCrc, aBCOA, BITMAP_CHECKSUM_SIZE); Int32ToSVBT32(pAct->GetDestPoint().X(), aBT32); @@ -1128,11 +1128,11 @@ void SvmWriter::BmpExScaleHandler(const MetaBmpExScaleAction* pAction) void SvmWriter::BmpExScalePartHandler(const MetaBmpExScalePartAction* pAction) { - if (!pAction->GetBitmapEx().GetBitmap().IsEmpty()) + if (!pAction->GetBitmap().CreateColorBitmap().IsEmpty()) { mrStream.WriteUInt16(static_cast<sal_uInt16>(pAction->GetType())); VersionCompatWrite aCompat(mrStream, 1); - WriteDIBBitmapEx(pAction->GetBitmapEx(), mrStream); + WriteDIBBitmapEx(pAction->GetBitmap(), mrStream); TypeSerializer aSerializer(mrStream); aSerializer.writePoint(pAction->GetDestPoint()); aSerializer.writeSize(pAction->GetDestSize()); diff --git a/vcl/source/filter/wmf/emfwr.cxx b/vcl/source/filter/wmf/emfwr.cxx index 6f8efa90aedd..96e813d68b73 100644 --- a/vcl/source/filter/wmf/emfwr.cxx +++ b/vcl/source/filter/wmf/emfwr.cxx @@ -28,6 +28,7 @@ #include <tools/stream.hxx> #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolypolygon.hxx> +#include <vcl/alpha.hxx> #include <vcl/lineinfo.hxx> #include <vcl/dibtools.hxx> #include <vcl/metaact.hxx> @@ -1322,13 +1323,13 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) case MetaActionType::BMPEXSCALEPART: { const MetaBmpExScalePartAction* pA = static_cast<const MetaBmpExScalePartAction*>(pAction); - BitmapEx aBmpEx( pA->GetBitmapEx() ); + Bitmap aBmpEx( pA->GetBitmap() ); aBmpEx.Crop( tools::Rectangle( pA->GetSrcPoint(), pA->GetSrcSize() ) ); - Bitmap aBmp( aBmpEx.GetBitmap() ); - AlphaMask aMsk( aBmpEx.GetAlphaMask() ); + Bitmap aBmp( aBmpEx.CreateColorBitmap() ); - if( !aMsk.IsEmpty() ) + if( aBmpEx.HasAlpha() ) { + AlphaMask aMsk( aBmpEx.CreateAlphaMask() ); aBmp.Replace( aMsk, COL_WHITE ); ImplWriteBmpRecord( aMsk.GetBitmap(), pA->GetDestPoint(), pA->GetDestSize(), WIN_SRCPAINT ); ImplWriteBmpRecord( aBmp, pA->GetDestPoint(), pA->GetDestSize(), WIN_SRCAND ); diff --git a/vcl/source/filter/wmf/wmfwr.cxx b/vcl/source/filter/wmf/wmfwr.cxx index 5777e33a0c81..f076917131aa 100644 --- a/vcl/source/filter/wmf/wmfwr.cxx +++ b/vcl/source/filter/wmf/wmfwr.cxx @@ -31,6 +31,7 @@ #include <tools/tenccvt.hxx> #include <tools/fract.hxx> #include <tools/stream.hxx> +#include <vcl/alpha.hxx> #include <vcl/dibtools.hxx> #include <vcl/metaact.hxx> #include <vcl/FilterConfigItem.hxx> @@ -1278,13 +1279,13 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) case MetaActionType::BMPEXSCALEPART: { const MetaBmpExScalePartAction* pA = static_cast<const MetaBmpExScalePartAction*>(pMA); - BitmapEx aBmpEx( pA->GetBitmapEx() ); + Bitmap aBmpEx( pA->GetBitmap() ); aBmpEx.Crop( tools::Rectangle( pA->GetSrcPoint(), pA->GetSrcSize() ) ); - Bitmap aBmp( aBmpEx.GetBitmap() ); - AlphaMask aMsk( aBmpEx.GetAlphaMask() ); + Bitmap aBmp( aBmpEx.CreateColorBitmap() ); - if( !aMsk.IsEmpty() ) + if( aBmpEx.HasAlpha() ) { + AlphaMask aMsk( aBmpEx.CreateAlphaMask() ); aBmp.Replace( aMsk, COL_WHITE ); WMFRecord_StretchDIB( pA->GetDestPoint(), pA->GetDestSize(), aMsk.GetBitmap(), W_SRCPAINT ); WMFRecord_StretchDIB( pA->GetDestPoint(), pA->GetDestSize(), aBmp, W_SRCAND ); diff --git a/vcl/source/gdi/gdimetafiletools.cxx b/vcl/source/gdi/gdimetafiletools.cxx index 2382ac636d6d..624437d3a35c 100644 --- a/vcl/source/gdi/gdimetafiletools.cxx +++ b/vcl/source/gdi/gdimetafiletools.cxx @@ -899,16 +899,16 @@ void clipMetafileContentAgainstOwnRegions(GDIMetaFile& rSource) case MetaActionType::BMPEXSCALEPART : { const MetaBmpExScalePartAction* pA = static_cast< const MetaBmpExScalePartAction* >(pAction); - const BitmapEx& rBitmapEx = pA->GetBitmapEx(); + const Bitmap& rBitmap = pA->GetBitmap(); - if(rBitmapEx.IsEmpty()) + if(rBitmap.IsEmpty()) { // empty content bDone = true; } else { - BitmapEx aCroppedBitmapEx(rBitmapEx); + Bitmap aCroppedBitmap(rBitmap); const tools::Rectangle aCropRectangle(pA->GetSrcPoint(), pA->GetSrcSize()); if(aCropRectangle.IsEmpty()) @@ -918,12 +918,12 @@ void clipMetafileContentAgainstOwnRegions(GDIMetaFile& rSource) } else { - aCroppedBitmapEx.Crop(aCropRectangle); + aCroppedBitmap.Crop(aCropRectangle); bDone = handleBitmapContent( aClips.back(), pA->GetDestPoint(), pA->GetDestSize(), - aCroppedBitmapEx, + aCroppedBitmap, aTarget); } } diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index 90f46dfb2db2..68ae6d37312d 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -1049,12 +1049,12 @@ void GDIMetaFile::Rotate( Degree10 nAngle10 ) MetaBmpExScalePartAction* pAct = static_cast<MetaBmpExScalePartAction*>(pAction); tools::Polygon aBmpPoly( ImplGetRotatedPolygon( tools::Polygon(tools::Rectangle( pAct->GetDestPoint(), pAct->GetDestSize() )), aRotAnchor, aRotOffset, fSin, fCos ) ); tools::Rectangle aBmpRect( aBmpPoly.GetBoundRect() ); - BitmapEx aBmpEx( pAct->GetBitmapEx() ); + Bitmap aBmp( pAct->GetBitmap() ); - aBmpEx.Crop( tools::Rectangle( pAct->GetSrcPoint(), pAct->GetSrcSize() ) ); - aBmpEx.Rotate( nAngle10, COL_TRANSPARENT ); + aBmp.Crop( tools::Rectangle( pAct->GetSrcPoint(), pAct->GetSrcSize() ) ); + aBmp.Rotate( nAngle10, COL_TRANSPARENT ); - aMtf.AddAction( new MetaBmpExScaleAction( aBmpRect.TopLeft(), aBmpRect.GetSize(), Bitmap(aBmpEx) ) ); + aMtf.AddAction( new MetaBmpExScaleAction( aBmpRect.TopLeft(), aBmpRect.GetSize(), aBmp ) ); } break; @@ -1967,7 +1967,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol MetaBmpExScalePartAction* pAct = static_cast<MetaBmpExScalePartAction*>(pAction); aMtf.push_back( new MetaBmpExScalePartAction( pAct->GetDestPoint(), pAct->GetDestSize(), pAct->GetSrcPoint(), pAct->GetSrcSize(), - BitmapEx(pFncBmp( Bitmap(pAct->GetBitmapEx()), pBmpParam )) ) + pFncBmp( pAct->GetBitmap(), pBmpParam ) ) ); } break; @@ -2227,7 +2227,7 @@ sal_uLong GDIMetaFile::GetSizeBytes() const case MetaActionType::BMPEX: nSizeBytes += static_cast<MetaBmpExAction*>( pAction )->GetBitmap().GetSizeBytes(); break; case MetaActionType::BMPEXSCALE: nSizeBytes += static_cast<MetaBmpExScaleAction*>( pAction )->GetBitmap().GetSizeBytes(); break; - case MetaActionType::BMPEXSCALEPART: nSizeBytes += static_cast<MetaBmpExScalePartAction*>( pAction )->GetBitmapEx().GetSizeBytes(); break; + case MetaActionType::BMPEXSCALEPART: nSizeBytes += static_cast<MetaBmpExScalePartAction*>( pAction )->GetBitmap().GetSizeBytes(); break; case MetaActionType::MASK: nSizeBytes += static_cast<MetaMaskAction*>( pAction )->GetBitmap().GetSizeBytes(); break; case MetaActionType::MASKSCALE: nSizeBytes += static_cast<MetaMaskScaleAction*>( pAction )->GetBitmap().GetSizeBytes(); break; diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx index b9aaf9299d39..6f7858ea8f82 100644 --- a/vcl/source/gdi/metaact.cxx +++ b/vcl/source/gdi/metaact.cxx @@ -1145,9 +1145,9 @@ MetaBmpExScalePartAction::~MetaBmpExScalePartAction() MetaBmpExScalePartAction::MetaBmpExScalePartAction( const Point& rDstPt, const Size& rDstSz, const Point& rSrcPt, const Size& rSrcSz, - const BitmapEx& rBmpEx ) : + const Bitmap& rBmp ) : MetaAction ( MetaActionType::BMPEXSCALEPART ), - maBmpEx ( rBmpEx ), + maBmp ( rBmp ), maDstPt ( rDstPt ), maDstSz ( rDstSz ), maSrcPt ( rSrcPt ), @@ -1159,7 +1159,7 @@ void MetaBmpExScalePartAction::Execute( OutputDevice* pOut ) if (!AllowRect(pOut->LogicToPixel(tools::Rectangle(maDstPt, maDstSz)))) return; - pOut->DrawBitmapEx( maDstPt, maDstSz, maSrcPt, maSrcSz, maBmpEx ); + pOut->DrawBitmapEx( maDstPt, maDstSz, maSrcPt, maSrcSz, maBmp ); } rtl::Reference<MetaAction> MetaBmpExScalePartAction::Clone() const diff --git a/vcl/source/gdi/mtfxmldump.cxx b/vcl/source/gdi/mtfxmldump.cxx index 2d01d5224742..b20b01cc330f 100644 --- a/vcl/source/gdi/mtfxmldump.cxx +++ b/vcl/source/gdi/mtfxmldump.cxx @@ -332,14 +332,6 @@ OString convertLineStyleToString(const MetaActionType nActionType) return ""_ostr; } -OUString convertBitmapExTransparentType(BitmapEx const & rBitmapEx) -{ - if (rBitmapEx.IsAlpha()) - return u"bitmap"_ustr; - else - return u"none"_ustr; -} - OUString convertBitmapTransparentType(Bitmap const & rBitmap) { if (rBitmap.HasAlpha()) @@ -1027,7 +1019,7 @@ void MetafileXmlDump::writeXml(const GDIMetaFile& rMetaFile, tools::XmlWriter& r case MetaActionType::BMPEXSCALEPART: { auto pMeta = static_cast<MetaBmpExScalePartAction*>(pAction); - Bitmap aBitmap = pMeta->GetBitmapEx().GetBitmap(); + Bitmap aBitmap = pMeta->GetBitmap().CreateColorBitmap(); rWriter.startElement(sCurrentElementTag); rWriter.attribute("destx", pMeta->GetDestPoint().X()); rWriter.attribute("desty", pMeta->GetDestPoint().Y()); @@ -1037,7 +1029,7 @@ void MetafileXmlDump::writeXml(const GDIMetaFile& rMetaFile, tools::XmlWriter& r rWriter.attribute("srcy", pMeta->GetSrcPoint().Y()); rWriter.attribute("srcwidth", pMeta->GetSrcSize().Width()); rWriter.attribute("srcheight", pMeta->GetSrcSize().Height()); - rWriter.attribute("transparenttype", convertBitmapExTransparentType(pMeta->GetBitmapEx())); + rWriter.attribute("transparenttype", convertBitmapTransparentType(pMeta->GetBitmap())); writeBitmap(rWriter, aBitmap); rWriter.endElement(); } diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx index 3a3a915556d9..607c3a21b642 100644 --- a/vcl/source/gdi/pdfwriter_impl2.cxx +++ b/vcl/source/gdi/pdfwriter_impl2.cxx @@ -785,10 +785,10 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa { const MetaBmpExScalePartAction* pA = static_cast<const MetaBmpExScalePartAction*>(pAction); - BitmapEx aBitmapEx( pA->GetBitmapEx() ); + Bitmap aBitmapEx( pA->GetBitmap() ); aBitmapEx.Crop( tools::Rectangle( pA->GetSrcPoint(), pA->GetSrcSize() ) ); Graphic aGraphic = i_pOutDevData ? i_pOutDevData->GetCurrentGraphic() : Graphic(); - implWriteBitmapEx( pA->GetDestPoint(), pA->GetDestSize(), Bitmap(aBitmapEx), aGraphic, pDummyVDev, i_rContext ); + implWriteBitmapEx( pA->GetDestPoint(), pA->GetDestSize(), aBitmapEx, aGraphic, pDummyVDev, i_rContext ); } break; diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx index cd26bd0bd871..9b89bc39c462 100644 --- a/vcl/source/gdi/print.cxx +++ b/vcl/source/gdi/print.cxx @@ -190,30 +190,29 @@ bool Printer::TransformAndReduceBitmapExToTargetRange( void Printer::DrawDeviceBitmapEx( const Point& rDestPt, const Size& rDestSize, const Point& rSrcPtPixel, const Size& rSrcSizePixel, - BitmapEx& rBmpEx ) + Bitmap& rBmp ) { #ifdef MACOSX // tdf#164354 draw alpha bitmaps directly to print graphics on macOS // On macOS, there are no known problems drawing semi-transparent // bitmaps so just draw the alpha bitmap directly without any blending. - AlphaMask aAlpha = rBmpEx.GetAlphaMask(); + AlphaMask aAlpha = rBmp.CreateAlphaMask(); aAlpha.Invert(); - DrawDeviceAlphaBitmap( rBmpEx.GetBitmap(), aAlpha, rDestPt, rDestSize, rSrcPtPixel, rSrcSizePixel ); + DrawDeviceAlphaBitmap( rBmp.CreateColorBitmap(), aAlpha, rDestPt, rDestSize, rSrcPtPixel, rSrcSizePixel ); aAlpha.Invert(); #else - if( rBmpEx.IsAlpha() ) + if( rBmp.HasAlpha() ) { // #107169# For true alpha bitmaps, no longer masking the // bitmap, but perform a full alpha blend against a white // background here. - Bitmap aBmp( rBmpEx.GetBitmap() ); - aBmp.Blend( rBmpEx.GetAlphaMask(), COL_WHITE ); + Bitmap aBmp( rBmp.CreateColorBitmap() ); + aBmp.Blend( rBmp.CreateAlphaMask(), COL_WHITE ); DrawBitmap( rDestPt, rDestSize, rSrcPtPixel, rSrcSizePixel, aBmp ); } else { - const Bitmap& aBmp( rBmpEx.GetBitmap() ); - ImplPrintTransparent( aBmp, rDestPt, rDestSize, rSrcPtPixel, rSrcSizePixel ); + ImplPrintTransparent( rBmp, rDestPt, rDestSize, rSrcPtPixel, rSrcSizePixel ); } #endif } diff --git a/vcl/source/outdev/bitmapex.cxx b/vcl/source/outdev/bitmapex.cxx index c27a5c060443..028ff4fe21cf 100644 --- a/vcl/source/outdev/bitmapex.cxx +++ b/vcl/source/outdev/bitmapex.cxx @@ -165,23 +165,23 @@ void OutputDevice::DrawBitmapEx( const Point& rDestPt, const Size& rDestSize, return; } - BitmapEx aBmpEx(vcl::drawmode::GetBitmapEx(rBitmapEx, GetDrawMode())); + Bitmap aBmp(vcl::drawmode::GetBitmapEx(rBitmapEx, GetDrawMode())); if (mpMetaFile) { switch(nAction) { case MetaActionType::BMPEX: - mpMetaFile->AddAction(new MetaBmpExAction(rDestPt, Bitmap(aBmpEx))); + mpMetaFile->AddAction(new MetaBmpExAction(rDestPt, aBmp)); break; case MetaActionType::BMPEXSCALE: - mpMetaFile->AddAction(new MetaBmpExScaleAction(rDestPt, rDestSize, Bitmap(aBmpEx))); + mpMetaFile->AddAction(new MetaBmpExScaleAction(rDestPt, rDestSize, aBmp)); break; case MetaActionType::BMPEXSCALEPART: mpMetaFile->AddAction(new MetaBmpExScalePartAction(rDestPt, rDestSize, - rSrcPtPixel, rSrcSizePixel, aBmpEx)); + rSrcPtPixel, rSrcSizePixel, aBmp)); break; default: @@ -201,7 +201,7 @@ void OutputDevice::DrawBitmapEx( const Point& rDestPt, const Size& rDestSize, if (mbOutputClipped) return; - DrawDeviceBitmapEx(rDestPt, rDestSize, rSrcPtPixel, rSrcSizePixel, aBmpEx); + DrawDeviceBitmapEx(rDestPt, rDestSize, rSrcPtPixel, rSrcSizePixel, aBmp); } void OutputDevice::DrawBitmapEx( const Point& rDestPt, const Size& rDestSize, @@ -225,23 +225,23 @@ void OutputDevice::DrawBitmapEx( const Point& rDestPt, const Size& rDestSize, return; } - BitmapEx aBmpEx(vcl::drawmode::GetBitmapEx(BitmapEx(rBitmap), GetDrawMode())); + Bitmap aBmp(vcl::drawmode::GetBitmapEx(BitmapEx(rBitmap), GetDrawMode())); if (mpMetaFile) { switch(nAction) { case MetaActionType::BMPEX: - mpMetaFile->AddAction(new MetaBmpExAction(rDestPt, Bitmap(aBmpEx))); + mpMetaFile->AddAction(new MetaBmpExAction(rDestPt, aBmp)); break; case MetaActionType::BMPEXSCALE: - mpMetaFile->AddAction(new MetaBmpExScaleAction(rDestPt, rDestSize, Bitmap(aBmpEx))); + mpMetaFile->AddAction(new MetaBmpExScaleAction(rDestPt, rDestSize, aBmp)); break; case MetaActionType::BMPEXSCALEPART: mpMetaFile->AddAction(new MetaBmpExScalePartAction(rDestPt, rDestSize, - rSrcPtPixel, rSrcSizePixel, aBmpEx)); + rSrcPtPixel, rSrcSizePixel, aBmp)); break; default: @@ -261,23 +261,23 @@ void OutputDevice::DrawBitmapEx( const Point& rDestPt, const Size& rDestSize, if (mbOutputClipped) return; - DrawDeviceBitmapEx(rDestPt, rDestSize, rSrcPtPixel, rSrcSizePixel, aBmpEx); + DrawDeviceBitmapEx(rDestPt, rDestSize, rSrcPtPixel, rSrcSizePixel, aBmp); } void OutputDevice::DrawDeviceBitmapEx( const Point& rDestPt, const Size& rDestSize, const Point& rSrcPtPixel, const Size& rSrcSizePixel, - BitmapEx& rBitmapEx ) + Bitmap& rBitmap ) { assert(!is_double_buffered_window()); - if (rBitmapEx.IsAlpha()) + if (rBitmap.HasAlpha()) { - DrawDeviceAlphaBitmap(rBitmapEx.GetBitmap(), rBitmapEx.GetAlphaMask(), + DrawDeviceAlphaBitmap(rBitmap.CreateColorBitmap(), rBitmap.CreateAlphaMask(), rDestPt, rDestSize, rSrcPtPixel, rSrcSizePixel); return; } - if (rBitmapEx.IsEmpty()) + if (rBitmap.IsEmpty()) return; SalTwoRect aPosAry(rSrcPtPixel.X(), rSrcPtPixel.Y(), rSrcSizePixel.Width(), @@ -286,17 +286,17 @@ void OutputDevice::DrawDeviceBitmapEx( const Point& rDestPt, const Size& rDestSi ImplLogicWidthToDevicePixel(rDestSize.Width()), ImplLogicHeightToDevicePixel(rDestSize.Height())); - const BmpMirrorFlags nMirrFlags = AdjustTwoRect(aPosAry, rBitmapEx.GetSizePixel()); + const BmpMirrorFlags nMirrFlags = AdjustTwoRect(aPosAry, rBitmap.GetSizePixel()); if (!(aPosAry.mnSrcWidth && aPosAry.mnSrcHeight && aPosAry.mnDestWidth && aPosAry.mnDestHeight)) return; if (nMirrFlags != BmpMirrorFlags::NONE) - rBitmapEx.Mirror(nMirrFlags); + rBitmap.Mirror(nMirrFlags); - const SalBitmap* pSalSrcBmp = rBitmapEx.ImplGetBitmapSalBitmap().get(); + const SalBitmap* pSalSrcBmp = rBitmap.ImplGetSalBitmap().get(); - assert(!rBitmapEx.maAlphaMask.GetBitmap().ImplGetSalBitmap() + assert(!rBitmap.HasAlpha() && "I removed some code here that will need to be restored"); mpGraphics->DrawBitmap(aPosAry, *pSalSrcBmp, *this);