emfio/source/reader/emfreader.cxx | 14 +++++++------- emfio/source/reader/mtftools.cxx | 28 ++++++++++++++-------------- 2 files changed, 21 insertions(+), 21 deletions(-)
New commits: commit f6a200a9702bab97345b0ce465af431ba2ce9806 Author: Noel Grandin <[email protected]> AuthorDate: Sat Aug 30 20:21:29 2025 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Sat Aug 30 22:01:49 2025 +0200 BitmapEx->Bitmap in emfio now that Bitmap supports transparency Change-Id: I6af3dce6d6dcb79aebb7aaa9a9dbebf0264b493a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190417 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> diff --git a/emfio/source/reader/emfreader.cxx b/emfio/source/reader/emfreader.cxx index af552ccca946..ee8d1b756f0b 100644 --- a/emfio/source/reader/emfreader.cxx +++ b/emfio/source/reader/emfreader.cxx @@ -1594,8 +1594,8 @@ namespace emfio aTmp.Seek( 0 ); - // prepare to read and fill BitmapEx - BitmapEx aBitmapEx; + // prepare to read and fill Bitmap + Bitmap aBitmapEx; if(bReadAlpha) { @@ -1604,7 +1604,7 @@ namespace emfio if(ReadDIBV5(aBitmap, aAlpha, aTmp)) { - aBitmapEx = BitmapEx(aBitmap, aAlpha); + aBitmapEx = Bitmap(aBitmap, aAlpha); } } else @@ -1616,14 +1616,14 @@ namespace emfio if(0xff != aFunc.aSrcConstantAlpha) { // add const alpha channel - aBitmapEx = BitmapEx( + aBitmapEx = Bitmap( aBitmap, AlphaMask(aBitmap.GetSizePixel(), &aFunc.aSrcConstantAlpha)); } else { // just use Bitmap - aBitmapEx = BitmapEx(aBitmap); + aBitmapEx = aBitmap; } } } @@ -1655,11 +1655,11 @@ namespace emfio SvFileStream aNew(sDumpPath + "metafile_content.png", StreamMode::WRITE | StreamMode::TRUNC); vcl::PngImageWriter aPNGWriter(aNew); - aPNGWriter.write(Bitmap(aBitmapEx)); + aPNGWriter.write(aBitmapEx); } } #endif - maBmpSaveList.emplace_back(Bitmap(aBitmapEx), aRect, SRCAND|SRCINVERT); + maBmpSaveList.emplace_back(aBitmapEx, aRect, SRCAND|SRCINVERT); } } } diff --git a/emfio/source/reader/mtftools.cxx b/emfio/source/reader/mtftools.cxx index dd1a4716c484..f5467f88c923 100644 --- a/emfio/source/reader/mtftools.cxx +++ b/emfio/source/reader/mtftools.cxx @@ -2008,8 +2008,8 @@ namespace emfio { Bitmap aMask( pSave->aBmp.CreateColorBitmap() ); aMask.Invert(); - BitmapEx aBmpEx( pSave2->aBmp.CreateColorBitmap(), aMask ); - ImplDrawBitmap( aPos, aSize, Bitmap(aBmpEx) ); + Bitmap aBmpEx( pSave2->aBmp.CreateColorBitmap(), aMask ); + ImplDrawBitmap( aPos, aSize, aBmpEx ); bDrawn = true; i++; } @@ -2019,8 +2019,8 @@ namespace emfio else if ( ( nWinRop == SRCAND ) && ( pSave2->nWinRop == SRCPAINT ) ) { const Bitmap aMask( pSave->aBmp.CreateColorBitmap() ); - BitmapEx aBmpEx( pSave2->aBmp.CreateColorBitmap(), aMask ); - ImplDrawBitmap( aPos, aSize, Bitmap(aBmpEx) ); + Bitmap aBmpEx( pSave2->aBmp.CreateColorBitmap(), aMask ); + ImplDrawBitmap( aPos, aSize, aBmpEx ); bDrawn = true; i++; } @@ -2028,8 +2028,8 @@ namespace emfio else if ( ( nWinRop == SRCAND ) && ( pSave2->nWinRop == SRCINVERT ) ) { const Bitmap aMask( pSave->aBmp.CreateColorBitmap() ); - BitmapEx aBmpEx( pSave2->aBmp.CreateColorBitmap(), aMask ); - ImplDrawBitmap( aPos, aSize, Bitmap(aBmpEx) ); + Bitmap aBmpEx( pSave2->aBmp.CreateColorBitmap(), aMask ); + ImplDrawBitmap( aPos, aSize, aBmpEx ); bDrawn = true; i++; } @@ -2059,8 +2059,8 @@ namespace emfio SetRasterOp( WMFRasterOp::CopyPen ); Bitmap aMask( aBitmap ); aMask.Invert(); - BitmapEx aBmpEx( aBitmap, aMask ); - ImplDrawBitmap( aPos, aSize, Bitmap(aBmpEx) ); + Bitmap aBmpEx( aBitmap, aMask ); + ImplDrawBitmap( aPos, aSize, aBmpEx ); if ( nOperation == 0x1 ) { SetRasterOp( WMFRasterOp::Not ); @@ -2078,8 +2078,8 @@ namespace emfio aBitmap.Convert( BmpConversion::N24Bit ); aBitmap.Erase( maFillStyle.aFillColor ); } - BitmapEx aBmpEx( aBitmap, aMask ); - ImplDrawBitmap( aPos, aSize, Bitmap(aBmpEx) ); + Bitmap aBmpEx( aBitmap, aMask ); + ImplDrawBitmap( aPos, aSize, aBmpEx ); if ( nOperation == 0x7 ) { SetRasterOp( WMFRasterOp::Not ); @@ -2096,8 +2096,8 @@ namespace emfio SetRasterOp( WMFRasterOp::CopyPen ); Bitmap aMask( aBitmap ); aBitmap.Invert(); - BitmapEx aBmpEx( aBitmap, aMask ); - ImplDrawBitmap( aPos, aSize, Bitmap(aBmpEx) ); + Bitmap aBmpEx( aBitmap, aMask ); + ImplDrawBitmap( aPos, aSize, aBmpEx ); SetRasterOp( WMFRasterOp::XorPen ); ImplDrawBitmap( aPos, aSize, aBitmap ); if ( nOperation == 0xb ) @@ -2113,8 +2113,8 @@ namespace emfio { Bitmap aMask( aBitmap ); aMask.Invert(); - BitmapEx aBmpEx( aBitmap, aMask ); - ImplDrawBitmap( aPos, aSize, Bitmap(aBmpEx) ); + Bitmap aBmpEx( aBitmap, aMask ); + ImplDrawBitmap( aPos, aSize, aBmpEx ); SetRasterOp( WMFRasterOp::XorPen ); ImplDrawBitmap( aPos, aSize, aBitmap ); if ( nOperation == 0xd )
