canvas/qa/cppunit/canvastest.cxx                               |    2 
 canvas/source/cairo/cairo_devicehelper.cxx                     |    2 
 canvas/source/vcl/bitmapbackbuffer.cxx                         |    2 
 canvas/source/vcl/canvashelper.cxx                             |    6 
 canvas/source/vcl/canvashelper_texturefill.cxx                 |    2 
 canvas/source/vcl/devicehelper.cxx                             |    2 
 canvas/source/vcl/impltools.cxx                                |    4 
 canvas/source/vcl/spritedevicehelper.cxx                       |    2 
 canvas/source/vcl/spritehelper.cxx                             |    4 
 chart2/source/controller/sidebar/ChartColorPaletteControl.cxx  |    2 
 cppcanvas/source/mtfrenderer/transparencygroupaction.cxx       |    4 
 cui/source/dialogs/screenshotannotationdlg.cxx                 |    4 
 desktop/source/lib/init.cxx                                    |    2 
 drawinglayer/qa/unit/vclmetafileprocessor2d.cxx                |    2 
 drawinglayer/qa/unit/vclpixelprocessor2d.cxx                   |    2 
 drawinglayer/source/primitive2d/controlprimitive2d.cxx         |    2 
 include/vcl/bitmap.hxx                                         |    3 
 include/vcl/graph.hxx                                          |    1 
 include/vcl/image.hxx                                          |    1 
 include/vcl/outdev.hxx                                         |   24 ++
 include/vcl/qt/QtUtils.hxx                                     |    2 
 sc/source/ui/app/transobj.cxx                                  |    2 
 sc/source/ui/attrdlg/scdlgfact.cxx                             |    2 
 sd/source/ui/dlg/animobjs.cxx                                  |    2 
 sd/source/ui/dlg/sddlgfact.cxx                                 |    2 
 sd/source/ui/docshell/docshel2.cxx                             |    2 
 sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx |    2 
 sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx         |    2 
 sd/source/ui/table/TableDesignPane.cxx                         |    2 
 sd/source/ui/tools/PreviewRenderer.cxx                         |    6 
 sfx2/source/control/recentdocsviewitem.cxx                     |    2 
 sfx2/source/dialog/tabdlg.cxx                                  |    2 
 sfx2/source/doc/objcont.cxx                                    |    2 
 starmath/source/ElementsDockingWindow.cxx                      |    2 
 svtools/source/control/ctrlbox.cxx                             |    2 
 svx/source/dialog/ThemeDialog.cxx                              |    2 
 svx/source/dialog/dialcontrol.cxx                              |    4 
 svx/source/dialog/frmsel.cxx                                   |    2 
 svx/source/svdraw/svdhdl.cxx                                   |    2 
 svx/source/svdraw/svdoashp.cxx                                 |    2 
 svx/source/tbxctrls/StylesPreviewWindow.cxx                    |    2 
 svx/source/tbxctrls/colrctrl.cxx                               |    2 
 svx/source/tbxctrls/fontworkgallery.cxx                        |    2 
 svx/source/tbxctrls/itemwin.cxx                                |    2 
 svx/source/tbxctrls/linectrl.cxx                               |    8 
 svx/source/tbxctrls/tbcontrl.cxx                               |    2 
 svx/source/unodraw/UnoGraphicExporter.cxx                      |    2 
 svx/source/xoutdev/xattrbmp.cxx                                |    2 
 svx/source/xoutdev/xtabbtmp.cxx                                |    2 
 svx/source/xoutdev/xtabdash.cxx                                |    2 
 svx/source/xoutdev/xtabgrdt.cxx                                |    2 
 svx/source/xoutdev/xtabhtch.cxx                                |    2 
 svx/source/xoutdev/xtablend.cxx                                |    2 
 svx/source/xoutdev/xtabptrn.cxx                                |    2 
 sw/source/core/frmedt/fecopy.cxx                               |    2 
 sw/source/uibase/sidebar/StylePresetsPanel.cxx                 |    2 
 test/source/screenshot_test.cxx                                |    2 
 toolkit/source/awt/vclxdevice.cxx                              |    4 
 toolkit/source/controls/table/gridtablerenderer.cxx            |    2 
 vcl/backendtest/outputdevice/bitmap.cxx                        |    2 
 vcl/backendtest/outputdevice/polyline_b2d.cxx                  |    2 
 vcl/jsdialog/jsdialogbuilder.cxx                               |    2 
 vcl/qa/cppunit/BackendTest.cxx                                 |    4 
 vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx               |    6 
 vcl/qa/cppunit/cjktext.cxx                                     |    2 
 vcl/qa/cppunit/svm/svmtest.cxx                                 |    4 
 vcl/qa/cppunit/text.cxx                                        |    2 
 vcl/source/app/salvtables.cxx                                  |    4 
 vcl/source/bitmap/BitmapEx.cxx                                 |    4 
 vcl/source/filter/graphicfilter.cxx                            |    2 
 vcl/source/gdi/gdimtf.cxx                                      |    2 
 vcl/source/gdi/graph.cxx                                       |    5 
 vcl/source/gdi/impgraph.cxx                                    |    2 
 vcl/source/gdi/pdfwriter_impl2.cxx                             |    2 
 vcl/source/image/Image.cxx                                     |    5 
 vcl/source/image/ImplImage.cxx                                 |    2 
 vcl/source/outdev/bitmapex.cxx                                 |   95 
+++++++++-
 vcl/source/outdev/outdev.cxx                                   |    2 
 vcl/source/outdev/textline.cxx                                 |    2 
 vcl/source/outdev/transparent.cxx                              |    4 
 vcl/source/outdev/wallpaper.cxx                                |    2 
 vcl/source/window/layout.cxx                                   |    2 
 vcl/source/window/paint.cxx                                    |    2 
 vcl/source/window/printdlg.cxx                                 |    2 
 vcl/unx/gtk3/gtkinst.cxx                                       |    2 
 vcl/workben/vcldemo.cxx                                        |    2 
 86 files changed, 226 insertions(+), 106 deletions(-)

New commits:
commit e435c0749b9a66e6e8c77b969c976ad4030b60e0
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Fri Jul 25 15:06:07 2025 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri Jul 25 22:34:31 2025 +0200

    drop OutputDevice::GetBitmapEx in favour of returning Bitmap
    
    as part of the project of removing BitmapEx in favour of Bitmap, now that 
we can store RGBA data in Bitmap.
    
    This mostly just moves the Bitmap->BitmapEx from inside OutputDevice to the 
