svx/source/xoutdev/_xoutbmp.cxx |   40 +++++++++++++++++-----------------------
 1 file changed, 17 insertions(+), 23 deletions(-)

New commits:
commit a0f467dca6311707ae96b529b7073eb826f49c4e
Author:     Noel Grandin <[email protected]>
AuthorDate: Fri Oct 24 21:09:43 2025 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Sat Oct 25 09:23:53 2025 +0200

    no need to use a mask here
    
    we can generate the bitmap in one draw operation
    
    Change-Id: I769e4ea129ce13208dd960ab37a0b4eeb421815c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192962
    Reviewed-by: Noel Grandin <[email protected]>
    Tested-by: Jenkins

diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx
index a3632ccdb81b..19003b047704 100644
--- a/svx/source/xoutdev/_xoutbmp.cxx
+++ b/svx/source/xoutdev/_xoutbmp.cxx
@@ -294,38 +294,32 @@ ErrCode XOutBitmap::WriteGraphic( const Graphic& 
rGraphic, OUString& rFileName,
         }
         else if (pMtfSize_100TH_MM && (rGraphic.GetType() != 
GraphicType::Bitmap))
         {
-            ScopedVclPtrInstance< VirtualDevice > pVDev;
-            const Size aSize(pVDev->LogicToPixel(*pMtfSize_100TH_MM, 
MapMode(MapUnit::Map100thMM)));
-
-            if( pVDev->SetOutputSizePixel( aSize ) )
+            if (bWriteTransGrf)
             {
-                if (bWriteTransGrf)
-                {
-                    const Wallpaper aWallpaper( pVDev->GetBackground() );
-                    const Point     aPt;
-
-                    pVDev->SetBackground( Wallpaper( COL_BLACK ) );
-                    pVDev->Erase();
-                    rGraphic.Draw(*pVDev, aPt, aSize);
-
-                    const Bitmap aBitmap( pVDev->GetBitmap( aPt, aSize ) );
+                ScopedVclPtrInstance< VirtualDevice > 
pVDev(DeviceFormat::WITH_ALPHA);
+                const Size aSize(pVDev->LogicToPixel(*pMtfSize_100TH_MM, 
MapMode(MapUnit::Map100thMM)));
 
-                    pVDev->SetBackground( aWallpaper );
-                    pVDev->Erase();
-                    rGraphic.Draw(*pVDev, aPt, aSize);
-
-                    pVDev->SetRasterOp( RasterOp::Xor );
-                    pVDev->DrawBitmap( aPt, aSize, aBitmap );
-                    aGraphic = Bitmap( aBitmap, pVDev->GetBitmap( aPt, aSize ) 
);
+                if( pVDev->SetOutputSizePixel( aSize ) )
+                {
+                    rGraphic.Draw(*pVDev, Point(), aSize);
+                    aGraphic = pVDev->GetBitmap( Point(), aSize );
                 }
                 else
+                    aGraphic = rGraphic.GetBitmap();
+            }
+            else
+            {
+                ScopedVclPtrInstance< VirtualDevice > pVDev;
+                const Size aSize(pVDev->LogicToPixel(*pMtfSize_100TH_MM, 
MapMode(MapUnit::Map100thMM)));
+
+                if( pVDev->SetOutputSizePixel( aSize ) )
                 {
                     rGraphic.Draw(*pVDev, Point(), aSize);
                     aGraphic = pVDev->GetBitmap(Point(), aSize);
                 }
+                else
+                    aGraphic = rGraphic.GetBitmap();
             }
-            else
-                aGraphic = rGraphic.GetBitmap();
         }
         else
             aGraphic = rGraphic.GetBitmap();

Reply via email to