various call sites,
    from where I can make further improvements.
    
    Change-Id: Id5366c1eb5ebca98fee7c974737552f4a09a5c2f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188341
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/canvas/qa/cppunit/canvastest.cxx b/canvas/qa/cppunit/canvastest.cxx
index b65b983f4039..b66a1ad1552c 100644
--- a/canvas/qa/cppunit/canvastest.cxx
+++ b/canvas/qa/cppunit/canvastest.cxx
@@ -41,7 +41,7 @@ class CanvasTest : public test::BootstrapFixture
     {
         if (mbExportBitmap)
         {
-            BitmapEx aBitmapEx(device->GetBitmapEx(Point(0, 0), 
device->GetOutputSizePixel()));
+            BitmapEx aBitmapEx(device->GetBitmap(Point(0, 0), 
device->GetOutputSizePixel()));
             SvFileStream aStream(filename, StreamMode::WRITE | 
StreamMode::TRUNC);
             GraphicFilter::GetGraphicFilter().compressAsPNG(aBitmapEx, 
aStream);
         }
diff --git a/canvas/source/cairo/cairo_devicehelper.cxx 
b/canvas/source/cairo/cairo_devicehelper.cxx
index 3d3f7ef8301c..6e86b836591a 100644
--- a/canvas/source/cairo/cairo_devicehelper.cxx
+++ b/canvas/source/cairo/cairo_devicehelper.cxx
@@ -230,7 +230,7 @@ namespace cairocanvas
         const ::Point aEmptyPoint;
         bool bOldMap( mpRefDevice->IsMapModeEnabled() );
         mpRefDevice->EnableMapMode( false );
-        const ::BitmapEx aTempBitmap(mpRefDevice->GetBitmapEx(aEmptyPoint, 
mpRefDevice->GetOutputSizePixel()));
+        const ::BitmapEx aTempBitmap(mpRefDevice->GetBitmap(aEmptyPoint, 
mpRefDevice->GetOutputSizePixel()));
         WriteDIB(aTempBitmap, aStream, false);
         mpRefDevice->EnableMapMode( bOldMap );
 
diff --git a/canvas/source/vcl/bitmapbackbuffer.cxx 
b/canvas/source/vcl/bitmapbackbuffer.cxx
index 3766276f3b53..95f36c744f14 100644
--- a/canvas/source/vcl/bitmapbackbuffer.cxx
+++ b/canvas/source/vcl/bitmapbackbuffer.cxx
@@ -78,7 +78,7 @@ namespace vclcanvas
             mpVDev->EnableMapMode( false );
             mpVDev->SetAntialiasing( AntialiasingFlags::Enable );
             const Point aEmptyPoint;
-            *maBitmap = mpVDev->GetBitmapEx( aEmptyPoint,
+            *maBitmap = mpVDev->GetBitmap( aEmptyPoint,
                                              mpVDev->GetOutputSizePixel() );
         }
 
diff --git a/canvas/source/vcl/canvashelper.cxx 
b/canvas/source/vcl/canvashelper.cxx
index a35a93bc1dba..3c798c8a7158 100644
--- a/canvas/source/vcl/canvashelper.cxx
+++ b/canvas/source/vcl/canvashelper.cxx
@@ -922,7 +922,7 @@ namespace vclcanvas
         const Point aEmptyPoint(0,0);
         const Size  aBmpSize( rOutDev.GetOutputSizePixel() );
 
-        BitmapEx aBitmap( rOutDev.GetBitmapEx(aEmptyPoint, aBmpSize) );
+        BitmapEx aBitmap( rOutDev.GetBitmap(aEmptyPoint, aBmpSize) );
 
         aBitmap.Scale( vcl::unotools::sizeFromRealSize2D(newSize),
                        beFast ? BmpScaleFlag::Default : 
BmpScaleFlag::BestQuality );
@@ -948,8 +948,8 @@ namespace vclcanvas
         rOutDev.EnableMapMode( false );
         rOutDev.SetAntialiasing( AntialiasingFlags::Enable );
 
-        Bitmap aBitmap( rOutDev.GetBitmapEx(aRect.TopLeft(),
-                                          aRect.GetSize()).GetBitmap() );
+        Bitmap aBitmap( BitmapEx(rOutDev.GetBitmap(aRect.TopLeft(),
+                                          aRect.GetSize())).GetBitmap() );
 
         BitmapScopedReadAccess pReadAccess( aBitmap );
 
diff --git a/canvas/source/vcl/canvashelper_texturefill.cxx 
b/canvas/source/vcl/canvashelper_texturefill.cxx
index 2a1ec6b88c9a..1e4251ca0d3e 100644
--- a/canvas/source/vcl/canvashelper_texturefill.cxx
+++ b/canvas/source/vcl/canvashelper_texturefill.cxx
@@ -1003,7 +1003,7 @@ namespace vclcanvas
                             // target position.
                             const ::Point aEmptyPoint;
                             BitmapEx aContentBmp(
-                                pVDev->GetBitmapEx( aEmptyPoint,
+                                pVDev->GetBitmap( aEmptyPoint,
                                                  pVDev->GetOutputSizePixel() ) 
);
 
                             sal_uInt8 nCol( static_cast< sal_uInt8 >(
diff --git a/canvas/source/vcl/devicehelper.cxx 
b/canvas/source/vcl/devicehelper.cxx
index 40d2575f8883..42d45eb99fe1 100644
--- a/canvas/source/vcl/devicehelper.cxx
+++ b/canvas/source/vcl/devicehelper.cxx
@@ -206,7 +206,7 @@ namespace vclcanvas
         OutputDevice& rOutDev = mpOutDev->getOutDev();
         bool bOldMap( rOutDev.IsMapModeEnabled() );
         rOutDev.EnableMapMode( false );
-        WriteDIB(rOutDev.GetBitmapEx(aEmptyPoint, 
rOutDev.GetOutputSizePixel()), aStream, false);
+        WriteDIB(BitmapEx(rOutDev.GetBitmap(aEmptyPoint, 
rOutDev.GetOutputSizePixel())), aStream, false);
         rOutDev.EnableMapMode( bOldMap );
 
         ++nFilePostfixCount;
diff --git a/canvas/source/vcl/impltools.cxx b/canvas/source/vcl/impltools.cxx
index 7b431bdf7258..3506cb6a0d11 100644
--- a/canvas/source/vcl/impltools.cxx
+++ b/canvas/source/vcl/impltools.cxx
@@ -64,8 +64,8 @@ namespace vclcanvas::tools
                     // TODO(F3): mind the plain Canvas impl. Consolidate with 
CWS canvas05
                     const ::OutputDevice& rDev( 
pCanvasImpl->getBackBuffer()->getOutDev() );
                     const ::Point aEmptyPoint;
-                    return rDev.GetBitmapEx( aEmptyPoint,
-                                             rDev.GetOutputSizePixel() );
+                    return BitmapEx(rDev.GetBitmap( aEmptyPoint,
+                                             rDev.GetOutputSizePixel() ));
                 }
 
                 // TODO(F2): add support for floating point bitmap formats
diff --git a/canvas/source/vcl/spritedevicehelper.cxx 
b/canvas/source/vcl/spritedevicehelper.cxx
index 99f8b19145ce..dd025bac6fbd 100644
--- a/canvas/source/vcl/spritedevicehelper.cxx
+++ b/canvas/source/vcl/spritedevicehelper.cxx
@@ -108,7 +108,7 @@ namespace vclcanvas
             const ::Point aEmptyPoint;
             mpBackBuffer->getOutDev().EnableMapMode( false );
             mpBackBuffer->getOutDev().SetAntialiasing( 
AntialiasingFlags::Enable );
-            WriteDIB(mpBackBuffer->getOutDev().GetBitmapEx(aEmptyPoint, 
mpBackBuffer->getOutDev().GetOutputSizePixel()), aStream, false);
+            WriteDIB(BitmapEx(mpBackBuffer->getOutDev().GetBitmap(aEmptyPoint, 
mpBackBuffer->getOutDev().GetOutputSizePixel())), aStream, false);
         }
 
         ++nFilePostfixCount;
diff --git a/canvas/source/vcl/spritehelper.cxx 
b/canvas/source/vcl/spritehelper.cxx
index 7b3384c934e7..47efa9bb7b65 100644
--- a/canvas/source/vcl/spritehelper.cxx
+++ b/canvas/source/vcl/spritehelper.cxx
@@ -118,7 +118,7 @@ namespace vclcanvas
         if( bNeedBitmapUpdate )
         {
             const Point aEmptyPoint;
-            BitmapEx aBmp( mpBackBuffer->getOutDev().GetBitmapEx( aEmptyPoint,
+            BitmapEx aBmp( mpBackBuffer->getOutDev().GetBitmap( aEmptyPoint,
                                                               aOutputSize ) );
 
             if( isContentFullyOpaque() )
@@ -133,7 +133,7 @@ namespace vclcanvas
             {
                 // sprite content might contain alpha, create
                 // BmpEx, then.
-                BitmapEx aMask( mpBackBufferMask->getOutDev().GetBitmapEx( 
aEmptyPoint,
+                BitmapEx aMask( mpBackBufferMask->getOutDev().GetBitmap( 
aEmptyPoint,
                                                                            
aOutputSize ) );
                 AlphaMask aAlpha( aMask.GetBitmap() );
                 aAlpha.Invert();
diff --git a/chart2/source/controller/sidebar/ChartColorPaletteControl.cxx 
b/chart2/source/controller/sidebar/ChartColorPaletteControl.cxx
index 74a6c13d3f7b..dc03d6568ece 100644
--- a/chart2/source/controller/sidebar/ChartColorPaletteControl.cxx
+++ b/chart2/source/controller/sidebar/ChartColorPaletteControl.cxx
@@ -115,7 +115,7 @@ void ChartColorPaletteControl::updateStatus(bool bForce)
 
         auto pDev = VclPtr<VirtualDevice>::Create();
         renderSelectedColorPalette(pDev);
-        auto aSelItemImg(pDev->GetBitmapEx(Point(), 
pDev->GetOutputSizePixel()));
+        auto aSelItemImg(pDev->GetBitmap(Point(), pDev->GetOutputSizePixel()));
         if (m_pToolbar)
         {
             m_pToolbar->set_item_image(m_aCommandURL, 
Graphic(aSelItemImg).GetXGraphic());
diff --git a/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx 
b/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx
index 1f62c0bc30d9..dcf9c2aa9a68 100644
--- a/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx
+++ b/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx
@@ -383,9 +383,9 @@ namespace cppcanvas::internal
                     // update buffered bitmap and transformation
                     BitmapSharedPtr aBmp( VCLFactory::createBitmap(
                                               mpCanvas,
-                                              aVDev->GetBitmapEx(
+                                              BitmapEx(aVDev->GetBitmap(
                                                   aBitmapPoint,
-                                                  aBitmapSizePixel ) ) );
+                                                  aBitmapSizePixel ) ) ));
                     mxBufferBitmap = aBmp->getUNOBitmap();
                     maLastTransformation = aTotalTransform;
                     maLastSubset = rSubset;
diff --git a/cui/source/dialogs/screenshotannotationdlg.cxx 
b/cui/source/dialogs/screenshotannotationdlg.cxx
index 4fc295f84286..c818762d3770 100644
--- a/cui/source/dialogs/screenshotannotationdlg.cxx
+++ b/cui/source/dialogs/screenshotannotationdlg.cxx
@@ -206,7 +206,7 @@ ScreenshotAnnotationDlg_Impl::ScreenshotAnnotationDlg_Impl(
 {
     VclPtr<VirtualDevice> xParentDialogSurface(rParentDialog.screenshot());
     maParentDialogSize = xParentDialogSurface->GetOutputSizePixel();
-    maParentDialogBitmap = xParentDialogSurface->GetBitmapEx(Point(), 
maParentDialogSize);
+    maParentDialogBitmap = xParentDialogSurface->GetBitmap(Point(), 
maParentDialogSize);
     maDimmedDialogBitmap = maParentDialogBitmap;
 
     // image ain't empty
@@ -336,7 +336,7 @@ IMPL_LINK_NOARG(ScreenshotAnnotationDlg_Impl, 
saveButtonHandler, weld::Button&,
 
     // extract Bitmap
     const BitmapEx aTargetBitmap(
-        mxVirtualBufferDevice->GetBitmapEx(
+        mxVirtualBufferDevice->GetBitmap(
         Point(0, 0),
         mxVirtualBufferDevice->GetOutputSizePixel()));
 
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 491d8517829c..efb019dcdb21 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -4325,7 +4325,7 @@ static void doc_paintTile(LibreOfficeKitDocument* pThis,
 #ifdef _WIN32
     // pBuffer was not used there
     pDevice->EnableMapMode(false);
-    BitmapEx aBmpEx = pDevice->GetBitmapEx({ 0, 0 }, { nCanvasWidth, 
nCanvasHeight });
+    BitmapEx aBmpEx(pDevice->GetBitmap({ 0, 0 }, { nCanvasWidth, nCanvasHeight 
}));
     vcl::bitmap::fillWithData(pBuffer, aBmpEx);
 #endif
 #endif
diff --git a/drawinglayer/qa/unit/vclmetafileprocessor2d.cxx 
b/drawinglayer/qa/unit/vclmetafileprocessor2d.cxx
index ad57b8d6b30d..3fa4cc335f68 100644
--- a/drawinglayer/qa/unit/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/qa/unit/vclmetafileprocessor2d.cxx
@@ -40,7 +40,7 @@ class VclMetaFileProcessor2DTest : public 
test::BootstrapFixture
     {
         if (mbExportBitmap)
         {
-            BitmapEx aBitmapEx(device->GetBitmapEx(Point(0, 0), 
device->GetOutputSizePixel()));
+            BitmapEx aBitmapEx(device->GetBitmap(Point(0, 0), 
device->GetOutputSizePixel()));
             SvFileStream aStream(filename, StreamMode::WRITE | 
StreamMode::TRUNC);
             GraphicFilter::GetGraphicFilter().compressAsPNG(aBitmapEx, 
aStream);
         }
diff --git a/drawinglayer/qa/unit/vclpixelprocessor2d.cxx 
b/drawinglayer/qa/unit/vclpixelprocessor2d.cxx
index 209d4273120e..8c995a4f92ba 100644
--- a/drawinglayer/qa/unit/vclpixelprocessor2d.cxx
+++ b/drawinglayer/qa/unit/vclpixelprocessor2d.cxx
@@ -34,7 +34,7 @@ class VclPixelProcessor2DTest : public test::BootstrapFixture
     {
         if (mbExportBitmap)
         {
-            BitmapEx aBitmapEx(device->GetBitmapEx(Point(0, 0), 
device->GetOutputSizePixel()));
+            BitmapEx aBitmapEx(device->GetBitmap(Point(0, 0), 
device->GetOutputSizePixel()));
             SvFileStream aStream(filename, StreamMode::WRITE | 
StreamMode::TRUNC);
             GraphicFilter::GetGraphicFilter().compressAsPNG(aBitmapEx, 
aStream);
         }
diff --git a/drawinglayer/source/primitive2d/controlprimitive2d.cxx 
b/drawinglayer/source/primitive2d/controlprimitive2d.cxx
index 81af256a88bb..abf4a3b5e344 100644
--- a/drawinglayer/source/primitive2d/controlprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/controlprimitive2d.cxx
@@ -176,7 +176,7 @@ namespace drawinglayer::primitive2d
                                 xControlView->draw(0, 0);
 
                                 // get bitmap
-                                const BitmapEx 
aContent(aVirtualDevice->GetBitmapEx(Point(), aSizePixel));
+                                const BitmapEx 
aContent(aVirtualDevice->GetBitmap(Point(), aSizePixel));
 
                                 // snap translate and scale to discrete 
position (pixel) to avoid sub-pixel offset and blurring further
                                 basegfx::B2DVector 
aSnappedTranslate(basegfx::fround(rViewInformation.getObjectToViewTransformation()
 * aTranslate));
diff --git a/include/vcl/bitmap.hxx b/include/vcl/bitmap.hxx
index 68bf8d75bb38..e63076a3339c 100644
--- a/include/vcl/bitmap.hxx
+++ b/include/vcl/bitmap.hxx
@@ -133,6 +133,9 @@ public:
     inline sal_Int64        GetSizeBytes() const;
     bool                    HasGreyPalette8Bit() const;
     bool                    HasGreyPaletteAny() const;
+    // does this bitmap have alpha information?
+    inline bool             HasAlpha() const { return getPixelFormat() == 
vcl::PixelFormat::N32_BPP; }
+
     /** get system dependent bitmap data
 
         @param rData
diff --git a/include/vcl/graph.hxx b/include/vcl/graph.hxx
index 350545ea0207..d6db541d54a7 100644
--- a/include/vcl/graph.hxx
+++ b/include/vcl/graph.hxx
@@ -93,6 +93,7 @@ public:
                     Graphic( Graphic&& rGraphic ) noexcept;
                     Graphic( const Image& rImage );
                     Graphic( const BitmapEx& rBmpEx );
+                    Graphic( const Bitmap& rBmp );
                     Graphic( const std::shared_ptr<VectorGraphicData>& 
rVectorGraphicDataPtr );
                     Graphic( const Animation& rAnimation );
                     Graphic( const GDIMetaFile& rMtf );
diff --git a/include/vcl/image.hxx b/include/vcl/image.hxx
index 10348d4a9cb7..4f2d2912c3c4 100644
--- a/include/vcl/image.hxx
+++ b/include/vcl/image.hxx
@@ -42,6 +42,7 @@ class SAL_WARN_UNUSED VCL_DLLPUBLIC Image
 public:
     Image();
     explicit Image(BitmapEx const & rBitmapEx);
+    explicit Image(Bitmap const & rBitmap);
     explicit Image(css::uno::Reference<css::graphic::XGraphic> const & 
rxGraphic);
     explicit Image(OUString const & rPNGFileUrl);
     explicit Image(StockImage, OUString const & rPNGFilePath);
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index 538d2bfee842..af90516add7e 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -1311,12 +1311,21 @@ public:
     void                        DrawBitmapEx(
                                     const Point& rDestPt,
                                     const BitmapEx& rBitmapEx );
+    // draw bitmap (potentially with alpha)
+    void                        DrawBitmapEx(
+                                    const Point& rDestPt,
+                                    const Bitmap& rBitmap );
 
 
     void                        DrawBitmapEx(
                                     const Point& rDestPt,
                                     const Size& rDestSize,
                                     const BitmapEx& rBitmapEx );
+    // draw bitmap (potentially with alpha)
+    void                        DrawBitmapEx(
+                                    const Point& rDestPt,
+                                    const Size& rDestSize,
+                                    const Bitmap& rBitmapEx );
 
     void                        DrawBitmapEx(
                                     const Point& rDestPt,
@@ -1332,6 +1341,14 @@ public:
                                     const Size& rSrcSizePixel,
                                     const BitmapEx& rBitmapEx,
                                     MetaActionType nAction );
+    // draw bitmap, potentially with alpha information
+    SAL_DLLPRIVATE void         DrawBitmapEx(
+                                    const Point& rDestPt,
+                                    const Size& rDestSize,
+                                    const Point& rSrcPtPixel,
+                                    const Size& rSrcSizePixel,
+                                    const Bitmap& rBitmap,
+                                    MetaActionType nAction );
 
     /** @overload
         virtual void DrawImage(
@@ -1352,6 +1369,8 @@ public:
                                     DrawImageFlags nStyle = 
DrawImageFlags::NONE );
 
 
+    /** Query bitmap (with alpha channel, if available).
+     */
     virtual Bitmap              GetBitmap( const Point& rSrcPt, const Size& 
rSize ) const;
 
     /**
@@ -1359,11 +1378,6 @@ public:
      */
     virtual bool HasAlpha() const = 0;
 
-    /** Query extended bitmap (with alpha channel, if available).
-     */
-    BitmapEx                    GetBitmapEx( const Point& rSrcPt, const Size& 
rSize ) const;
-
-
     /** Draw BitmapEx transformed
 
         @param rTransformation
diff --git a/include/vcl/qt/QtUtils.hxx b/include/vcl/qt/QtUtils.hxx
index 65fb645d0e2a..5bc2db9d7e98 100644
--- a/include/vcl/qt/QtUtils.hxx
+++ b/include/vcl/qt/QtUtils.hxx
@@ -62,7 +62,7 @@ inline QPixmap toQPixmap(const 
css::uno::Reference<css::graphic::XGraphic>& rIma
 
 inline QPixmap toQPixmap(const OutputDevice& rDevice)
 {
-    return toQPixmap(Image(rDevice.GetBitmapEx(Point(), 
rDevice.GetOutputSize())));
+    return toQPixmap(Image(rDevice.GetBitmap(Point(), 
rDevice.GetOutputSize())));
 }
 
 inline QPixmap loadQPixmapIcon(const OUString& rIconName)
diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index 7430232e57c4..b210e8e752d0 100644
--- a/sc/source/ui/app/transobj.cxx
+++ b/sc/source/ui/app/transobj.cxx
@@ -440,7 +440,7 @@ bool ScTransferObj::GetData( const 
datatransfer::DataFlavor& rFlavor, const OUSt
             PaintToDev( pVirtDev, *m_pDoc, 1.0, aReducedBlock );
 
             pVirtDev->SetMapMode( MapMode( MapUnit::MapPixel, Point(), aScale, 
aScale ) );
-            BitmapEx aBmp = pVirtDev->GetBitmapEx( Point(), 
pVirtDev->GetOutputSize() );
+            BitmapEx aBmp( pVirtDev->GetBitmap( Point(), 
pVirtDev->GetOutputSize() ) );
             bOK = SetBitmapEx( aBmp, rFlavor );
         }
         else if ( nFormat == SotClipboardFormatId::GDIMETAFILE )
diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx 
b/sc/source/ui/attrdlg/scdlgfact.cxx
index a0e113fc2457..f1c67171b688 100644
--- a/sc/source/ui/attrdlg/scdlgfact.cxx
+++ b/sc/source/ui/attrdlg/scdlgfact.cxx
@@ -86,7 +86,7 @@ public:
     BitmapEx createScreenshot() const override
     {
         VclPtr<VirtualDevice> 
xDialogSurface(this->m_pDlg->getDialog()->screenshot());
-        return xDialogSurface->GetBitmapEx(Point(), 
xDialogSurface->GetOutputSizePixel());
+        return BitmapEx(xDialogSurface->GetBitmap(Point(), 
xDialogSurface->GetOutputSizePixel()));
     }
     OUString GetScreenshotId() const override { return 
this->m_pDlg->get_help_id(); }
 };
diff --git a/sd/source/ui/dlg/animobjs.cxx b/sd/source/ui/dlg/animobjs.cxx
index 3970d95f62bf..dc089dad27d1 100644
--- a/sd/source/ui/dlg/animobjs.cxx
+++ b/sd/source/ui/dlg/animobjs.cxx
@@ -531,7 +531,7 @@ void AnimationWindow::UpdateControl(bool const 
bDisableCtrls)
                 : sd::OUTPUT_DRAWMODE_COLOR );
             pVD->Erase();
             pObject->SingleObjectPainter( *pVD );
-            aBmp = pVD->GetBitmapEx( aObjRect.TopLeft(), aObjSize );
+            aBmp = pVD->GetBitmap( aObjRect.TopLeft(), aObjSize );
         }
 
         m_xCtlDisplay->SetBitmapEx(&aBmp);
diff --git a/sd/source/ui/dlg/sddlgfact.cxx b/sd/source/ui/dlg/sddlgfact.cxx
index 4bcefc652698..f1ae84f1c45c 100644
--- a/sd/source/ui/dlg/sddlgfact.cxx
+++ b/sd/source/ui/dlg/sddlgfact.cxx
@@ -59,7 +59,7 @@ public:
     BitmapEx createScreenshot() const override
     {
         VclPtr<VirtualDevice> 
xDialogSurface(this->m_pDlg->getDialog()->screenshot());
-        return xDialogSurface->GetBitmapEx(Point(), 
xDialogSurface->GetOutputSizePixel());
+        return BitmapEx(xDialogSurface->GetBitmap(Point(), 
xDialogSurface->GetOutputSizePixel()));
     }
     OUString GetScreenshotId() const override { return 
this->m_pDlg->get_help_id(); }
 };
diff --git a/sd/source/ui/docshell/docshel2.cxx 
b/sd/source/ui/docshell/docshel2.cxx
index f5489f20392d..d4d8e3f62765 100644
--- a/sd/source/ui/docshell/docshel2.cxx
+++ b/sd/source/ui/docshell/docshel2.cxx
@@ -260,7 +260,7 @@ BitmapEx DrawDocShell::GetPagePreviewBitmap(SdPage* pPage)
 
     pVDev->SetMapMode( MapMode() );
 
-    BitmapEx aPreview( pVDev->GetBitmapEx( aNullPt, 
pVDev->GetOutputSizePixel() ) );
+    BitmapEx aPreview( pVDev->GetBitmap( aNullPt, pVDev->GetOutputSizePixel() 
) );
 
     DBG_ASSERT(!aPreview.IsEmpty(), "Preview-Bitmap could not be generated");
 
diff --git a/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx 
b/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx
index b6fa34d93ca9..e75b1cce6d49 100644
--- a/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx
+++ b/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx
@@ -137,7 +137,7 @@ void InsertionIndicatorOverlay::Create (
 
     PaintPageCount(*pContent, nSelectionCount, aPreviewSize, aOffset);
 
-    maIcon = pContent->GetBitmapEx(Point(0,0), aIconSize);
+    maIcon = pContent->GetBitmap(Point(0,0), aIconSize);
     maIcon.Scale(aIconSize);
 }
 
diff --git a/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx 
b/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
index 417be4ddd581..da8d45c112a8 100644
--- a/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
+++ b/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
@@ -173,7 +173,7 @@ BitmapEx PageObjectPainter::CreateMarkedPreview (
             for (::tools::Long nY=0; nY<rSize.Height(); nY+=nIconHeight)
                 pDevice->DrawBitmapEx(Point(nX,nY), rOverlay);
     }
-    return pDevice->GetBitmapEx(Point(0,0), rSize);
+    return BitmapEx(pDevice->GetBitmap(Point(0,0), rSize));
 }
 
 BitmapEx PageObjectPainter::GetPreviewBitmap (
diff --git a/sd/source/ui/table/TableDesignPane.cxx 
b/sd/source/ui/table/TableDesignPane.cxx
index 3ed644ce75f3..5bb93b9f4156 100644
--- a/sd/source/ui/table/TableDesignPane.cxx
+++ b/sd/source/ui/table/TableDesignPane.cxx
@@ -1018,7 +1018,7 @@ static BitmapEx CreateDesignPreview( const Reference< 
XIndexAccess >& xTableStyl
         }
     }
 
-    return pVirDev->GetBitmapEx(Point(0,0), aBmpSize);
+    return BitmapEx(pVirDev->GetBitmap(Point(0,0), aBmpSize));
 }
 
 void TableDesignWidget::FillDesignPreviewControl()
diff --git a/sd/source/ui/tools/PreviewRenderer.cxx 
b/sd/source/ui/tools/PreviewRenderer.cxx
index 9425f0b16791..1ee5c3b660e3 100644
--- a/sd/source/ui/tools/PreviewRenderer.cxx
+++ b/sd/source/ui/tools/PreviewRenderer.cxx
@@ -121,7 +121,7 @@ Image PreviewRenderer::RenderPage (
                 PaintFrame();
 
                 Size aSize (mpPreviewDevice->GetOutputSizePixel());
-                aPreview = Image(mpPreviewDevice->GetBitmapEx(
+                aPreview = Image(mpPreviewDevice->GetBitmap(
                     mpPreviewDevice->PixelToLogic(Point(0,0)),
                     mpPreviewDevice->PixelToLogic(aSize)));
 
@@ -183,7 +183,7 @@ Image PreviewRenderer::RenderSubstitution (
         PaintFrame();
 
         const Size aSize (mpPreviewDevice->GetOutputSizePixel());
-        aPreview = Image(mpPreviewDevice->GetBitmapEx(
+        aPreview = Image(mpPreviewDevice->GetBitmap(
             mpPreviewDevice->PixelToLogic(Point(0,0)),
             mpPreviewDevice->PixelToLogic(aSize)));
     }
@@ -452,7 +452,7 @@ Image PreviewRenderer::ScaleBitmap (
             aScaledBitmap);
 
         // Get the resulting bitmap.
-        aPreview = Image(mpPreviewDevice->GetBitmapEx(Point(0,0), aFrameSize));
+        aPreview = Image(mpPreviewDevice->GetBitmap(Point(0,0), aFrameSize));
     }
     while (false);
 
diff --git a/sfx2/source/control/recentdocsviewitem.cxx 
b/sfx2/source/control/recentdocsviewitem.cxx
index 4264ef90509f..31152e4b9e23 100644
--- a/sfx2/source/control/recentdocsviewitem.cxx
+++ b/sfx2/source/control/recentdocsviewitem.cxx
@@ -228,7 +228,7 @@ RecentDocsViewItem::RecentDocsViewItem(sfx2::RecentDocsView 
&rView, const OUStri
             pVirDev->DrawBitmapEx(Point(aSize.Width() - aOverlaySize.Width() - 
5,
                                         aSize.Height() - aOverlaySize.Height() 
- 5),
                                   aModule);
-            aThumbnail = pVirDev->GetBitmapEx(Point(), aSize);
+            aThumbnail = pVirDev->GetBitmap(Point(), aSize);
         }
     }
 
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index 9bdc433dab5f..247590a664db 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -1182,7 +1182,7 @@ BitmapEx SfxTabDialogController::createScreenshot() const
     }
 
     VclPtr<VirtualDevice> xDialogSurface(m_xDialog->screenshot());
-    return xDialogSurface->GetBitmapEx(Point(), 
xDialogSurface->GetOutputSizePixel());
+    return BitmapEx(xDialogSurface->GetBitmap(Point(), 
xDialogSurface->GetOutputSizePixel()));
 }
 
 OUString SfxTabDialogController::GetScreenshotId() const
diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx
index 291c4e435d9c..fdd8fdb89804 100644
--- a/sfx2/source/doc/objcont.cxx
+++ b/sfx2/source/doc/objcont.cxx
@@ -111,7 +111,7 @@ BitmapEx SfxObjectShell::GetPreviewBitmap() const
     if(!CreatePreview_Impl(/*bFullContent*/false, false, pDevice, nullptr))
         return BitmapEx();
     Size size = pDevice->GetOutputSizePixel();
-    BitmapEx aBitmap = pDevice->GetBitmapEx( Point(), size);
+    BitmapEx aBitmap( pDevice->GetBitmap( Point(), size) );
     // Scale down the image to the desired size from the 4*size from 
CreatePreview_Impl().
     size = Size( size.Width() / 4, size.Height() / 4 );
     aBitmap.Scale(size, BmpScaleFlag::BestQuality);
diff --git a/starmath/source/ElementsDockingWindow.cxx 
b/starmath/source/ElementsDockingWindow.cxx
index 57252b79aa24..29b70920bf0e 100644
--- a/starmath/source/ElementsDockingWindow.cxx
+++ b/starmath/source/ElementsDockingWindow.cxx
@@ -594,7 +594,7 @@ void SmElementsControl::addElement(const OUString& 
aElementVisual, const OUStrin
 
     maItemDatas.push_back(std::make_unique<ElementData>(aElementSource, 
aHelpText, maItemDatas.size()));
     const OUString aId(weld::toId(maItemDatas.back().get()));
-    BitmapEx aBitmap = pDevice->GetBitmapEx(Point(0,0), 
pDevice->GetOutputSize());
+    BitmapEx aBitmap( pDevice->GetBitmap(Point(0,0), pDevice->GetOutputSize()) 
);
     mpIconView->insert(-1, nullptr, &aId, &aBitmap, nullptr);
     mpIconView->set_item_accessible_name(mpIconView->n_children() - 1, 
GetElementHelpText(aId));
     if (mpIconView->get_item_width() < aSize.Width())
diff --git a/svtools/source/control/ctrlbox.cxx 
b/svtools/source/control/ctrlbox.cxx
index 2cadcd57b518..aa00da5bed0c 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -1482,7 +1482,7 @@ void SvtLineListBox::ImpGetLine( tools::Long nLine1, 
tools::Long nLine2, tools::
         aVirDev->SetFillColor( aColor2 );
         svtools::DrawLine( *aVirDev, basegfx::B2DPoint( 0, y2 ), 
basegfx::B2DPoint( aSize.Width(), y2 ), n2, SvxBorderLineStyle::SOLID );
     }
-    rBmp = aVirDev->GetBitmapEx( Point(), Size( aSize.Width(), n1+nDist+n2 ) );
+    rBmp = aVirDev->GetBitmap( Point(), Size( aSize.Width(), n1+nDist+n2 ) );
 }
 
 SvtLineListBox::SvtLineListBox(std::unique_ptr<weld::MenuButton> pControl)
diff --git a/svx/source/dialog/ThemeDialog.cxx 
b/svx/source/dialog/ThemeDialog.cxx
index e293fb46339e..2b299c0cc1f8 100644
--- a/svx/source/dialog/ThemeDialog.cxx
+++ b/svx/source/dialog/ThemeDialog.cxx
@@ -56,7 +56,7 @@ void ThemeDialog::initColorSets()
     {
         auto const& rColorSet = maColorSets[i];
         VclPtr<VirtualDevice> pVirDev = CreateColorSetPreview(rColorSet);
-        BitmapEx aBitmapEx = pVirDev->GetBitmapEx(Point(0, 0), 
pVirDev->GetOutputSizePixel());
+        BitmapEx aBitmapEx(pVirDev->GetBitmap(Point(0, 0), 
pVirDev->GetOutputSizePixel()));
 
         OUString sId = OUString::number(i);
         OUString sName = rColorSet.getName();
diff --git a/svx/source/dialog/dialcontrol.cxx 
b/svx/source/dialog/dialcontrol.cxx
index ce6640e57b9a..53c07a1e3157 100644
--- a/svx/source/dialog/dialcontrol.cxx
+++ b/svx/source/dialog/dialcontrol.cxx
@@ -53,7 +53,7 @@ void DialControlBmp::CopyBackground( const DialControlBmp& 
rSrc )
     SetSize(rSrc.maRect.GetSize());
     mbEnabled = rSrc.mbEnabled;
     Point aPos;
-    DrawBitmapEx( aPos, rSrc.GetBitmapEx( aPos, maRect.GetSize() ) );
+    DrawBitmapEx( aPos, rSrc.GetBitmap( aPos, maRect.GetSize() ) );
 }
 
 void DialControlBmp::DrawBackground( const Size& rSize, bool bEnabled )
@@ -276,7 +276,7 @@ void DialControl::Resize()
 void DialControl::Paint(vcl::RenderContext& rRenderContext, const 
tools::Rectangle&)
 {
     Point aPos;
-    rRenderContext.DrawBitmapEx(aPos, mpImpl->mxBmpBuffered->GetBitmapEx(aPos, 
mpImpl->maWinSize));
+    rRenderContext.DrawBitmapEx(aPos, mpImpl->mxBmpBuffered->GetBitmap(aPos, 
mpImpl->maWinSize));
 }
 
 void DialControl::StyleUpdated()
diff --git a/svx/source/dialog/frmsel.cxx b/svx/source/dialog/frmsel.cxx
index f2677f2da21a..dca9a63deb3b 100644
--- a/svx/source/dialog/frmsel.cxx
+++ b/svx/source/dialog/frmsel.cxx
@@ -719,7 +719,7 @@ void 
FrameSelectorImpl::CopyVirDevToControl(vcl::RenderContext& rRenderContext)
 {
     if (mbFullRepaint)
         DrawVirtualDevice();
-    rRenderContext.DrawBitmapEx(maVirDevPos, mpVirDev->GetBitmapEx(Point(0, 
0), mpVirDev->GetOutputSizePixel()));
+    rRenderContext.DrawBitmapEx(maVirDevPos, mpVirDev->GetBitmap(Point(0, 0), 
mpVirDev->GetOutputSizePixel()));
 }
 
 void FrameSelectorImpl::DrawAllTrackingRects(vcl::RenderContext& 
rRenderContext)
diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index aba506b0e463..9097fdf335ab 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -1206,7 +1206,7 @@ BitmapEx SdrHdlColor::CreateColorDropper(Color aCol)
     pWrite->DrawLine(Point(2, nHeight - 2), Point(nWidth - 2, nHeight - 2));
     pWrite->DrawLine(Point(nWidth - 2, 2), Point(nWidth - 2, nHeight - 3));
 
-    return pWrite->GetBitmapEx(Point(0,0), m_aMarkerSize);
+    return BitmapEx(pWrite->GetBitmap(Point(0,0), m_aMarkerSize));
 }
 
 Color SdrHdlColor::GetLuminance(const Color& rCol)
diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx
index 7b0e91323a0b..8421a70f3a89 100644
--- a/svx/source/svdraw/svdoashp.cxx
+++ b/svx/source/svdraw/svdoashp.cxx
@@ -355,7 +355,7 @@ static rtl::Reference<SdrObject> 
ImpCreateShadowObjectClone(const SdrObject& rOr
                 pVirDev->SetOutputSizePixel(aBitmapEx.GetSizePixel());
                 BitmapFilter::Filter(aBitmapEx, 
BitmapShadowFilter(aShadowColor));
                 pVirDev->DrawBitmapEx(Point(), aBitmapEx);
-                
aGraphicObject.SetGraphic(Graphic(pVirDev->GetBitmapEx(Point(0,0), 
aBitmapEx.GetSizePixel())));
+                
aGraphicObject.SetGraphic(Graphic(pVirDev->GetBitmap(Point(0,0), 
aBitmapEx.GetSizePixel())));
             }
 
             aTempSet.Put(XFillBitmapItem(aGraphicObject));
diff --git a/svx/source/tbxctrls/StylesPreviewWindow.cxx 
b/svx/source/tbxctrls/StylesPreviewWindow.cxx
index b25740698dae..3a5e5f135c58 100644
--- a/svx/source/tbxctrls/StylesPreviewWindow.cxx
+++ b/svx/source/tbxctrls/StylesPreviewWindow.cxx
@@ -595,7 +595,7 @@ BitmapEx StylesPreviewWindow_Base::GetCachedPreview(const 
std::pair<OUString, OU
 
         StyleItemController aStyleController(rStyle);
         aStyleController.Paint(*pImg, pStyleHint);
-        BitmapEx aBitmap = pImg->GetBitmapEx(Point(0, 0), aSize);
+        BitmapEx aBitmap(pImg->GetBitmap(Point(0, 0), aSize));
         StylePreviewCache::Get()[rStyle.second] = aBitmap;
 
         return aBitmap;
diff --git a/svx/source/tbxctrls/colrctrl.cxx b/svx/source/tbxctrls/colrctrl.cxx
index 80035c8cd2fa..1f6335ee90ed 100644
--- a/svx/source/tbxctrls/colrctrl.cxx
+++ b/svx/source/tbxctrls/colrctrl.cxx
@@ -277,7 +277,7 @@ void SvxColorDockingWindow::FillValueSet()
     pVD->DrawLine( Point(), Point( nPtX, nPtY ) );
     pVD->DrawLine( Point( 0, nPtY ), Point( nPtX, 0 ) );
 
-    BitmapEx aBmp( pVD->GetBitmapEx( Point(), aColorSize ) );
+    Bitmap aBmp( pVD->GetBitmap( Point(), aColorSize ) );
 
     xColorSet->InsertItem( sal_uInt16(1), Image(aBmp), SvxResId( 
RID_SVXSTR_INVISIBLE ) );
 }
diff --git a/svx/source/tbxctrls/fontworkgallery.cxx 
b/svx/source/tbxctrls/fontworkgallery.cxx
index e1b1e1baad7f..a549698f1336 100644
--- a/svx/source/tbxctrls/fontworkgallery.cxx
+++ b/svx/source/tbxctrls/fontworkgallery.cxx
@@ -117,7 +117,7 @@ void FontWorkGalleryDialog::initFavorites(sal_uInt16 
nThemeId)
             pVDev->DrawCheckered(aNull, aSize, nLen, aW, aG);
 
             pVDev->DrawBitmapEx(aNull, aThumb);
-            maFavoritesHorizontal.emplace_back(pVDev->GetBitmapEx(Point(0,0), 
aSize));
+            maFavoritesHorizontal.emplace_back(pVDev->GetBitmap(Point(0,0), 
aSize));
         }
     }
 
diff --git a/svx/source/tbxctrls/itemwin.cxx b/svx/source/tbxctrls/itemwin.cxx
index 30a1b66d173e..cea8c18e3d17 100644
--- a/svx/source/tbxctrls/itemwin.cxx
+++ b/svx/source/tbxctrls/itemwin.cxx
@@ -236,7 +236,7 @@ namespace
             }
         }
 
-        rBitmapEx = pVirtualDevice->GetBitmapEx(Point(0, 0), rSize);
+        rBitmapEx = pVirtualDevice->GetBitmap(Point(0, 0), rSize);
     }
 } // end of anonymous namespace
 
diff --git a/svx/source/tbxctrls/linectrl.cxx b/svx/source/tbxctrls/linectrl.cxx
index 617bdb8f8fbc..24c0b18816af 100644
--- a/svx/source/tbxctrls/linectrl.cxx
+++ b/svx/source/tbxctrls/linectrl.cxx
@@ -375,8 +375,8 @@ void SvxLineEndWindow::FillValueSet()
     Point aPt1( maBmpSize.Width(), 0 );
 
     pVD->DrawBitmapEx( Point(), aBmp );
-    mxLineEndSet->InsertItem(1, Image(pVD->GetBitmapEx(aPt0, maBmpSize)), 
pEntry->GetName());
-    mxLineEndSet->InsertItem(2, Image(pVD->GetBitmapEx(aPt1, maBmpSize)), 
pEntry->GetName());
+    mxLineEndSet->InsertItem(1, Image(pVD->GetBitmap(aPt0, maBmpSize)), 
pEntry->GetName());
+    mxLineEndSet->InsertItem(2, Image(pVD->GetBitmap(aPt1, maBmpSize)), 
pEntry->GetName());
 
     mpLineEndList->Remove(nCount);
 
@@ -389,9 +389,9 @@ void SvxLineEndWindow::FillValueSet()
 
         pVD->DrawBitmapEx( aPt0, aBmp );
         mxLineEndSet->InsertItem(static_cast<sal_uInt16>((i+1)*2L+1),
-                Image(pVD->GetBitmapEx(aPt0, maBmpSize)), pEntry->GetName());
+                Image(pVD->GetBitmap(aPt0, maBmpSize)), pEntry->GetName());
         mxLineEndSet->InsertItem(static_cast<sal_uInt16>((i+2)*2L),
-                Image(pVD->GetBitmapEx(aPt1, maBmpSize)), pEntry->GetName());
+                Image(pVD->GetBitmap(aPt1, maBmpSize)), pEntry->GetName());
     }
     mnLines = std::min( static_cast<sal_uInt16>(nCount + 1), 
sal_uInt16(MAX_LINES) );
     mxLineEndSet->SetLineCount( mnLines );
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index d02867e3642f..bda3acaaa53a 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -672,7 +672,7 @@ private:
             aVirDev->SetFillColor( aColor2 );
             svtools::DrawLine( *aVirDev, basegfx::B2DPoint( 0, y2 ), 
basegfx::B2DPoint( aSize.Width(), y2 ), n2, SvxBorderLineStyle::SOLID );
         }
-        rBmp = aVirDev->GetBitmapEx( Point(), Size( aSize.Width(), n1+nDist+n2 
) );
+        rBmp = aVirDev->GetBitmap( Point(), Size( aSize.Width(), n1+nDist+n2 ) 
);
     }
 
     LineListBox::LineListBox()
diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx 
b/svx/source/unodraw/UnoGraphicExporter.cxx
index 57c176edec47..7fc53a73d329 100644
--- a/svx/source/unodraw/UnoGraphicExporter.cxx
+++ b/svx/source/unodraw/UnoGraphicExporter.cxx
@@ -662,7 +662,7 @@ bool GraphicExporter::GetGraphic( ExportSettings const & 
rSettings, Graphic& aGr
 
                 if( pVDev )
                 {
-                    aGraphic = pVDev->GetBitmapEx( Point(), 
pVDev->GetOutputSize() );
+                    aGraphic = pVDev->GetBitmap( Point(), 
pVDev->GetOutputSize() );
                     aGraphic.SetPrefMapMode( aMap );
                     aGraphic.SetPrefSize( aSize );
                 }
diff --git a/svx/source/xoutdev/xattrbmp.cxx b/svx/source/xoutdev/xattrbmp.cxx
index f81841b66ac8..66e7acb77fb5 100644
--- a/svx/source/xoutdev/xattrbmp.cxx
+++ b/svx/source/xoutdev/xattrbmp.cxx
@@ -122,7 +122,7 @@ void XOBitmap::Array2Bitmap()
         }
     }
 
-    xGraphicObject.reset(new GraphicObject(pVDev->GetBitmapEx(Point(), 
Size(nLines, nLines))));
+    xGraphicObject.reset(new GraphicObject(pVDev->GetBitmap(Point(), 
Size(nLines, nLines))));
     bGraphicDirty = false;
 }
 
diff --git a/svx/source/xoutdev/xtabbtmp.cxx b/svx/source/xoutdev/xtabbtmp.cxx
index 178ba8ab2db4..9972efeef4b9 100644
--- a/svx/source/xoutdev/xtabbtmp.cxx
+++ b/svx/source/xoutdev/xtabbtmp.cxx
@@ -92,7 +92,7 @@ BitmapEx XBitmapList::CreateBitmap( tools::Long nIndex, const 
Size& rSize ) cons
                 }
             }
         }
-        rBitmapEx = pVirtualDevice->GetBitmapEx(Point(0, 0), rSize);
+        rBitmapEx = pVirtualDevice->GetBitmap(Point(0, 0), rSize);
         return rBitmapEx;
     }
     else
diff --git a/svx/source/xoutdev/xtabdash.cxx b/svx/source/xoutdev/xtabdash.cxx
index ad6480c6a562..7e3f0011acca 100644
--- a/svx/source/xoutdev/xtabdash.cxx
+++ b/svx/source/xoutdev/xtabdash.cxx
@@ -172,7 +172,7 @@ BitmapEx XDashList::CreateBitmapForXDash(const XDash* 
pDash, double fLineThickne
     pProcessor2D.reset();
 
     // get result bitmap and scale
-    BitmapEx aRetval(pVirtualDevice->GetBitmapEx(Point(0, 0), 
pVirtualDevice->GetOutputSizePixel()));
+    BitmapEx aRetval(pVirtualDevice->GetBitmap(Point(0, 0), 
pVirtualDevice->GetOutputSizePixel()));
 
     if(1 != nFactor)
     {
diff --git a/svx/source/xoutdev/xtabgrdt.cxx b/svx/source/xoutdev/xtabgrdt.cxx
index f7ad60771874..7558d95af856 100644
--- a/svx/source/xoutdev/xtabgrdt.cxx
+++ b/svx/source/xoutdev/xtabgrdt.cxx
@@ -152,7 +152,7 @@ BitmapEx XGradientList::CreateBitmap( tools::Long nIndex, 
const Size& rSize ) co
         pProcessor2D.reset();
 
         // get result bitmap and scale
-        aRetval = pVirtualDevice->GetBitmapEx(Point(0, 0), 
pVirtualDevice->GetOutputSizePixel());
+        aRetval = pVirtualDevice->GetBitmap(Point(0, 0), 
pVirtualDevice->GetOutputSizePixel());
     }
 
     return aRetval;
diff --git a/svx/source/xoutdev/xtabhtch.cxx b/svx/source/xoutdev/xtabhtch.cxx
index 97cb500dc600..3070cbfd7f74 100644
--- a/svx/source/xoutdev/xtabhtch.cxx
+++ b/svx/source/xoutdev/xtabhtch.cxx
@@ -170,7 +170,7 @@ BitmapEx XHatchList::CreateBitmap( tools::Long nIndex, 
const Size& rSize) const
         pProcessor2D.reset();
 
         // get result bitmap and scale
-        aRetval = pVirtualDevice->GetBitmapEx(Point(0, 0), 
pVirtualDevice->GetOutputSizePixel());
+        aRetval = pVirtualDevice->GetBitmap(Point(0, 0), 
pVirtualDevice->GetOutputSizePixel());
     }
 
     return aRetval;
diff --git a/svx/source/xoutdev/xtablend.cxx b/svx/source/xoutdev/xtablend.cxx
index fcca059601e5..2152922e0283 100644
--- a/svx/source/xoutdev/xtablend.cxx
+++ b/svx/source/xoutdev/xtablend.cxx
@@ -154,7 +154,7 @@ BitmapEx XLineEndList::CreateBitmapForUI( tools::Long 
nIndex )
         pProcessor2D.reset();
 
         // get result bitmap and scale
-        aRetval = pVirtualDevice->GetBitmapEx(Point(0, 0), 
pVirtualDevice->GetOutputSizePixel());
+        aRetval = pVirtualDevice->GetBitmap(Point(0, 0), 
pVirtualDevice->GetOutputSizePixel());
     }
 
     return aRetval;
diff --git a/svx/source/xoutdev/xtabptrn.cxx b/svx/source/xoutdev/xtabptrn.cxx
index 29697880f07f..419ab4e4dddd 100644
--- a/svx/source/xoutdev/xtabptrn.cxx
+++ b/svx/source/xoutdev/xtabptrn.cxx
@@ -127,7 +127,7 @@ BitmapEx XPatternList::CreateBitmap( tools::Long nIndex, 
const Size& rSize ) con
                 }
             }
         }
-        rBitmapEx = pVirtualDevice->GetBitmapEx(Point(0, 0), rSize);
+        rBitmapEx = pVirtualDevice->GetBitmap(Point(0, 0), rSize);
         return rBitmapEx;
     }
     else
diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx
index aab000cb3bf8..baa295ba98e3 100644
--- a/sw/source/core/frmedt/fecopy.cxx
+++ b/sw/source/core/frmedt/fecopy.cxx
@@ -1310,7 +1310,7 @@ bool SwFEShell::GetDrawObjGraphic( SotClipboardFormatId 
nFormat, Graphic& rGrf )
                         if( pVirtDev->SetOutputSize( aSz ) )
                         {
                             aGrf.Draw(*pVirtDev, Point(), aSz);
-                            rGrf = pVirtDev->GetBitmapEx( Point(), aSz );
+                            rGrf = pVirtDev->GetBitmap( Point(), aSz );
                         }
                         else
                         {
diff --git a/sw/source/uibase/sidebar/StylePresetsPanel.cxx 
b/sw/source/uibase/sidebar/StylePresetsPanel.cxx
index 8455f6c7ac10..572db4d575a5 100644
--- a/sw/source/uibase/sidebar/StylePresetsPanel.cxx
+++ b/sw/source/uibase/sidebar/StylePresetsPanel.cxx
@@ -113,7 +113,7 @@ BitmapEx GenerateStylePreview(SfxObjectShell& rSource, 
OUString const & aName)
         renderPreview(pStyleManager, *pVirtualDev, u"Body Text", 
nTextBodyHeight, aRenderRect);
     }
 
-    return pVirtualDev->GetBitmapEx(Point(), aSize);
+    return BitmapEx(pVirtualDev->GetBitmap(Point(), aSize));
 }
 
 BitmapEx CreatePreview(OUString const & aUrl, OUString const & aName)
diff --git a/test/source/screenshot_test.cxx b/test/source/screenshot_test.cxx
index fc1fb3c39710..91d707f7b86f 100644
--- a/test/source/screenshot_test.cxx
+++ b/test/source/screenshot_test.cxx
@@ -121,7 +121,7 @@ void ScreenshotTest::saveScreenshot(VclAbstractDialog const 
& rDialog)
 void ScreenshotTest::saveScreenshot(weld::Window& rDialog)
 {
     VclPtr<VirtualDevice> xDialogSurface(rDialog.screenshot());
-    const BitmapEx aScreenshot(xDialogSurface->GetBitmapEx(Point(), 
xDialogSurface->GetOutputSizePixel()));
+    const BitmapEx aScreenshot(xDialogSurface->GetBitmap(Point(), 
xDialogSurface->GetOutputSizePixel()));
 
     if (!aScreenshot.IsEmpty())
     {
diff --git a/toolkit/source/awt/vclxdevice.cxx 
b/toolkit/source/awt/vclxdevice.cxx
index 1da0957d77aa..711d014ef554 100644
--- a/toolkit/source/awt/vclxdevice.cxx
+++ b/toolkit/source/awt/vclxdevice.cxx
@@ -123,9 +123,9 @@ css::uno::Reference< css::awt::XBitmap > 
VCLXDevice::createBitmap( sal_Int32 nX,
     if( !mpOutputDevice )
         return nullptr;
 
-    BitmapEx aBmp = mpOutputDevice->GetBitmapEx( Point( nX, nY ), Size( 
nWidth, nHeight ) );
+    Bitmap aBmp = mpOutputDevice->GetBitmap( Point( nX, nY ), Size( nWidth, 
nHeight ) );
     rtl::Reference<VCLXBitmap> pBmp = new VCLXBitmap;
-    pBmp->SetBitmap( aBmp );
+    pBmp->SetBitmap( BitmapEx(aBmp) );
     return pBmp;
 }
 
diff --git a/toolkit/source/controls/table/gridtablerenderer.cxx 
b/toolkit/source/controls/table/gridtablerenderer.cxx
index aa49f4afddc1..93f94f60aeb7 100644
--- a/toolkit/source/controls/table/gridtablerenderer.cxx
+++ b/toolkit/source/controls/table/gridtablerenderer.cxx
@@ -93,7 +93,7 @@ namespace svt::table
                                  i_sortAscending ? SymbolType::SPIN_UP : 
SymbolType::SPIN_DOWN,
                                  i_style.GetActiveColor());
 
-            rBitmap = aDevice->GetBitmapEx(aBitmapPos, aBitmapSize);
+            rBitmap = aDevice->GetBitmap(aBitmapPos, aBitmapSize);
             m_lastHeaderHeight = i_headerHeight;
             m_lastArrowColor = i_style.GetActiveColor();
         }
diff --git a/vcl/backendtest/outputdevice/bitmap.cxx 
b/vcl/backendtest/outputdevice/bitmap.cxx
index 517be3968eb4..c548f7e9187c 100644
--- a/vcl/backendtest/outputdevice/bitmap.cxx
+++ b/vcl/backendtest/outputdevice/bitmap.cxx
@@ -172,7 +172,7 @@ BitmapEx 
OutputDeviceTestBitmap::setupDrawBlend(vcl::PixelFormat aBitmapFormat)
 
     mpVirtualDevice->DrawBitmapEx(aPoint, BitmapEx(aBitmap, aAlpha));
 
-    return mpVirtualDevice->GetBitmapEx(maVDRectangle.TopLeft(), 
maVDRectangle.GetSize());
+    return BitmapEx(mpVirtualDevice->GetBitmap(maVDRectangle.TopLeft(), 
maVDRectangle.GetSize()));
 }
 
 } // end namespace vcl::test
diff --git a/vcl/backendtest/outputdevice/polyline_b2d.cxx 
b/vcl/backendtest/outputdevice/polyline_b2d.cxx
index 1fa603d1eaa9..9117b792cf8d 100644
--- a/vcl/backendtest/outputdevice/polyline_b2d.cxx
+++ b/vcl/backendtest/outputdevice/polyline_b2d.cxx
@@ -52,7 +52,7 @@ Bitmap OutputDeviceTestPolyLineB2D::setupRectangle(bool 
bEnableAA)
     drawPolyLineOffset(*mpVirtualDevice, maVDRectangle, 2);
     drawPolyLineOffset(*mpVirtualDevice, maVDRectangle, 5);
 
-    return mpVirtualDevice->GetBitmapEx(maVDRectangle.TopLeft(), 
maVDRectangle.GetSize())
+    return BitmapEx(mpVirtualDevice->GetBitmap(maVDRectangle.TopLeft(), 
maVDRectangle.GetSize()))
         .GetBitmap();
 }
 
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index cffd42128252..bb08127af8e4 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -1329,7 +1329,7 @@ void JSComboBox::render_entry(int pos, int dpix, int dpiy)
 
     signal_custom_render(*pDevice, tools::Rectangle(Point(0, 0), aRenderSize), 
false, get_id(pos));
 
-    BitmapEx aImage = pDevice->GetBitmapEx(Point(0, 0), aRenderSize);
+    Bitmap aImage = pDevice->GetBitmap(Point(0, 0), aRenderSize);
 
     SvMemoryStream aOStm(65535, 65535);
     if (GraphicConverter::Export(aOStm, aImage, ConvertDataFormat::PNG) == 
ERRCODE_NONE)
diff --git a/vcl/qa/cppunit/BackendTest.cxx b/vcl/qa/cppunit/BackendTest.cxx
index d26248151fb7..71ed3f25fc52 100644
--- a/vcl/qa/cppunit/BackendTest.cxx
+++ b/vcl/qa/cppunit/BackendTest.cxx
@@ -55,7 +55,7 @@ class BackendTest : public test::BootstrapFixture
     {
         if (mbExportBitmap)
         {
-            BitmapEx aBitmapEx(device->GetBitmapEx(Point(0, 0), 
device->GetOutputSizePixel()));
+            BitmapEx aBitmapEx(device->GetBitmap(Point(0, 0), 
device->GetOutputSizePixel()));
             SvFileStream aStream(filename, StreamMode::WRITE | 
StreamMode::TRUNC);
             GraphicFilter::GetGraphicFilter().compressAsPNG(aBitmapEx, 
aStream);
         }
@@ -658,7 +658,7 @@ public:
         // Draw with no transformation, only alpha change.
         aMatrix.scale(16, 16);
         device->DrawTransformedBitmapEx(aMatrix, aBitmapEx, 0.5);
-        BitmapEx result = device->GetBitmapEx(Point(0, 0), Size(16, 16));
+        BitmapEx result(device->GetBitmap(Point(0, 0), Size(16, 16)));
         CPPUNIT_ASSERT_EQUAL(COL_GRAY, result.GetPixelColor(0, 0));
         CPPUNIT_ASSERT_EQUAL(COL_WHITE, result.GetPixelColor(15, 15));
         // Draw rotated and move to the bottom-left corner.
diff --git a/vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx 
b/vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx
index 65e0db417084..bcb10c198903 100644
--- a/vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx
+++ b/vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx
@@ -191,7 +191,7 @@ void BitmapRenderTest::testAlphaVirtualDevice()
                          pAlphaVirtualDevice->GetPixel(Point(1, 1)));
 
     // Get a BitmapEx from the VirDev -> Colors should have alpha
-    BitmapEx aBitmap = pAlphaVirtualDevice->GetBitmapEx(Point(), Size(4, 4));
+    BitmapEx 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()
 #endif
 
     // Read back the BitmapEx and check the opaque pixel
-    aBitmap = pAlphaVirtualDevice->GetBitmapEx(Point(), Size(4, 4));
+    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()
 #endif
 
     // Read back the BitmapEx and check the semi-transparent pixel
-    aBitmap = pAlphaVirtualDevice->GetBitmapEx(Point(), Size(4, 4));
+    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());
 
diff --git a/vcl/qa/cppunit/cjktext.cxx b/vcl/qa/cppunit/cjktext.cxx
index 847928c0d8e0..59ae66492885 100644
--- a/vcl/qa/cppunit/cjktext.cxx
+++ b/vcl/qa/cppunit/cjktext.cxx
@@ -30,7 +30,7 @@ class VclCjkTextTest : public test::BootstrapFixture
     {
         if (mbExportBitmap)
         {
-            BitmapEx aBitmapEx(device->GetBitmapEx(Point(0, 0), 
device->GetOutputSizePixel()));
+            BitmapEx aBitmapEx(device->GetBitmap(Point(0, 0), 
device->GetOutputSizePixel()));
             OUString cwd;
             CPPUNIT_ASSERT_EQUAL(osl_Process_E_None, 
osl_getProcessWorkingDir(&cwd.pData));
             OUString url;
diff --git a/vcl/qa/cppunit/svm/svmtest.cxx b/vcl/qa/cppunit/svm/svmtest.cxx
index 672ec07c7aac..5709a4d5d965 100644
--- a/vcl/qa/cppunit/svm/svmtest.cxx
+++ b/vcl/qa/cppunit/svm/svmtest.cxx
@@ -274,11 +274,11 @@ static void setupBaseVirtualDevice(VirtualDevice& 
rDevice, GDIMetaFile& rMeta)
 
 void SvmTest::checkRendering(ScopedVclPtrInstance<VirtualDevice> const & 
pVirtualDev, const GDIMetaFile& rMetaFile, const char * where)
 {
-    BitmapEx aSourceBitmapEx = pVirtualDev->GetBitmapEx(Point(), Size(10, 10));
+    BitmapEx aSourceBitmapEx( pVirtualDev->GetBitmap(Point(), Size(10, 10)) );
     ScopedVclPtrInstance<VirtualDevice> pVirtualDevResult;
     pVirtualDevResult->SetOutputSizePixel(Size(10, 10));
     const_cast<GDIMetaFile&>(rMetaFile).Play(*pVirtualDevResult);
-    BitmapEx aResultBitmapEx = pVirtualDevResult->GetBitmapEx(Point(), 
Size(10, 10));
+    BitmapEx aResultBitmapEx( pVirtualDevResult->GetBitmap(Point(), Size(10, 
10)) );
 
     const bool bWriteCompareBitmap = false;
 
diff --git a/vcl/qa/cppunit/text.cxx b/vcl/qa/cppunit/text.cxx
index 9832ba0dd831..c9a1be609977 100644
--- a/vcl/qa/cppunit/text.cxx
+++ b/vcl/qa/cppunit/text.cxx
@@ -32,7 +32,7 @@ public:
     {
         if (mbExportBitmap)
         {
-            BitmapEx aBitmapEx(device->GetBitmapEx(Point(0, 0), 
device->GetOutputSizePixel()));
+            BitmapEx aBitmapEx(device->GetBitmap(Point(0, 0), 
device->GetOutputSizePixel()));
             OUString cwd;
             CPPUNIT_ASSERT_EQUAL(osl_Process_E_None, 
osl_getProcessWorkingDir(&cwd.pData));
             OUString url;
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 4cdde27397ff..600c208c283a 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -858,7 +858,7 @@ Image createImage(const OUString& rImage)
 
 Image createImage(const VirtualDevice& rDevice)
 {
-    return Image(rDevice.GetBitmapEx(Point(), rDevice.GetOutputSizePixel()));
+    return Image(rDevice.GetBitmap(Point(), rDevice.GetOutputSizePixel()));
 }
 
 sal_uInt16 insert_to_menu(sal_uInt16 nLastId, PopupMenu* pMenu, int pos, const 
OUString& rId,
@@ -1456,7 +1456,7 @@ void SalInstanceWidget::DoRecursivePaint(vcl::Window* 
pWindow, const Point& rRen
         case OUTDEV_PRINTER:
         case OUTDEV_PDF:
             rOutput.DrawBitmapEx(rRenderLogicPos, aRenderLogicSize,
-                                 xOutput->GetBitmapEx(Point(), 
aTempLogicSize));
+                                 xOutput->GetBitmap(Point(), aTempLogicSize));
             break;
     }
 
diff --git a/vcl/source/bitmap/BitmapEx.cxx b/vcl/source/bitmap/BitmapEx.cxx
index 02da01d79b66..c248db8b9747 100644
--- a/vcl/source/bitmap/BitmapEx.cxx
+++ b/vcl/source/bitmap/BitmapEx.cxx
@@ -106,7 +106,7 @@ void BitmapEx::loadFromIconTheme( const OUString& rIconName 
)
 BitmapEx::BitmapEx( const Bitmap& rBmp ) :
         maBitmapSize ( rBmp.GetSizePixel() )
 {
-    if (rBmp.getPixelFormat() == vcl::PixelFormat::N32_BPP)
+    if (rBmp.HasAlpha())
     {
         std::pair<Bitmap, AlphaMask> aPair = rBmp.SplitIntoColorAndAlpha();
         maBitmap = std::move(aPair.first);
@@ -533,7 +533,7 @@ BitmapEx BitmapEx::AutoScaleBitmap(BitmapEx const & 
aBitmap, const tools::Long a
     aVirDevice->DrawRect( aRect );
     Point aPointPixel( static_cast<tools::Long>(imgposX), 
static_cast<tools::Long>(imgposY) );
     aVirDevice->DrawBitmapEx( aPointPixel, aRet );
-    aRet = aVirDevice->GetBitmapEx( aEmptyPoint, aStdSize );
+    aRet = aVirDevice->GetBitmap( aEmptyPoint, aStdSize );
 
     return aRet;
 }
diff --git a/vcl/source/filter/graphicfilter.cxx 
b/vcl/source/filter/graphicfilter.cxx
index 9db38b9e571e..72e65988cefa 100644
--- a/vcl/source/filter/graphicfilter.cxx
+++ b/vcl/source/filter/graphicfilter.cxx
@@ -1603,7 +1603,7 @@ ErrCode GraphicFilter::ExportGraphic( const Graphic& 
rGraphic, std::u16string_vi
             Graphic aGraphic2=aGraphic;
             aGraphic2.Draw(*aVirDev, Point(0, 0), aSizePixel); // this changes 
the MapMode
             aVirDev->SetMapMode(MapMode(MapUnit::MapPixel));
-            aGraphic=Graphic(aVirDev->GetBitmapEx(Point(0,0),aSizePixel));
+            aGraphic=Graphic(aVirDev->GetBitmap(Point(0,0),aSizePixel));
         }
     }
     if( rOStm.GetError() )
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index 6ad0813c96ef..3b4b1e3aaabd 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -2324,7 +2324,7 @@ bool GDIMetaFile::CreateThumbnail(BitmapEx& rBitmapEx, 
BmpConversion eColorConve
         const_cast<GDIMetaFile *>(this)->Play(*aVDev, Point(), aAntialias);
 
         // get paint bitmap
-        BitmapEx aBitmap( aVDev->GetBitmapEx( aNullPt, 
aVDev->GetOutputSizePixel() ) );
+        BitmapEx aBitmap( aVDev->GetBitmap( aNullPt, 
aVDev->GetOutputSizePixel() ) );
 
         // scale down the image to the desired size - use the input scaler for 
the scaling operation
         aBitmap.Scale(aDrawSize, nScaleFlag);
diff --git a/vcl/source/gdi/graph.cxx b/vcl/source/gdi/graph.cxx
index 4efb09a1c7cb..e9e641f1524e 100644
--- a/vcl/source/gdi/graph.cxx
+++ b/vcl/source/gdi/graph.cxx
@@ -194,6 +194,11 @@ Graphic::Graphic(const BitmapEx& rBitmapEx)
 {
 }
 
+Graphic::Graphic(const Bitmap& rBitmap)
+    : mxImpGraphic(new ImpGraphic(BitmapEx(rBitmap)))
+{
+}
+
 // We use XGraphic for passing toolbar images across app UNO aps
 // and we need to be able to see and preserve 'stock' images too.
 Graphic::Graphic(const Image& rImage)
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index a6afc521b72a..e20db1118929 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -643,7 +643,7 @@ Bitmap ImpGraphic::getBitmap(const 
GraphicConversionParameters& rParameters) con
                 draw(*aVDev, Point(), aDrawSize);
 
                 // use maBitmapEx as local buffer for rendered metafile
-                const_cast<ImpGraphic*>(this)->maCachedBitmap = 
aVDev->GetBitmapEx( Point(), aVDev->GetOutputSizePixel() );
+                const_cast<ImpGraphic*>(this)->maCachedBitmap = 
aVDev->GetBitmap( Point(), aVDev->GetOutputSizePixel() );
             }
         }
 
diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx 
b/vcl/source/gdi/pdfwriter_impl2.cxx
index 61452c17415c..75990fdcb4b4 100644
--- a/vcl/source/gdi/pdfwriter_impl2.cxx
+++ b/vcl/source/gdi/pdfwriter_impl2.cxx
@@ -488,7 +488,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& 
i_rMtf, vcl::PDFExtOutDevDa
                                 aTmpMtf.Play(*xVDev, aPoint, aDstSize);
                                 aTmpMtf.WindStart();
                                 xVDev->EnableMapMode( false );
-                                BitmapEx aPaint = xVDev->GetBitmapEx(aPoint, 
xVDev->GetOutputSizePixel());
+                                BitmapEx aPaint(xVDev->GetBitmap(aPoint, 
xVDev->GetOutputSizePixel()));
                                 xVDev->EnableMapMode( bVDevOldMap ); // 
#i35331#: MUST NOT use EnableMapMode( sal_True ) here!
 
                                 // create alpha mask from gradient
diff --git a/vcl/source/image/Image.cxx b/vcl/source/image/Image.cxx
index d0e3657499b0..6340af708641 100644
--- a/vcl/source/image/Image.cxx
+++ b/vcl/source/image/Image.cxx
@@ -38,6 +38,11 @@ Image::Image(const BitmapEx& rBitmapEx)
     ImplInit(rBitmapEx);
 }
 
+Image::Image(const Bitmap& rBitmap)
+{
+    ImplInit(BitmapEx(rBitmap));
+}
+
 Image::Image(uno::Reference<graphic::XGraphic> const & rxGraphic)
 {
     if (rxGraphic.is())
diff --git a/vcl/source/image/ImplImage.cxx b/vcl/source/image/ImplImage.cxx
index 94b35f9e75cd..4b211e4c5d21 100644
--- a/vcl/source/image/ImplImage.cxx
+++ b/vcl/source/image/ImplImage.cxx
@@ -188,7 +188,7 @@ BitmapEx const & ImplImage::getBitmapExForHiDPI(bool 
bDisabled, SalGraphics* pGr
                 aVDev->SetOutputSizePixel(aTarget, true, 
bAlphaMaskTransparent);
                 mxMetaFile->WindStart();
                 mxMetaFile->Play(*aVDev, Point(), aTarget);
-                maBitmapEx = aVDev->GetBitmapEx(Point(), aTarget);
+                maBitmapEx = aVDev->GetBitmap(Point(), aTarget);
             }
         }
     }
diff --git a/vcl/source/outdev/bitmapex.cxx b/vcl/source/outdev/bitmapex.cxx
index 8e65756d58b9..2957cc4ea5e8 100644
--- a/vcl/source/outdev/bitmapex.cxx
+++ b/vcl/source/outdev/bitmapex.cxx
@@ -49,6 +49,24 @@ void OutputDevice::DrawBitmapEx( const Point& rDestPt,
                  MetaActionType::BMPEX);
 }
 
+void OutputDevice::DrawBitmapEx( const Point& rDestPt,
+                                 const Bitmap& rBitmap )
+{
+    assert(!is_double_buffered_window());
+
+    if( ImplIsRecordLayout() )
+        return;
+
+    if( !rBitmap.HasAlpha() )
+    {
+        DrawBitmap(rDestPt, rBitmap);
+    }
+
+    const Size aSizePx = rBitmap.GetSizePixel();
+    DrawBitmapEx(rDestPt, PixelToLogic(aSizePx), Point(), aSizePx, rBitmap,
+                 MetaActionType::BMPEX);
+}
+
 void OutputDevice::DrawBitmapEx( const Point& rDestPt, const Size& rDestSize,
                                  const BitmapEx& rBitmapEx )
 {
@@ -67,6 +85,24 @@ void OutputDevice::DrawBitmapEx( const Point& rDestPt, const 
Size& rDestSize,
                  rBitmapEx, MetaActionType::BMPEXSCALE);
 }
 
+void OutputDevice::DrawBitmapEx( const Point& rDestPt, const Size& rDestSize,
+                                 const Bitmap& rBitmap )
+{
+    assert(!is_double_buffered_window());
+
+    if( ImplIsRecordLayout() )
+        return;
+
+    if ( !rBitmap.HasAlpha() )
+    {
+        DrawBitmap(rDestPt, rDestSize, rBitmap);
+        return;
+    }
+
+    DrawBitmapEx(rDestPt, rDestSize, Point(), rBitmap.GetSizePixel(),
+                 rBitmap, MetaActionType::BMPEXSCALE);
+}
+
 void OutputDevice::DrawBitmapEx( const Point& rDestPt, const Size& rDestSize,
                                  const Point& rSrcPtPixel, const Size& 
rSrcSizePixel,
                                  const BitmapEx& rBitmapEx)
@@ -148,9 +184,64 @@ void OutputDevice::DrawBitmapEx( const Point& rDestPt, 
const Size& rDestSize,
     DrawDeviceBitmapEx(rDestPt, rDestSize, rSrcPtPixel, rSrcSizePixel, aBmpEx);
 }
 
-BitmapEx OutputDevice::GetBitmapEx( const Point& rSrcPt, const Size& rSize ) 
const
+void OutputDevice::DrawBitmapEx( const Point& rDestPt, const Size& rDestSize,
+                                 const Point& rSrcPtPixel, const Size& 
rSrcSizePixel,
+                                 const Bitmap& rBitmap, const MetaActionType 
nAction )
 {
-    return BitmapEx(GetBitmap( rSrcPt, rSize ));
+    assert(!is_double_buffered_window());
+
+    if( ImplIsRecordLayout() )
+        return;
+
+    if( !rBitmap.HasAlpha() )
+    {
+        DrawBitmap(rDestPt, rDestSize, rSrcPtPixel, rSrcSizePixel, rBitmap);
+        return;
+    }
+
+    if (RasterOp::Invert == meRasterOp)
+    {
+        DrawRect(tools::Rectangle(rDestPt, rDestSize));
+        return;
+    }
+
+    BitmapEx aBmpEx(vcl::drawmode::GetBitmapEx(BitmapEx(rBitmap), 
GetDrawMode()));
+
+    if (mpMetaFile)
+    {
+        switch(nAction)
+        {
+            case MetaActionType::BMPEX:
+                mpMetaFile->AddAction(new MetaBmpExAction(rDestPt, aBmpEx));
+                break;
+
+            case MetaActionType::BMPEXSCALE:
+                mpMetaFile->AddAction(new MetaBmpExScaleAction(rDestPt, 
rDestSize, aBmpEx));
+                break;
+
+            case MetaActionType::BMPEXSCALEPART:
+                mpMetaFile->AddAction(new MetaBmpExScalePartAction(rDestPt, 
rDestSize,
+                                                                   
rSrcPtPixel, rSrcSizePixel, aBmpEx));
+                break;
+
+            default:
+                break;
+        }
+    }
+
+    if (!IsDeviceOutputNecessary())
+        return;
+
+    if (!mpGraphics && !AcquireGraphics())
+        return;
+
+    if (mbInitClipRegion)
+        InitClipRegion();
+
+    if (mbOutputClipped)
+        return;
+
+    DrawDeviceBitmapEx(rDestPt, rDestSize, rSrcPtPixel, rSrcSizePixel, aBmpEx);
 }
 
 void OutputDevice::DrawDeviceBitmapEx( const Point& rDestPt, const Size& 
rDestSize,
diff --git a/vcl/source/outdev/outdev.cxx b/vcl/source/outdev/outdev.cxx
index 288d25ab8a3a..21fcae0543c7 100644
--- a/vcl/source/outdev/outdev.cxx
+++ b/vcl/source/outdev/outdev.cxx
@@ -463,7 +463,7 @@ void OutputDevice::DrawOutDev( const Point& rDestPt, const 
Size& rDestSize,
 
     if ( mpMetaFile )
     {
-        const BitmapEx aBmpEx(rOutDev.GetBitmapEx(rSrcPt, rSrcSize));
+        const BitmapEx aBmpEx(rOutDev.GetBitmap(rSrcPt, rSrcSize));
         mpMetaFile->AddAction(new MetaBmpExScaleAction(rDestPt, rDestSize, 
aBmpEx));
     }
 
diff --git a/vcl/source/outdev/textline.cxx b/vcl/source/outdev/textline.cxx
index 837870f7cd06..957f950dda8e 100644
--- a/vcl/source/outdev/textline.cxx
+++ b/vcl/source/outdev/textline.cxx
@@ -1076,7 +1076,7 @@ void OutputDevice::DrawWaveLine(const Point& rStartPos, 
const Point& rEndPos, to
             pVirtDev->Erase();
             pVirtDev->SetAntialiasing( AntialiasingFlags::Enable );
             pVirtDev->ImplDrawWaveLineBezier( 0, 0, nWordLength, 0, 
nWaveHeight, fOrientation, nLineWidth );
-            BitmapEx aBitmapEx(pVirtDev->GetBitmapEx(Point(0, 0), 
pVirtDev->GetOutputSize()));
+            BitmapEx aBitmapEx(pVirtDev->GetBitmap(Point(0, 0), 
pVirtDev->GetOutputSize()));
 
             // Ideally we don't need this block, but in the split rgb surface 
+ separate alpha surface
             // with Antialiasing enabled and the svp/cairo backend we get both 
surfaces antialiased
diff --git a/vcl/source/outdev/transparent.cxx 
b/vcl/source/outdev/transparent.cxx
index 2d8dd407fc0e..d8e193cd7b4e 100644
--- a/vcl/source/outdev/transparent.cxx
+++ b/vcl/source/outdev/transparent.cxx
@@ -620,7 +620,7 @@ void OutputDevice::DrawTransparent( const GDIMetaFile& 
rMtf, const Point& rPos,
                     // get content bitmap from buffer
                     xVDev->EnableMapMode(false);
 
-                    const BitmapEx aPaint(xVDev->GetBitmapEx(aPoint, 
xVDev->GetOutputSizePixel()));
+                    const BitmapEx aPaint(xVDev->GetBitmap(aPoint, 
xVDev->GetOutputSizePixel()));
 
                     // create alpha mask from gradient and get as Bitmap
                     xVDev->EnableMapMode(bBufferMapModeEnabled);
@@ -662,7 +662,7 @@ void OutputDevice::DrawTransparent( const GDIMetaFile& 
rMtf, const Point& rPos,
                     const_cast<GDIMetaFile&>(rMtf).Play(*xVDev, rMtfPos, 
rMtfSize);
                     const_cast<GDIMetaFile&>(rMtf).WindStart();
                     xVDev->EnableMapMode( false );
-                    BitmapEx aPaint = xVDev->GetBitmapEx(Point(), 
xVDev->GetOutputSizePixel());
+                    BitmapEx aPaint(xVDev->GetBitmap(Point(), 
xVDev->GetOutputSizePixel()));
                     xVDev->EnableMapMode( bVDevOldMap ); // #i35331#: MUST NOT 
use EnableMapMode( sal_True ) here!
 
                     // create alpha mask from gradient
diff --git a/vcl/source/outdev/wallpaper.cxx b/vcl/source/outdev/wallpaper.cxx
index 8d75d31ebecf..0dc451c2122e 100644
--- a/vcl/source/outdev/wallpaper.cxx
+++ b/vcl/source/outdev/wallpaper.cxx
@@ -165,7 +165,7 @@ void OutputDevice::DrawBitmapWallpaper( tools::Long nX, 
tools::Long nY,
                 aVDev->SetBackground( rWallpaper.GetColor() );
                 aVDev->SetOutputSizePixel( Size( nBmpWidth, nBmpHeight ) );
                 aVDev->DrawBitmapEx( Point(), aBmpEx );
-                aBmpEx = aVDev->GetBitmapEx( Point(), 
aVDev->GetOutputSizePixel() );
+                aBmpEx = aVDev->GetBitmap( Point(), 
aVDev->GetOutputSizePixel() );
             }
 
             bDrawColorBackground = true;
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index c16cde29d957..899498ee25bf 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -3113,7 +3113,7 @@ void 
VclDrawingArea::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter)
 
     Paint(*pDevice, aRect);
 
-    BitmapEx aImage = pDevice->GetBitmapEx(Point(0,0), aRenderSize);
+    Bitmap aImage = pDevice->GetBitmap(Point(0,0), aRenderSize);
     aImage.Scale(aOutputSize);
     rJsonWriter.put("imagewidth", aRenderSize.Width());
     rJsonWriter.put("imageheight", aRenderSize.Height());
diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index a26713ee8330..67ec9e229224 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -1535,7 +1535,7 @@ void Window::ImplPaintToDevice( OutputDevice* 
i_pTargetOutDev, const Point& i_rP
     pMaskedDevice->EnableRTL( IsRTLEnabled() );
     aMtf.WindStart();
     aMtf.Play(*pMaskedDevice);
-    BitmapEx aBmpEx( pMaskedDevice->GetBitmapEx( Point( 0, 0 ), 
aPaintRect.GetSize() ) );
+    Bitmap aBmpEx( pMaskedDevice->GetBitmap( Point( 0, 0 ), 
aPaintRect.GetSize() ) );
     i_pTargetOutDev->DrawBitmapEx( i_rPos, aBmpEx );
     // get rid of virtual device now so they don't pile up during recursive 
calls
     pMaskedDevice.disposeAndClear();
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 25267def4fdb..3f00b73a3a37 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -425,7 +425,7 @@ void PrintDialog::PrintPreviewWindow::preparePreviewBitmap()
     aMtf.Play(*pPrerenderVDev, Point(0, 0), aLogicSize);
 
     pPrerenderVDev->SetMapMode(MapMode(MapUnit::MapPixel));
-    maPreviewBitmap = pPrerenderVDev->GetBitmapEx(Point(0, 0), 
pPrerenderVDev->GetOutputSizePixel());
+    maPreviewBitmap = pPrerenderVDev->GetBitmap(Point(0, 0), 
pPrerenderVDev->GetOutputSizePixel());
 
     if(0.0 != fFactor)
     {
diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index d90e834bd5e6..c41ccc5ea056 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -4430,7 +4430,7 @@ public:
                 break;
             case OUTDEV_PRINTER:
             case OUTDEV_PDF:
-                rOutput.DrawBitmapEx(rPos, xOutput->GetBitmapEx(Point(), 
aSize));
+                rOutput.DrawBitmapEx(rPos, xOutput->GetBitmap(Point(), aSize));
                 break;
         }
 
diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx
index d5f4e126c41a..6ea0b82d0744 100644
--- a/vcl/workben/vcldemo.cxx
+++ b/vcl/workben/vcldemo.cxx
@@ -1082,7 +1082,7 @@ public:
             }
             else if (eType == RENDER_AS_BITMAPEX)
             {
-                BitmapEx 
aBitmapEx(pNested->GetBitmapEx(Point(0,0),aWhole.GetSize()));
+                BitmapEx 
aBitmapEx(pNested->GetBitmap(Point(0,0),aWhole.GetSize()));
                 rDev.DrawBitmapEx(r.TopLeft(), aBitmapEx);
             }
             else if (eType == RENDER_AS_OUTDEV ||

Reply via email to