[Libreoffice-commits] core.git: canvas/source drawinglayer/inc drawinglayer/source emfio/source forms/source framework/source include/vcl slideshow/source svx/source vcl/osx vcl/qa vcl/source vcl/unx vcl/workben

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Mon Apr 26 10:52:39 UTC 2021


 canvas/source/cairo/cairo_canvashelper.cxx                   |    2 
 canvas/source/directx/dx_vcltools.cxx                        |  220 +------
 canvas/source/vcl/bitmapbackbuffer.cxx                       |    2 
 canvas/source/vcl/canvasbitmaphelper.cxx                     |    2 
 canvas/source/vcl/spritehelper.cxx                           |   27 
 drawinglayer/inc/texture/texture3d.hxx                       |    1 
 drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx |   10 
 drawinglayer/source/texture/texture3d.cxx                    |   50 -
 drawinglayer/source/tools/wmfemfhelper.cxx                   |    2 
 emfio/source/reader/mtftools.cxx                             |    2 
 forms/source/component/imgprod.cxx                           |    2 
 framework/source/fwe/classes/addonsoptions.cxx               |    4 
 include/vcl/bitmapex.hxx                                     |   17 
 include/vcl/metaact.hxx                                      |    6 
 include/vcl/pdfwriter.hxx                                    |    2 
 slideshow/source/engine/shapes/gdimtftools.cxx               |    6 
 svx/source/dialog/_bmpmask.cxx                               |    6 
 svx/source/dialog/_contdlg.cxx                               |    4 
 svx/source/gallery2/galbrws2.cxx                             |    2 
 svx/source/gallery2/galctrl.cxx                              |    2 
 svx/source/svdraw/svdfmtf.cxx                                |    2 
 svx/source/tbxctrls/itemwin.cxx                              |    2 
 svx/source/xoutdev/xtabbtmp.cxx                              |    2 
 svx/source/xoutdev/xtabptrn.cxx                              |    2 
 vcl/osx/salinst.cxx                                          |   13 
 vcl/qa/cppunit/canvasbitmaptest.cxx                          |   20 
 vcl/source/animate/Animation.cxx                             |    2 
 vcl/source/bitmap/BitmapAlphaClampFilter.cxx                 |    2 
 vcl/source/bitmap/BitmapBasicMorphologyFilter.cxx            |    2 
 vcl/source/bitmap/BitmapDisabledImageFilter.cxx              |    2 
 vcl/source/bitmap/BitmapEx.cxx                               |  314 ++---------
 vcl/source/bitmap/BitmapFastScaleFilter.cxx                  |    4 
 vcl/source/bitmap/BitmapFilterStackBlur.cxx                  |    2 
 vcl/source/bitmap/BitmapTools.cxx                            |  121 +---
 vcl/source/bitmap/bitmapfilter.cxx                           |    2 
 vcl/source/bitmap/dibtools.cxx                               |    8 
 vcl/source/control/ivctrl.cxx                                |    2 
 vcl/source/filter/egif/egif.cxx                              |    2 
 vcl/source/filter/eps/eps.cxx                                |   10 
 vcl/source/filter/graphicfilter.cxx                          |    2 
 vcl/source/filter/png/pngwrite.cxx                           |   86 ---
 vcl/source/filter/wmf/emfwr.cxx                              |    6 
 vcl/source/filter/wmf/wmfwr.cxx                              |    6 
 vcl/source/gdi/gdimetafiletools.cxx                          |    2 
 vcl/source/gdi/gdimtf.cxx                                    |    2 
 vcl/source/gdi/impgraph.cxx                                  |    4 
 vcl/source/gdi/mtfxmldump.cxx                                |   20 
 vcl/source/gdi/pdfextoutdevdata.cxx                          |    7 
 vcl/source/gdi/pdfwriter.cxx                                 |    4 
 vcl/source/gdi/pdfwriter_impl.cxx                            |   52 -
 vcl/source/gdi/pdfwriter_impl.hxx                            |    4 
 vcl/source/gdi/pdfwriter_impl2.cxx                           |   21 
 vcl/source/gdi/print.cxx                                     |    5 
 vcl/source/gdi/print2.cxx                                    |   32 -
 vcl/source/graphic/GraphicID.cxx                             |    4 
 vcl/source/graphic/GraphicObject2.cxx                        |   11 
 vcl/source/graphic/UnoGraphic.cxx                            |    2 
 vcl/source/graphic/UnoGraphicTransformer.cxx                 |   19 
 vcl/source/helper/canvasbitmap.cxx                           |   28 
 vcl/source/image/Image.cxx                                   |    2 
 vcl/source/outdev/bitmap.cxx                                 |   29 -
 vcl/source/outdev/outdevstate.cxx                            |   12 
 vcl/source/outdev/wallpaper.cxx                              |    4 
 vcl/unx/generic/window/salframe.cxx                          |   18 
 vcl/workben/vcldemo.cxx                                      |    4 
 65 files changed, 344 insertions(+), 925 deletions(-)

New commits:
commit ddd2639a482befb4a3bf1f75a88e66c21a691b67
Author:     Noel Grandin <noel at peralex.com>
AuthorDate: Sat Feb 27 15:50:37 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Apr 26 12:51:58 2021 +0200

    drop mask from BitmapEx
    
    So that we have fewer cases to deal with when we transition to
    32-bit bitmaps.
    
    (*) rename maMask to maAlphaMask, since now it is only being used
    for alpha duties.
    (*) drop mbAlpha and mbTransparent to simplify state management,
    the only thing we need to check for alpha is if maAlphaMask is
    non-empty.
    
    Change-Id: I06252e38e950e846a94b4c2ba8ea763be17801fe
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111679
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/canvas/source/cairo/cairo_canvashelper.cxx b/canvas/source/cairo/cairo_canvashelper.cxx
index 9d9a8bdf9bb8..8e96fe5f9994 100644
--- a/canvas/source/cairo/cairo_canvashelper.cxx
+++ b/canvas/source/cairo/cairo_canvashelper.cxx
@@ -351,7 +351,7 @@ namespace cairocanvas
             // there's no pixmap for alpha bitmap. we might still
             // use rgb pixmap and only access alpha pixels the
             // slow way. now we just speedup rgb bitmaps
-            if( !aBmpEx.IsTransparent() && !aBmpEx.IsAlpha() )
+            if( !aBmpEx.IsAlpha() )
             {
                 pSurface = rSurfaceProvider->createSurface( aBitmap );
                 data = nullptr;
diff --git a/canvas/source/directx/dx_vcltools.cxx b/canvas/source/directx/dx_vcltools.cxx
index 5ed07159aba8..912adf8b0af2 100644
--- a/canvas/source/directx/dx_vcltools.cxx
+++ b/canvas/source/directx/dx_vcltools.cxx
@@ -131,7 +131,7 @@ namespace dxcanvas::tools
                 return false;
             }
 
-            /** Create a chunk of raw RGBA data GDI+ Bitmap from VCL BbitmapEX
+            /** Create a chunk of raw RGBA data GDI+ Bitmap from VCL BitmapEx
              */
             RawRGBABitmap bitmapFromVCLBitmapEx( const ::BitmapEx& rBmpEx )
             {
@@ -141,9 +141,9 @@ namespace dxcanvas::tools
                 // make the local bitmap copy unique, effectively
                 // duplicating the memory used)
 
-                ENSURE_OR_THROW( rBmpEx.IsTransparent(),
+                ENSURE_OR_THROW( rBmpEx.IsAlpha(),
                                   "::dxcanvas::tools::bitmapFromVCLBitmapEx(): "
-                                  "BmpEx not transparent" );
+                                  "BmpEx has no alpha" );
 
                 // convert transparent bitmap to 32bit RGBA
                 // ========================================
@@ -166,43 +166,41 @@ namespace dxcanvas::tools
                                   "::dxcanvas::tools::bitmapFromVCLBitmapEx(): "
                                   "Unable to acquire read access to bitmap" );
 
-                if (rBmpEx.IsAlpha() || rBmpEx.GetMask().getPixelFormat() == vcl::PixelFormat::N8_BPP)
-                {
-                    Bitmap aAlpha( rBmpEx.IsAlpha() ? rBmpEx.GetAlpha().GetBitmap() : rBmpEx.GetMask());
+                Bitmap aAlpha( rBmpEx.GetAlpha().GetBitmap() );
 
-                    Bitmap::ScopedReadAccess pAlphaReadAccess( aAlpha );
+                Bitmap::ScopedReadAccess pAlphaReadAccess( aAlpha );
 
-                    // By convention, the access buffer always has
-                    // one of the following formats:
+                // By convention, the access buffer always has
+                // one of the following formats:
 
-                    //    ScanlineFormat::N1BitMsbPal
-                    //    ScanlineFormat::N8BitPal
-                    //    ScanlineFormat::N24BitTcBgr
-                    //    ScanlineFormat::N32BitTcMask
+                //    ScanlineFormat::N1BitMsbPal
+                //    ScanlineFormat::N8BitPal
+                //    ScanlineFormat::N24BitTcBgr
+                //    ScanlineFormat::N32BitTcMask
 
-                    // and is always ScanlineFormat::BottomUp
+                // and is always ScanlineFormat::BottomUp
 
-                    // This is the way
-                    // WinSalBitmap::AcquireBuffer() sets up the
-                    // buffer
+                // This is the way
+                // WinSalBitmap::AcquireBuffer() sets up the
+                // buffer
 
-                    ENSURE_OR_THROW( pAlphaReadAccess.get() != nullptr,
-                                      "::dxcanvas::tools::bitmapFromVCLBitmapEx(): "
-                                      "Unable to acquire read access to alpha" );
+                ENSURE_OR_THROW( pAlphaReadAccess.get() != nullptr,
+                                "::dxcanvas::tools::bitmapFromVCLBitmapEx(): "
+                                "Unable to acquire read access to alpha" );
 
-                    ENSURE_OR_THROW( pAlphaReadAccess->GetScanlineFormat() == ScanlineFormat::N8BitPal,
-                                      "::dxcanvas::tools::bitmapFromVCLBitmapEx(): "
-                                      "Unsupported alpha scanline format" );
+                ENSURE_OR_THROW( pAlphaReadAccess->GetScanlineFormat() == ScanlineFormat::N8BitPal,
+                                "::dxcanvas::tools::bitmapFromVCLBitmapEx(): "
+                                "Unsupported alpha scanline format" );
 
-                    BitmapColor     aCol;
-                    sal_uInt8*      pCurrOutput(aBmpData.maBitmapData.data());
-                    int             x, y;
+                BitmapColor     aCol;
+                sal_uInt8*      pCurrOutput(aBmpData.maBitmapData.data());
+                int             x, y;
 
-                    for( y=0; y<nHeight; ++y )
+                for( y=0; y<nHeight; ++y )
+                {
+                    switch( pReadAccess->GetScanlineFormat() )
                     {
-                        switch( pReadAccess->GetScanlineFormat() )
-                        {
-                            case ScanlineFormat::N8BitPal:
+                        case ScanlineFormat::N8BitPal:
                             {
                                 Scanline pScan  = pReadAccess->GetScanline( y );
                                 Scanline pAScan = pAlphaReadAccess->GetScanline( y );
@@ -223,7 +221,7 @@ namespace dxcanvas::tools
                             }
                             break;
 
-                            case ScanlineFormat::N24BitTcBgr:
+                        case ScanlineFormat::N24BitTcBgr:
                             {
                                 Scanline pScan  = pReadAccess->GetScanline( y );
                                 Scanline pAScan = pAlphaReadAccess->GetScanline( y );
@@ -246,8 +244,8 @@ namespace dxcanvas::tools
                             // TODO(P2): Might be advantageous
                             // to hand-formulate the following
                             // formats, too.
-                            case ScanlineFormat::N1BitMsbPal:
-                            case ScanlineFormat::N32BitTcMask:
+                        case ScanlineFormat::N1BitMsbPal:
+                        case ScanlineFormat::N32BitTcMask:
                             {
                                 Scanline pAScan = pAlphaReadAccess->GetScanline( y );
 
@@ -270,149 +268,17 @@ namespace dxcanvas::tools
                             }
                             break;
 
-                            case ScanlineFormat::N1BitLsbPal:
-                            case ScanlineFormat::N24BitTcRgb:
-                            case ScanlineFormat::N32BitTcAbgr:
-                            case ScanlineFormat::N32BitTcArgb:
-                            case ScanlineFormat::N32BitTcBgra:
-                            case ScanlineFormat::N32BitTcRgba:
-                            default:
-                                ENSURE_OR_THROW( false,
-                                                  "::dxcanvas::tools::bitmapFromVCLBitmapEx(): "
-                                                  "Unexpected scanline format - has "
-                                                  "WinSalBitmap::AcquireBuffer() changed?" );
-                        }
-                    }
-                }
-                else
-                {
-                    Bitmap aMask( rBmpEx.GetMask() );
-
-                    Bitmap::ScopedReadAccess pMaskReadAccess( aMask );
-
-                    // By convention, the access buffer always has
-                    // one of the following formats:
-
-                    //    ScanlineFormat::N1BitMsbPal
-                    //    ScanlineFormat::N8BitPal
-                    //    ScanlineFormat::N24BitTcBgr
-                    //    ScanlineFormat::N32BitTcMask
-
-                    // and is always ScanlineFormat::BottomUp
-
-                    // This is the way
-                    // WinSalBitmap::AcquireBuffer() sets up the
-                    // buffer
-
-                    ENSURE_OR_THROW( pMaskReadAccess.get() != nullptr,
-                                      "::dxcanvas::tools::bitmapFromVCLBitmapEx(): "
-                                      "Unable to acquire read access to mask" );
-
-                    ENSURE_OR_THROW( pMaskReadAccess->GetScanlineFormat() == ScanlineFormat::N1BitMsbPal,
-                                      "::dxcanvas::tools::bitmapFromVCLBitmapEx(): "
-                                      "Unsupported mask scanline format" );
-
-                    BitmapColor     aCol;
-                    int             nCurrBit;
-                    const int       nMask( 1 );
-                    const int       nInitialBit(7);
-                    sal_uInt8*      pCurrOutput(aBmpData.maBitmapData.data());
-                    int             x, y;
-
-                    // mapping table, to get from mask index color to
-                    // alpha value (which depends on the mask's palette)
-                    sal_uInt8 aColorMap[2];
-
-                    const BitmapColor& rCol0( pMaskReadAccess->GetPaletteColor( 0 ) );
-                    const BitmapColor& rCol1( pMaskReadAccess->GetPaletteColor( 1 ) );
-
-                    // shortcut for true luminance calculation
-                    // (assumes that palette is grey-level). Note the
-                    // swapped the indices here, to account for the
-                    // fact that VCL's notion of alpha is inverted to
-                    // the rest of the world's.
-                    aColorMap[0] = rCol1.GetRed();
-                    aColorMap[1] = rCol0.GetRed();
-
-                    for( y=0; y<nHeight; ++y )
-                    {
-                        switch( pReadAccess->GetScanlineFormat() )
-                        {
-                            case ScanlineFormat::N8BitPal:
-                            {
-                                Scanline pScan  = pReadAccess->GetScanline( y );
-                                Scanline pMScan = pMaskReadAccess->GetScanline( y );
-
-                                for( x=0, nCurrBit=nInitialBit; x<nWidth; ++x )
-                                {
-                                    aCol = pReadAccess->GetPaletteColor( *pScan++ );
-
-                                    *pCurrOutput++ = aCol.GetBlue();
-                                    *pCurrOutput++ = aCol.GetGreen();
-                                    *pCurrOutput++ = aCol.GetRed();
-
-                                    *pCurrOutput++ = aColorMap[ (pMScan[ (x & ~7) >> 3 ] >> nCurrBit ) & nMask ];
-                                    nCurrBit = ((nCurrBit - 1) % 8) & 7;
-                                }
-                            }
-                            break;
-
-                            case ScanlineFormat::N24BitTcBgr:
-                            {
-                                Scanline pScan  = pReadAccess->GetScanline( y );
-                                Scanline pMScan = pMaskReadAccess->GetScanline( y );
-
-                                for( x=0, nCurrBit=nInitialBit; x<nWidth; ++x )
-                                {
-                                    // store as RGBA
-                                    *pCurrOutput++ = *pScan++;
-                                    *pCurrOutput++ = *pScan++;
-                                    *pCurrOutput++ = *pScan++;
-
-                                    *pCurrOutput++ = aColorMap[ (pMScan[ (x & ~7) >> 3 ] >> nCurrBit ) & nMask ];
-                                    nCurrBit = ((nCurrBit - 1) % 8) & 7;
-                                }
-                            }
-                            break;
-
-                            // TODO(P2): Might be advantageous
-                            // to hand-formulate the following
-                            // formats, too.
-                            case ScanlineFormat::N1BitMsbPal:
-                            case ScanlineFormat::N32BitTcMask:
-                            {
-                                Scanline pMScan = pMaskReadAccess->GetScanline( y );
-
-                                // using fallback for those
-                                // seldom formats
-                                for( x=0, nCurrBit=nInitialBit; x<nWidth; ++x )
-                                {
-                                    // yes. x and y are swapped on Get/SetPixel
-                                    aCol = pReadAccess->GetColor(y,x);
-
-                                    // store as RGBA
-                                    *pCurrOutput++ = aCol.GetBlue();
-                                    *pCurrOutput++ = aCol.GetGreen();
-                                    *pCurrOutput++ = aCol.GetRed();
-
-                                    *pCurrOutput++ = aColorMap[ (pMScan[ (x & ~7) >> 3 ] >> nCurrBit ) & nMask ];
-                                    nCurrBit = ((nCurrBit - 1) % 8) & 7;
-                                }
-                            }
-                            break;
-
-                            case ScanlineFormat::N1BitLsbPal:
-                            case ScanlineFormat::N24BitTcRgb:
-                            case ScanlineFormat::N32BitTcAbgr:
-                            case ScanlineFormat::N32BitTcArgb:
-                            case ScanlineFormat::N32BitTcBgra:
-                            case ScanlineFormat::N32BitTcRgba:
-                            default:
-                                ENSURE_OR_THROW( false,
-                                                  "::dxcanvas::tools::bitmapFromVCLBitmapEx(): "
-                                                  "Unexpected scanline format - has "
-                                                  "WinSalBitmap::AcquireBuffer() changed?" );
-                        }
+                        case ScanlineFormat::N1BitLsbPal:
+                        case ScanlineFormat::N24BitTcRgb:
+                        case ScanlineFormat::N32BitTcAbgr:
+                        case ScanlineFormat::N32BitTcArgb:
+                        case ScanlineFormat::N32BitTcBgra:
+                        case ScanlineFormat::N32BitTcRgba:
+                        default:
+                            ENSURE_OR_THROW( false,
+                                            "::dxcanvas::tools::bitmapFromVCLBitmapEx(): "
+                                            "Unexpected scanline format - has "
+                                            "WinSalBitmap::AcquireBuffer() changed?" );
                     }
                 }
 
@@ -422,7 +288,7 @@ namespace dxcanvas::tools
             bool drawVCLBitmapEx( const std::shared_ptr< Gdiplus::Graphics >& rGraphics,
                                   const ::BitmapEx&                               rBmpEx )
             {
-                if( !rBmpEx.IsTransparent() )
+                if( !rBmpEx.IsAlpha() )
                 {
                     Bitmap aBmp( rBmpEx.GetBitmap() );
                     return drawVCLBitmap( rGraphics, aBmp );
diff --git a/canvas/source/vcl/bitmapbackbuffer.cxx b/canvas/source/vcl/bitmapbackbuffer.cxx
index 337e0bae7c2e..d6f87e3c0e00 100644
--- a/canvas/source/vcl/bitmapbackbuffer.cxx
+++ b/canvas/source/vcl/bitmapbackbuffer.cxx
@@ -111,7 +111,7 @@ namespace vclcanvas
 
         // VDev not yet created, do it now. Create an alpha-VDev,
         // if bitmap has transparency.
-        mpVDev = maBitmap->IsTransparent() ?
+        mpVDev = maBitmap->IsAlpha() ?
             VclPtr<VirtualDevice>::Create( mrRefDevice, DeviceFormat::DEFAULT, DeviceFormat::DEFAULT ) :
             VclPtr<VirtualDevice>::Create( mrRefDevice );
 
diff --git a/canvas/source/vcl/canvasbitmaphelper.cxx b/canvas/source/vcl/canvasbitmaphelper.cxx
index dd1898486e8a..00dc8bf03734 100644
--- a/canvas/source/vcl/canvasbitmaphelper.cxx
+++ b/canvas/source/vcl/canvasbitmaphelper.cxx
@@ -53,7 +53,7 @@ namespace vclcanvas
         CanvasHelper::init( rDevice,
                             mpBackBuffer,
                             false,
-                            rBitmap.IsTransparent() );
+                            rBitmap.IsAlpha() );
     }
 
     void CanvasBitmapHelper::disposing()
diff --git a/canvas/source/vcl/spritehelper.cxx b/canvas/source/vcl/spritehelper.cxx
index 7f7035769db2..57b38a9a2815 100644
--- a/canvas/source/vcl/spritehelper.cxx
+++ b/canvas/source/vcl/spritehelper.cxx
@@ -81,10 +81,8 @@ namespace vclcanvas
     void SpriteHelper::redraw( OutputDevice&                rTargetSurface,
                                const ::basegfx::B2DPoint&   rPos,
                                bool&                        io_bSurfacesDirty,
-                               bool                         bBufferedUpdate ) const
+                               bool                         /*bBufferedUpdate*/ ) const
     {
-        (void)bBufferedUpdate; // not used on every platform
-
         if( !mpBackBuffer ||
             !mpBackBufferMask )
         {
@@ -145,31 +143,10 @@ namespace vclcanvas
                 BitmapEx aMask( mpBackBufferMask->getOutDev().GetBitmapEx( aEmptyPoint,
                                                                        aOutputSize ) );
 
-                // bitmasks are much faster than alphamasks on some platforms
-                // so convert to bitmask if useful
-                bool convertTo1Bpp = aMask.getPixelFormat() != vcl::PixelFormat::N1_BPP;
-#ifdef MACOSX
-                convertTo1Bpp = false;
-#endif
-                if( SkiaHelper::isVCLSkiaEnabled())
-                    convertTo1Bpp = false;
-
-                if( convertTo1Bpp )
-                {
-                    OSL_FAIL("CanvasCustomSprite::redraw(): Mask bitmap is not "
-                               "monochrome (performance!)");
-                    BitmapEx aMaskEx(aMask);
-                    BitmapFilter::Filter(aMaskEx, BitmapMonochromeFilter(255));
-                    aMask = aMaskEx.GetBitmap();
-                }
-
                 // Note: since we retrieved aBmp and aMask
                 // directly from an OutDev, it's already a
                 // 'display bitmap' on windows.
-                if (aMask.getPixelFormat() == vcl::PixelFormat::N1_BPP)
-                    maContent = BitmapEx( aBmp.GetBitmap(), aMask.GetBitmap() );
-                else
-                    maContent = BitmapEx( aBmp.GetBitmap(), AlphaMask( aMask.GetBitmap()) );
+                maContent = BitmapEx( aBmp.GetBitmap(), AlphaMask( aMask.GetBitmap()) );
             }
         }
 
diff --git a/drawinglayer/inc/texture/texture3d.hxx b/drawinglayer/inc/texture/texture3d.hxx
index 935fa09883f2..88d13ed03b7c 100644
--- a/drawinglayer/inc/texture/texture3d.hxx
+++ b/drawinglayer/inc/texture/texture3d.hxx
@@ -62,7 +62,6 @@ namespace drawinglayer::texture
             double                                      mfMulY;
 
             bool                                        mbIsAlpha : 1;
-            bool                                        mbIsTransparent : 1;
 
             // helpers
             bool impIsValid(const basegfx::B2DPoint& rUV, sal_Int32& rX, sal_Int32& rY) const;
diff --git a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
index 9c441dc0d876..ff0b830677a5 100644
--- a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
+++ b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
@@ -256,9 +256,9 @@ namespace drawinglayer::primitive2d
                         case Disposal::Not:
                         {
                             maVirtualDevice->DrawBitmapEx(rAnimationBitmap.maPositionPixel, rAnimationBitmap.maBitmapEx);
-                            Bitmap aMask = rAnimationBitmap.maBitmapEx.GetMask();
+                            Bitmap aAlphaMask = rAnimationBitmap.maBitmapEx.GetAlpha();
 
-                            if (aMask.IsEmpty())
+                            if (aAlphaMask.IsEmpty())
                             {
                                 const Point aEmpty;
                                 const ::tools::Rectangle aRect(aEmpty, maVirtualDeviceMask->GetOutputSizePixel());
@@ -267,7 +267,7 @@ namespace drawinglayer::primitive2d
                             }
                             else
                             {
-                                BitmapEx aExpandVisibilityMask(aMask, aMask);
+                                BitmapEx aExpandVisibilityMask(aAlphaMask, aAlphaMask);
                                 maVirtualDeviceMask->DrawBitmapEx(rAnimationBitmap.maPositionPixel, aExpandVisibilityMask);
                             }
 
@@ -276,7 +276,7 @@ namespace drawinglayer::primitive2d
                         case Disposal::Back:
                         {
                             // #i70772# react on no mask, for primitives, too.
-                            const Bitmap & rMask(rAnimationBitmap.maBitmapEx.GetMask());
+                            const Bitmap & rMask(rAnimationBitmap.maBitmapEx.GetAlpha());
                             const Bitmap & rContent(rAnimationBitmap.maBitmapEx.GetBitmap());
 
                             maVirtualDeviceMask->Erase();
@@ -300,7 +300,7 @@ namespace drawinglayer::primitive2d
                         case Disposal::Previous:
                         {
                             maVirtualDevice->DrawBitmapEx(rAnimationBitmap.maPositionPixel, rAnimationBitmap.maBitmapEx);
-                            BitmapEx aExpandVisibilityMask(rAnimationBitmap.maBitmapEx.GetMask(), rAnimationBitmap.maBitmapEx.GetMask());
+                            BitmapEx aExpandVisibilityMask(rAnimationBitmap.maBitmapEx.GetAlpha(), rAnimationBitmap.maBitmapEx.GetAlpha());
                             maVirtualDeviceMask->DrawBitmapEx(rAnimationBitmap.maPositionPixel, aExpandVisibilityMask);
                             break;
                         }
diff --git a/drawinglayer/source/texture/texture3d.cxx b/drawinglayer/source/texture/texture3d.cxx
index 99aa597589f7..589c23f5df16 100644
--- a/drawinglayer/source/texture/texture3d.cxx
+++ b/drawinglayer/source/texture/texture3d.cxx
@@ -66,26 +66,16 @@ namespace drawinglayer::texture
             maSize(rRange.getRange()),
             mfMulX(0.0),
             mfMulY(0.0),
-            mbIsAlpha(false),
-            mbIsTransparent(maBitmapEx.IsTransparent())
+            mbIsAlpha(maBitmapEx.IsAlpha())
         {
             if(vcl::bitmap::convertBitmap32To24Plus8(maBitmapEx,maBitmapEx))
-                mbIsTransparent = maBitmapEx.IsTransparent();
+                mbIsAlpha = maBitmapEx.IsAlpha();
             // #121194# Todo: use alpha channel, too (for 3d)
             maBitmap = maBitmapEx.GetBitmap();
 
-            if(mbIsTransparent)
+            if(mbIsAlpha)
             {
-                if(maBitmapEx.IsAlpha())
-                {
-                    mbIsAlpha = true;
-                    maTransparence = rBitmapEx.GetAlpha().GetBitmap();
-                }
-                else
-                {
-                    maTransparence = rBitmapEx.GetMask();
-                }
-
+                maTransparence = rBitmapEx.GetAlpha().GetBitmap();
                 mpReadTransparence = Bitmap::ScopedReadAccess(maTransparence);
             }
 
@@ -115,32 +105,12 @@ namespace drawinglayer::texture
 
         sal_uInt8 GeoTexSvxBitmapEx::impGetTransparence(sal_Int32 rX, sal_Int32 rY) const
         {
-            switch(maBitmapEx.GetTransparentType())
+            if(mbIsAlpha)
             {
-                case TransparentType::NONE:
-                {
-                    break;
-                }
-                case TransparentType::Bitmap:
-                {
-                    OSL_ENSURE(mpReadTransparence, "OOps, transparence type Bitmap, but no read access created in the constructor (?)");
-                    const BitmapColor aBitmapColor(mpReadTransparence->GetPixel(rY, rX));
-
-                    if(mbIsAlpha)
-                    {
-                        return aBitmapColor.GetIndex();
-                    }
-                    else
-                    {
-                        if(0x00 != aBitmapColor.GetIndex())
-                        {
-                            return 255;
-                        }
-                    }
-                    break;
-                }
+                OSL_ENSURE(mpReadTransparence, "OOps, transparence type Bitmap, but no read access created in the constructor (?)");
+                const BitmapColor aBitmapColor(mpReadTransparence->GetPixel(rY, rX));
+                return aBitmapColor.GetIndex();
             }
-
             return 0;
         }
 
@@ -176,7 +146,7 @@ namespace drawinglayer::texture
 
                 rBColor = aBSource;
 
-                if(mbIsTransparent)
+                if(mbIsAlpha)
                 {
                     // when we have a transparence, make use of it
                     const sal_uInt8 aLuminance(impGetTransparence(nX, nY));
@@ -200,7 +170,7 @@ namespace drawinglayer::texture
 
             if(impIsValid(rUV, nX, nY))
             {
-                if(mbIsTransparent)
+                if(mbIsAlpha)
                 {
                     // this texture has an alpha part, use it
                     const sal_uInt8 aLuminance(impGetTransparence(nX, nY));
diff --git a/drawinglayer/source/tools/wmfemfhelper.cxx b/drawinglayer/source/tools/wmfemfhelper.cxx
index 588dd9ea1cc5..8b3f3562e35b 100644
--- a/drawinglayer/source/tools/wmfemfhelper.cxx
+++ b/drawinglayer/source/tools/wmfemfhelper.cxx
@@ -996,7 +996,7 @@ namespace wmfemfhelper
 
         // if bitmap visualisation is transparent, maybe background
         // needs to be filled. Create background
-        if(aBitmapEx.IsTransparent()
+        if(aBitmapEx.IsAlpha()
             || (WallpaperStyle::Tile != eWallpaperStyle && WallpaperStyle::Scale != eWallpaperStyle))
         {
             if(rWallpaper.IsGradient())
diff --git a/emfio/source/reader/mtftools.cxx b/emfio/source/reader/mtftools.cxx
index dfb87611712b..4e325c10622e 100644
--- a/emfio/source/reader/mtftools.cxx
+++ b/emfio/source/reader/mtftools.cxx
@@ -1879,7 +1879,7 @@ namespace emfio
             vcl::bitmap::DrawAndClipBitmap(rPos, rSize, rBitmap, aBmpEx, maClipPath.getClipPath());
         }
 
-        if ( aBmpEx.IsTransparent() )
+        if ( aBmpEx.IsAlpha() )
             mpGDIMetaFile->AddAction( new MetaBmpExScaleAction( rPos, rSize, aBmpEx ) );
         else
             mpGDIMetaFile->AddAction( new MetaBmpScaleAction( rPos, rSize, aBmpEx.GetBitmap() ) );
diff --git a/forms/source/component/imgprod.cxx b/forms/source/component/imgprod.cxx
index 9bbf54b388ae..5446b2082af7 100644
--- a/forms/source/component/imgprod.cxx
+++ b/forms/source/component/imgprod.cxx
@@ -363,7 +363,7 @@ void ImageProducer::ImplUpdateConsumer( const Graphic& rGraphic )
     if( !pBmpAcc )
         return;
 
-    Bitmap              aMask( aBmpEx.GetMask() );
+    Bitmap              aMask( aBmpEx.GetAlpha() );
     BitmapReadAccess*   pMskAcc = !aMask.IsEmpty() ? aMask.AcquireReadAccess() : nullptr;
     const tools::Long          nWidth = pBmpAcc->Width();
     const tools::Long          nHeight = pBmpAcc->Height();
diff --git a/framework/source/fwe/classes/addonsoptions.cxx b/framework/source/fwe/classes/addonsoptions.cxx
index 93076e20d707..fad4fc858fdd 100644
--- a/framework/source/fwe/classes/addonsoptions.cxx
+++ b/framework/source/fwe/classes/addonsoptions.cxx
@@ -1586,7 +1586,7 @@ BitmapEx AddonsOptions_Impl::ReadImageFromURL(const OUString& aImageURL)
         if ( !aBmpSize.IsEmpty() )
         {
             // Support non-transparent bitmaps to be downward compatible with OOo 1.1.x addons
-            if( !aBitmapEx.IsTransparent() )
+            if( !aBitmapEx.IsAlpha() )
                 aBitmapEx = BitmapEx( aBitmapEx.GetBitmap(), COL_LIGHTMAGENTA );
 
             aImage = aBitmapEx;
@@ -1675,7 +1675,7 @@ bool AddonsOptions_Impl::CreateImageFromSequence( BitmapEx& rImage, Sequence< sa
 
         ReadDIBBitmapEx(rImage, aMemStream);
 
-        if( !rImage.IsTransparent() )
+        if( !rImage.IsAlpha() )
         {
             // Support non-transparent bitmaps to be downward compatible with OOo 1.1.x addons
             rImage = BitmapEx( rImage.GetBitmap(), COL_LIGHTMAGENTA );
diff --git a/include/vcl/bitmapex.hxx b/include/vcl/bitmapex.hxx
index 707b9ade9ec2..7225a5fe7385 100644
--- a/include/vcl/bitmapex.hxx
+++ b/include/vcl/bitmapex.hxx
@@ -34,13 +34,6 @@ namespace com::sun::star::rendering {
 namespace com::sun::star::uno { template <class interface_type> class Reference; }
 namespace basegfx { class BColorModifierStack; }
 
-enum class TransparentType
-{
-    NONE = 0,
-    // Color = 1, Never actually used in BitmapEx, only present for backwards compat with existing SVM files
-    Bitmap = 2
-};
-
 class SAL_WARN_UNUSED VCL_DLLPUBLIC BitmapEx
 {
 public:
@@ -69,13 +62,9 @@ public:
     void                Draw( OutputDevice* pOutDev,
                               const Point& rDestPt, const Size& rDestSize ) const;
 
-    bool                IsTransparent() const;
-    TransparentType     GetTransparentType() const { return meTransparent; }
-
     Bitmap              GetBitmap( Color aTransparentReplaceColor ) const;
     /// Gives direct access to the contained bitmap.
     const Bitmap&       GetBitmap() const;
-    Bitmap              GetMask() const;
 
     bool                IsAlpha() const;
     AlphaMask           GetAlpha() const;
@@ -459,7 +448,6 @@ public:
                             sal_uInt32& rnWidth, sal_uInt32& rnHeight, sal_uInt8& rnBitCount);
 
     SAL_DLLPRIVATE std::shared_ptr<SalBitmap> const & ImplGetBitmapSalBitmap() const { return maBitmap.ImplGetSalBitmap(); }
-    SAL_DLLPRIVATE std::shared_ptr<SalBitmap> const & ImplGetMaskSalBitmap() const { return maMask.ImplGetSalBitmap(); }
 
 
 private:
@@ -474,11 +462,8 @@ private:
     void  loadFromIconTheme( const OUString& rIconName );
 
     Bitmap              maBitmap;
-    Bitmap              maMask;
+    Bitmap              maAlphaMask;
     Size                maBitmapSize;
-    TransparentType     meTransparent;
-    bool                mbAlpha;
-
 };
 
 
diff --git a/include/vcl/metaact.hxx b/include/vcl/metaact.hxx
index 69552a2bbf95..ef99f7f82ae1 100644
--- a/include/vcl/metaact.hxx
+++ b/include/vcl/metaact.hxx
@@ -775,7 +775,7 @@ public:
 
     const BitmapEx&     GetBitmapEx() const { return maBmpEx; }
     const Point&        GetPoint() const { return maPt; }
-    bool                IsTransparent() const override { return GetBitmapEx().IsTransparent(); }
+    bool                IsTransparent() const override { return GetBitmapEx().IsAlpha(); }
 };
 
 class VCL_DLLPUBLIC MetaBmpExScaleAction final : public MetaAction
@@ -809,7 +809,7 @@ public:
     const BitmapEx&     GetBitmapEx() const { return maBmpEx; }
     const Point&        GetPoint() const { return maPt; }
     const Size&         GetSize() const { return maSz; }
-    bool                IsTransparent() const override { return GetBitmapEx().IsTransparent(); }
+    bool                IsTransparent() const override { return GetBitmapEx().IsAlpha(); }
 };
 
 class UNLESS_MERGELIBS(VCL_DLLPUBLIC) MetaBmpExScalePartAction final : public MetaAction
@@ -848,7 +848,7 @@ public:
     const Size&         GetDestSize() const { return maDstSz; }
     const Point&        GetSrcPoint() const { return maSrcPt; }
     const Size&         GetSrcSize() const { return maSrcSz; }
-    bool                IsTransparent() const override { return GetBitmapEx().IsTransparent(); }
+    bool                IsTransparent() const override { return GetBitmapEx().IsAlpha(); }
 };
 
 class SAL_DLLPUBLIC_RTTI MetaMaskAction final : public MetaAction
diff --git a/include/vcl/pdfwriter.hxx b/include/vcl/pdfwriter.hxx
index f7010910299a..fc28a009dd54 100644
--- a/include/vcl/pdfwriter.hxx
+++ b/include/vcl/pdfwriter.hxx
@@ -847,7 +847,7 @@ The following structure describes the permissions used in PDF security
     the same pixel size as the image and
     be either 1 bit black&white or 8 bit grey
     */
-    void                DrawJPGBitmap( SvStream& rJPGData, bool bIsTrueColor, const Size& rSrcSizePixel, const tools::Rectangle& rTargetArea, const Bitmap& rMask, const Graphic& rGraphic );
+    void                DrawJPGBitmap( SvStream& rJPGData, bool bIsTrueColor, const Size& rSrcSizePixel, const tools::Rectangle& rTargetArea, const AlphaMask& rAlphaMask, const Graphic& rGraphic );
 
     /** Create a new named destination to be used in a link from another PDF document
 
diff --git a/slideshow/source/engine/shapes/gdimtftools.cxx b/slideshow/source/engine/shapes/gdimtftools.cxx
index e3d22e5033f2..dfb33d95f38c 100644
--- a/slideshow/source/engine/shapes/gdimtftools.cxx
+++ b/slideshow/source/engine/shapes/gdimtftools.cxx
@@ -289,7 +289,7 @@ bool getAnimationFromGraphic( VectorOfMtfAnimationFrames&   o_rFrames,
             {
                 pVDev->DrawBitmapEx(rAnimationBitmap.maPositionPixel,
                                     rAnimationBitmap.maBitmapEx);
-                Bitmap aMask = rAnimationBitmap.maBitmapEx.GetMask();
+                Bitmap aMask = rAnimationBitmap.maBitmapEx.GetAlpha();
 
                 if( aMask.IsEmpty() )
                 {
@@ -311,7 +311,7 @@ bool getAnimationFromGraphic( VectorOfMtfAnimationFrames&   o_rFrames,
             case Disposal::Back:
             {
                 // #i70772# react on no mask
-                const Bitmap aMask(rAnimationBitmap.maBitmapEx.GetMask());
+                const Bitmap aMask(rAnimationBitmap.maBitmapEx.GetAlpha());
                 const Bitmap & rContent(rAnimationBitmap.maBitmapEx.GetBitmap());
 
                 pVDevMask->Erase();
@@ -336,7 +336,7 @@ bool getAnimationFromGraphic( VectorOfMtfAnimationFrames&   o_rFrames,
                 pVDev->DrawBitmapEx(rAnimationBitmap.maPositionPixel,
                                     rAnimationBitmap.maBitmapEx);
                 pVDevMask->DrawBitmap(rAnimationBitmap.maPositionPixel,
-                                      rAnimationBitmap.maBitmapEx.GetMask());
+                                      rAnimationBitmap.maBitmapEx.GetAlpha());
                 break;
             }
         }
diff --git a/svx/source/dialog/_bmpmask.cxx b/svx/source/dialog/_bmpmask.cxx
index 2515a8850408..a74e6273d4e2 100644
--- a/svx/source/dialog/_bmpmask.cxx
+++ b/svx/source/dialog/_bmpmask.cxx
@@ -614,8 +614,8 @@ BitmapEx SvxBmpMask::ImpMaskTransparent( const BitmapEx& rBitmapEx, const Color&
     BitmapEx    aBmpEx;
     Bitmap      aMask( rBitmapEx.GetBitmap().CreateMask( rColor, nTol ) );
 
-    if( rBitmapEx.IsTransparent() )
-        aMask.CombineSimple( rBitmapEx.GetMask(), BmpCombine::Or );
+    if( rBitmapEx.IsAlpha() )
+        aMask.CombineSimple( rBitmapEx.GetAlpha(), BmpCombine::Or );
 
     aBmpEx = BitmapEx( rBitmapEx.GetBitmap(), aMask );
     LeaveWait();
@@ -995,7 +995,7 @@ Graphic SvxBmpMask::Mask( const Graphic& rGraphic )
                         {
                             ImpMask( aBitmapEx );
                             if ( aGraphic.IsTransparent() )
-                                aGraphic = Graphic( BitmapEx( aBitmapEx.GetBitmap(), aBitmapEx.GetMask() ) );
+                                aGraphic = Graphic( BitmapEx( aBitmapEx.GetBitmap(), aBitmapEx.GetAlpha() ) );
                             else
                                 aGraphic = aBitmapEx;
                         }
diff --git a/svx/source/dialog/_contdlg.cxx b/svx/source/dialog/_contdlg.cxx
index bba90c16a1a0..616f8774050d 100644
--- a/svx/source/dialog/_contdlg.cxx
+++ b/svx/source/dialog/_contdlg.cxx
@@ -115,7 +115,7 @@ tools::PolyPolygon SvxContourDlg::CreateAutoContour( const Graphic& rGraphic,
             }
         }
         else if( rGraphic.IsTransparent() )
-            aBmp = rGraphic.GetBitmapEx().GetMask();
+            aBmp = rGraphic.GetBitmapEx().GetAlpha();
         else
         {
             aBmp = rGraphic.GetBitmapEx().GetBitmap();
@@ -634,7 +634,7 @@ IMPL_LINK( SvxSuperContourDlg, PipetteClickHdl, ContourWindow&, rWnd, void )
             Bitmap aMask = aGraphic.GetBitmapEx().GetBitmap().CreateMask( rColor, nTol );
 
             if( aGraphic.IsTransparent() )
-                aMask.CombineSimple( aGraphic.GetBitmapEx().GetMask(), BmpCombine::Or );
+                aMask.CombineSimple( aGraphic.GetBitmapEx().GetAlpha(), BmpCombine::Or );
 
             if( !aMask.IsEmpty() )
             {
diff --git a/svx/source/gallery2/galbrws2.cxx b/svx/source/gallery2/galbrws2.cxx
index 1d388203a2a9..cd3d943ec5e4 100644
--- a/svx/source/gallery2/galbrws2.cxx
+++ b/svx/source/gallery2/galbrws2.cxx
@@ -869,7 +869,7 @@ void GalleryBrowser2::UpdateRows(bool bVisibleOnly)
 
             mxDev->Erase();
 
-            if (aBitmapEx.IsTransparent())
+            if (aBitmapEx.IsAlpha())
             {
                 // draw checkered background
                 GalleryIconView::drawTransparenceBackground(*mxDev, aPos, aBitmapExSizePixel);
diff --git a/svx/source/gallery2/galctrl.cxx b/svx/source/gallery2/galctrl.cxx
index 78da9c640cf1..819f115cf3f4 100644
--- a/svx/source/gallery2/galctrl.cxx
+++ b/svx/source/gallery2/galctrl.cxx
@@ -357,7 +357,7 @@ void GalleryIconView::UserDraw(const UserDrawEvent& rUDEvt)
             ((aSize.Height() - aBitmapExSizePixel.Height()) >> 1) + rRect.Top());
         OutputDevice* pDev = rUDEvt.GetRenderContext();
 
-        if(aBitmapEx.IsTransparent())
+        if(aBitmapEx.IsAlpha())
         {
             // draw checkered background for full rectangle.
             GalleryIconView::drawTransparenceBackground(*pDev, rRect.TopLeft(), rRect.GetSize());
diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx
index 5f8185f93325..eb60ff92fa56 100644
--- a/svx/source/svdraw/svdfmtf.cxx
+++ b/svx/source/svdraw/svdfmtf.cxx
@@ -1609,7 +1609,7 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaFloatTransparentAction const & rAct)
 
     if(bHasNewMask || bFixedTransparence)
     {
-        if(!aBitmapEx.IsAlpha() && !aBitmapEx.IsTransparent())
+        if(!aBitmapEx.IsAlpha())
         {
             // no transparence yet, apply new one
             if(bFixedTransparence)
diff --git a/svx/source/tbxctrls/itemwin.cxx b/svx/source/tbxctrls/itemwin.cxx
index 89a428986efd..f9612fe008d7 100644
--- a/svx/source/tbxctrls/itemwin.cxx
+++ b/svx/source/tbxctrls/itemwin.cxx
@@ -197,7 +197,7 @@ namespace
         ScopedVclPtrInstance< VirtualDevice > pVirtualDevice;
         pVirtualDevice->SetOutputSizePixel(rSize);
 
-        if(rBitmapEx.IsTransparent())
+        if(rBitmapEx.IsAlpha())
         {
             const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
 
diff --git a/svx/source/xoutdev/xtabbtmp.cxx b/svx/source/xoutdev/xtabbtmp.cxx
index 2d3adb4c067e..fd1b7dfdadb7 100644
--- a/svx/source/xoutdev/xtabbtmp.cxx
+++ b/svx/source/xoutdev/xtabbtmp.cxx
@@ -54,7 +54,7 @@ BitmapEx XBitmapList::CreateBitmap( tools::Long nIndex, const Size& rSize ) cons
         ScopedVclPtrInstance< VirtualDevice > pVirtualDevice;
         pVirtualDevice->SetOutputSizePixel(rSize);
 
-        if(rBitmapEx.IsTransparent())
+        if(rBitmapEx.IsAlpha())
         {
             const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
 
diff --git a/svx/source/xoutdev/xtabptrn.cxx b/svx/source/xoutdev/xtabptrn.cxx
index 96e1d4b919c3..8d461167a87a 100644
--- a/svx/source/xoutdev/xtabptrn.cxx
+++ b/svx/source/xoutdev/xtabptrn.cxx
@@ -89,7 +89,7 @@ BitmapEx XPatternList::CreateBitmap( tools::Long nIndex, const Size& rSize ) con
         ScopedVclPtrInstance< VirtualDevice > pVirtualDevice;
         pVirtualDevice->SetOutputSizePixel(rSize);
 
-        if(rBitmapEx.IsTransparent())
+        if(rBitmapEx.IsAlpha())
         {
             const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
 
diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx
index 85651e2079e9..75aea4d5415a 100644
--- a/vcl/osx/salinst.cxx
+++ b/vcl/osx/salinst.cxx
@@ -911,9 +911,9 @@ CGImageRef CreateCGImage( const Image& rImage )
         return nullptr;
 
     CGImageRef xImage = nullptr;
-    if( ! (aBmpEx.IsAlpha() || aBmpEx.IsTransparent() ) )
+    if( !aBmpEx.IsAlpha() )
         xImage = pSalBmp->CreateCroppedImage( 0, 0, pSalBmp->mnWidth, pSalBmp->mnHeight );
-    else if( aBmpEx.IsAlpha() )
+    else
     {
         AlphaMask aAlphaMask( aBmpEx.GetAlpha() );
         Bitmap aMask( aAlphaMask.GetBitmap() );
@@ -923,15 +923,6 @@ CGImageRef CreateCGImage( const Image& rImage )
         else
             xImage = pSalBmp->CreateCroppedImage( 0, 0, pSalBmp->mnWidth, pSalBmp->mnHeight );
     }
-    else if( aBmpEx.GetTransparentType() == TransparentType::Bitmap )
-    {
-        Bitmap aMask( aBmpEx.GetMask() );
-        QuartzSalBitmap* pMaskBmp = static_cast<QuartzSalBitmap*>(aMask.ImplGetSalBitmap().get());
-        if( pMaskBmp )
-            xImage = pSalBmp->CreateWithMask( *pMaskBmp, 0, 0, pSalBmp->mnWidth, pSalBmp->mnHeight );
-        else
-            xImage = pSalBmp->CreateCroppedImage( 0, 0, pSalBmp->mnWidth, pSalBmp->mnHeight );
-    }
 
     return xImage;
 }
diff --git a/vcl/qa/cppunit/canvasbitmaptest.cxx b/vcl/qa/cppunit/canvasbitmaptest.cxx
index a1185ab1f7ad..d77599e7b8a4 100644
--- a/vcl/qa/cppunit/canvasbitmaptest.cxx
+++ b/vcl/qa/cppunit/canvasbitmaptest.cxx
@@ -102,7 +102,7 @@ void checkCanvasBitmap( const rtl::Reference<VclCanvasBitmap>& xBmp,
                             sal_Int32(200), xBmp->getSize().Height);
 
     CPPUNIT_ASSERT_EQUAL_MESSAGE( "alpha state mismatch",
-                            aContainedBmpEx.IsTransparent(), bool(xBmp->hasAlpha()));
+                            aContainedBmpEx.IsAlpha(), bool(xBmp->hasAlpha()));
 
     CPPUNIT_ASSERT_MESSAGE( "getScaledBitmap() failed",
                             xBmp->getScaledBitmap( geometry::RealSize2D(500,500), false ).is());
@@ -111,7 +111,7 @@ void checkCanvasBitmap( const rtl::Reference<VclCanvasBitmap>& xBmp,
     uno::Sequence<sal_Int8> aPixelData = xBmp->getData(aLayout, geometry::IntegerRectangle2D(0,0,1,1));
 
     const sal_Int32 nExpectedBitsPerPixel(
-        (aContainedBmpEx.IsTransparent() ? std::max(8,nDepth)+8 : nDepth) + extraBpp);
+        (aContainedBmpEx.IsAlpha() ? std::max(8,nDepth)+8 : nDepth) + extraBpp);
     CPPUNIT_ASSERT_EQUAL_MESSAGE( "# scanlines not 1",
                             static_cast<sal_Int32>(1), aLayout.ScanLines);
     CPPUNIT_ASSERT_EQUAL_MESSAGE( "# scanline bytes mismatch",
@@ -164,7 +164,7 @@ void checkCanvasBitmap( const rtl::Reference<VclCanvasBitmap>& xBmp,
         "First pixel is not white", 1.0, pRGBStart[0].Blue, 1E-12);
     CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
         "Second pixel is not opaque", 1.0, pARGBStart[1].Alpha, 1E-12);
-    if( aContainedBmpEx.IsTransparent() )
+    if( aContainedBmpEx.IsAlpha() )
     {
         CPPUNIT_ASSERT_EQUAL_MESSAGE( "First pixel is not fully transparent",
                                 0.0, pARGBStart[0].Alpha);
@@ -235,7 +235,7 @@ void checkCanvasBitmap( const rtl::Reference<VclCanvasBitmap>& xBmp,
     CPPUNIT_ASSERT_MESSAGE( "Green pixel from bitmap mismatch with manually converted green pixel",
                             bool(aPixel3 == aPixel4));
 
-    if( !aContainedBmpEx.IsTransparent() )
+    if( !aContainedBmpEx.IsAlpha() )
     {
         aPixel3 = xBmp->convertIntegerFromRGB( aRGBColor );
         CPPUNIT_ASSERT_MESSAGE( "Green pixel from bitmap mismatch with manually RGB-converted green pixel",
@@ -675,7 +675,7 @@ void CanvasBitmapTest::runTest()
 
         checkCanvasBitmap( xBmp, "single bitmap", nDepth );
 
-        Bitmap aMask(Size(200,200), vcl::PixelFormat::N1_BPP);
+        Bitmap aMask(Size(200,200), vcl::PixelFormat::N8_BPP, &Bitmap::GetGreyPalette(256));
         aMask.Erase(COL_WHITE);
         {
             BitmapScopedWriteAccess pAcc(aMask);
@@ -683,9 +683,9 @@ void CanvasBitmapTest::runTest()
             {
                 pAcc->SetFillColor(COL_BLACK);
                 pAcc->FillRect(tools::Rectangle(0,0,100,100));
-                pAcc->SetPixel(0,0,BitmapColor(1));
+                pAcc->SetPixel(0,0,BitmapColor(255));
                 pAcc->SetPixel(0,1,BitmapColor(0));
-                pAcc->SetPixel(0,2,BitmapColor(1));
+                pAcc->SetPixel(0,2,BitmapColor(255));
             }
         }
 
@@ -719,8 +719,8 @@ void CanvasBitmapTest::runTest()
         new TestBitmap( geometry::IntegerSize2D(10,10), true ));
 
     BitmapEx aBmp = vcl::unotools::bitmapExFromXBitmap(xTestBmp);
-    CPPUNIT_ASSERT_MESSAGE( "Palette bitmap is transparent",
-                            !aBmp.IsTransparent());
+    CPPUNIT_ASSERT_MESSAGE( "Palette bitmap is alpha",
+                            !aBmp.IsAlpha());
     CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bitmap does not have size (10,10)",
                             Size(10,10), aBmp.GetSizePixel());
     CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bitmap does not have the expected pixel format",
@@ -745,8 +745,6 @@ void CanvasBitmapTest::runTest()
     xTestBmp.set( new TestBitmap( geometry::IntegerSize2D(10,10), false ));
 
     aBmp = vcl::unotools::bitmapExFromXBitmap(xTestBmp);
-    CPPUNIT_ASSERT_MESSAGE( "Palette bitmap is not transparent",
-                            aBmp.IsTransparent());
     CPPUNIT_ASSERT_MESSAGE( "Palette bitmap has no alpha",
                             aBmp.IsAlpha());
     CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bitmap does not have size (10,10)",
diff --git a/vcl/source/animate/Animation.cxx b/vcl/source/animate/Animation.cxx
index 37c9f16afa26..e17592696195 100644
--- a/vcl/source/animate/Animation.cxx
+++ b/vcl/source/animate/Animation.cxx
@@ -113,7 +113,7 @@ bool Animation::IsTransparent() const
     // as the application (?) does not invalidate on non-transparent
     // graphics due to performance reasons.
 
-    return maBitmapEx.IsTransparent()
+    return maBitmapEx.IsAlpha()
            || std::any_of(maList.begin(), maList.end(),
                           [&aRect](const std::unique_ptr<AnimationBitmap>& pAnim) -> bool {
                               return pAnim->meDisposal == Disposal::Back
diff --git a/vcl/source/bitmap/BitmapAlphaClampFilter.cxx b/vcl/source/bitmap/BitmapAlphaClampFilter.cxx
index d9bc79ad92b6..245d925a9766 100644
--- a/vcl/source/bitmap/BitmapAlphaClampFilter.cxx
+++ b/vcl/source/bitmap/BitmapAlphaClampFilter.cxx
@@ -15,7 +15,7 @@
 
 BitmapEx BitmapAlphaClampFilter::execute(BitmapEx const& rBitmapEx) const
 {
-    if (!rBitmapEx.IsTransparent())
+    if (!rBitmapEx.IsAlpha())
         return rBitmapEx;
 
     AlphaMask aBitmapAlpha(rBitmapEx.GetAlpha());
diff --git a/vcl/source/bitmap/BitmapBasicMorphologyFilter.cxx b/vcl/source/bitmap/BitmapBasicMorphologyFilter.cxx
index 8bc038b486f9..3cd0bb87e4eb 100644
--- a/vcl/source/bitmap/BitmapBasicMorphologyFilter.cxx
+++ b/vcl/source/bitmap/BitmapBasicMorphologyFilter.cxx
@@ -333,7 +333,7 @@ BitmapBasicMorphologyFilter::~BitmapBasicMorphologyFilter() = default;
 BitmapEx BitmapBasicMorphologyFilter::execute(BitmapEx const& rBitmapEx) const
 {
     Bitmap result = filter(rBitmapEx.GetBitmap());
-    return BitmapEx(result, rBitmapEx.GetMask());
+    return BitmapEx(result, rBitmapEx.GetAlpha());
 }
 
 Bitmap BitmapBasicMorphologyFilter::filter(Bitmap const& rBitmap) const
diff --git a/vcl/source/bitmap/BitmapDisabledImageFilter.cxx b/vcl/source/bitmap/BitmapDisabledImageFilter.cxx
index e258d897ab1f..7a702effa0c3 100644
--- a/vcl/source/bitmap/BitmapDisabledImageFilter.cxx
+++ b/vcl/source/bitmap/BitmapDisabledImageFilter.cxx
@@ -47,7 +47,7 @@ BitmapEx BitmapDisabledImageFilter::execute(BitmapEx const& rBitmapEx) const
         }
     }
 
-    if (rBitmapEx.IsTransparent())
+    if (rBitmapEx.IsAlpha())
     {
         aReturnBitmap = BitmapEx(aGrey, rBitmapEx.GetAlpha());
     }
diff --git a/vcl/source/bitmap/BitmapEx.cxx b/vcl/source/bitmap/BitmapEx.cxx
index bcf8480163cc..8d931d324b08 100644
--- a/vcl/source/bitmap/BitmapEx.cxx
+++ b/vcl/source/bitmap/BitmapEx.cxx
@@ -49,16 +49,12 @@
 using namespace ::com::sun::star;
 
 BitmapEx::BitmapEx()
-    : meTransparent(TransparentType::NONE)
-    , mbAlpha(false)
 {
 }
 
 BitmapEx::BitmapEx( const BitmapEx& ) = default;
 
 BitmapEx::BitmapEx( const BitmapEx& rBitmapEx, Point aSrc, Size aSize )
-    : meTransparent(TransparentType::NONE)
-    , mbAlpha(false)
 {
     if( rBitmapEx.IsEmpty() || aSize.IsEmpty() )
         return;
@@ -66,12 +62,7 @@ BitmapEx::BitmapEx( const BitmapEx& rBitmapEx, Point aSrc, Size aSize )
     maBitmap = Bitmap(aSize, rBitmapEx.maBitmap.getPixelFormat());
     SetSizePixel(aSize);
     if( rBitmapEx.IsAlpha() )
-    {
-        mbAlpha = true;
-        maMask = AlphaMask( aSize ).ImplGetBitmap();
-    }
-    else if( rBitmapEx.IsTransparent() )
-        maMask = Bitmap(aSize, rBitmapEx.maMask.getPixelFormat());
+        maAlphaMask = AlphaMask( aSize ).ImplGetBitmap();
 
     tools::Rectangle aDestRect( Point( 0, 0 ), aSize );
     tools::Rectangle aSrcRect( aSrc, aSize );
@@ -79,16 +70,12 @@ BitmapEx::BitmapEx( const BitmapEx& rBitmapEx, Point aSrc, Size aSize )
 }
 
 BitmapEx::BitmapEx(Size aSize, vcl::PixelFormat ePixelFormat)
-    : meTransparent(TransparentType::NONE)
-    , mbAlpha(false)
 {
     maBitmap = Bitmap(aSize, ePixelFormat);
     SetSizePixel(aSize);
 }
 
 BitmapEx::BitmapEx( const OUString& rIconName )
-    : meTransparent(TransparentType::NONE)
-    , mbAlpha(false)
 {
     loadFromIconTheme( rIconName );
 }
@@ -113,30 +100,25 @@ void BitmapEx::loadFromIconTheme( const OUString& rIconName )
 
 BitmapEx::BitmapEx( const Bitmap& rBmp ) :
         maBitmap     ( rBmp ),
-        maBitmapSize ( maBitmap.GetSizePixel() ),
-        meTransparent( TransparentType::NONE ),
-        mbAlpha      ( false )
+        maBitmapSize ( maBitmap.GetSizePixel() )
 {
 }
 
 BitmapEx::BitmapEx( const Bitmap& rBmp, const Bitmap& rMask ) :
         maBitmap         ( rBmp ),
-        maMask           ( rMask ),
-        maBitmapSize     ( maBitmap.GetSizePixel() ),
-        meTransparent    ( rMask.IsEmpty() ? TransparentType::NONE : TransparentType::Bitmap ),
-        mbAlpha          ( !rMask.IsEmpty() )
+        maBitmapSize     ( maBitmap.GetSizePixel() )
 {
     if (rMask.IsEmpty())
         return;
 
-    if( maMask.getPixelFormat() == vcl::PixelFormat::N8_BPP && maMask.HasGreyPalette8Bit() )
-        maMask = rMask;
-    else if (maMask.getPixelFormat() == vcl::PixelFormat::N1_BPP)
+    if( rMask.getPixelFormat() == vcl::PixelFormat::N8_BPP && rMask.HasGreyPalette8Bit() )
+        maAlphaMask = rMask;
+    else if (rMask.getPixelFormat() == vcl::PixelFormat::N1_BPP)
     {
         // convert 1-bit mask to alpha bitmap
         BitmapEx aBmpEx(rMask);
         BitmapFilter::Filter(aBmpEx, BitmapMaskToAlphaFilter());
-        maMask = aBmpEx.GetBitmap();
+        maAlphaMask = aBmpEx.GetBitmap();
     }
     else
     {
@@ -145,40 +127,36 @@ BitmapEx::BitmapEx( const Bitmap& rBmp, const Bitmap& rMask ) :
         BitmapEx aMaskEx(rMask);
         BitmapFilter::Filter(aMaskEx, BitmapMonochromeFilter(255));
         BitmapFilter::Filter(aMaskEx, BitmapMaskToAlphaFilter());
-        maMask = aMaskEx.GetBitmap();
+        maAlphaMask = aMaskEx.GetBitmap();
     }
 
-    if (!maBitmap.IsEmpty() && maBitmap.GetSizePixel() != maMask.GetSizePixel())
+    if (!maBitmap.IsEmpty() && maBitmap.GetSizePixel() != maAlphaMask.GetSizePixel())
     {
         OSL_ENSURE(false, "Mask size differs from Bitmap size, corrected Mask (!)");
-        maMask.Scale(maBitmap.GetSizePixel());
+        maAlphaMask.Scale(maBitmap.GetSizePixel());
     }
 }
 
 BitmapEx::BitmapEx( const Bitmap& rBmp, const AlphaMask& rAlphaMask ) :
         maBitmap         ( rBmp ),
-        maMask           ( rAlphaMask.ImplGetBitmap() ),
-        maBitmapSize     ( maBitmap.GetSizePixel() ),
-        meTransparent    ( rAlphaMask.IsEmpty() ? TransparentType::NONE : TransparentType::Bitmap ),
-        mbAlpha          ( !rAlphaMask.IsEmpty() )
+        maAlphaMask      ( rAlphaMask.ImplGetBitmap() ),
+        maBitmapSize     ( maBitmap.GetSizePixel() )
 {
-    if (!maBitmap.IsEmpty() && !maMask.IsEmpty() && maBitmap.GetSizePixel() != maMask.GetSizePixel())
+    if (!maBitmap.IsEmpty() && !maAlphaMask.IsEmpty() && maBitmap.GetSizePixel() != maAlphaMask.GetSizePixel())
     {
         OSL_ENSURE(false, "Alpha size differs from Bitmap size, corrected Mask (!)");
-        maMask.Scale(rBmp.GetSizePixel());
+        maAlphaMask.Scale(rBmp.GetSizePixel());
     }
 }
 
 
 BitmapEx::BitmapEx( const Bitmap& rBmp, const Color& rTransparentColor ) :
         maBitmap             ( rBmp ),
-        maBitmapSize         ( maBitmap.GetSizePixel() ),
-        meTransparent        ( TransparentType::Bitmap ),
-        mbAlpha              ( false )
+        maBitmapSize         ( maBitmap.GetSizePixel() )
 {
-    maMask = maBitmap.CreateMask( rTransparentColor );
+    maAlphaMask = maBitmap.CreateMask( rTransparentColor );
 
-    SAL_WARN_IF(rBmp.GetSizePixel() != maMask.GetSizePixel(), "vcl",
+    SAL_WARN_IF(rBmp.GetSizePixel() != maAlphaMask.GetSizePixel(), "vcl",
                 "BitmapEx::BitmapEx(): size mismatch for bitmap and alpha mask.");
 }
 
@@ -187,35 +165,24 @@ BitmapEx& BitmapEx::operator=( const BitmapEx& ) = default;
 
 bool BitmapEx::operator==( const BitmapEx& rBitmapEx ) const
 {
-    if (meTransparent != rBitmapEx.meTransparent)
-        return false;
-
     if (GetSizePixel() != rBitmapEx.GetSizePixel())
         return false;
 
-    if (meTransparent != rBitmapEx.meTransparent)
-        return false;
-
-    if (mbAlpha != rBitmapEx.mbAlpha)
-        return false;
-
     if (maBitmap != rBitmapEx.maBitmap)
         return false;
 
-    return maMask == rBitmapEx.maMask;
+    return maAlphaMask == rBitmapEx.maAlphaMask;
 }
 
 bool BitmapEx::IsEmpty() const
 {
-    return( maBitmap.IsEmpty() && maMask.IsEmpty() );
+    return( maBitmap.IsEmpty() && maAlphaMask.IsEmpty() );
 }
 
 void BitmapEx::SetEmpty()
 {
     maBitmap.SetEmpty();
-    maMask.SetEmpty();
-    meTransparent = TransparentType::NONE;
-    mbAlpha = false;
+    maAlphaMask.SetEmpty();
 }
 
 void BitmapEx::Clear()
@@ -223,14 +190,9 @@ void BitmapEx::Clear()
     SetEmpty();
 }
 
-bool BitmapEx::IsTransparent() const
-{
-    return( meTransparent != TransparentType::NONE );
-}
-
 bool BitmapEx::IsAlpha() const
 {
-    return( IsTransparent() && mbAlpha );
+    return !maAlphaMask.IsEmpty();
 }
 
 const Bitmap& BitmapEx::GetBitmap() const
@@ -242,49 +204,25 @@ Bitmap BitmapEx::GetBitmap( Color aTransparentReplaceColor ) const
 {
     Bitmap aRetBmp( maBitmap );
 
-    if( meTransparent != TransparentType::NONE )
+    if( !maAlphaMask.IsEmpty() )
     {
-        Bitmap aTempMask = maMask;
-
-        if( !IsAlpha() )
-            aRetBmp.Replace( aTempMask, aTransparentReplaceColor );
-        else
-            aRetBmp.Replace( GetAlpha(), aTransparentReplaceColor );
+        aRetBmp.Replace( maAlphaMask, aTransparentReplaceColor );
     }
 
     return aRetBmp;
 }
 
-Bitmap BitmapEx::GetMask() const
-{
-    if (!IsAlpha())
-        return maMask;
-
-    BitmapEx aMaskEx(maMask);
-    BitmapFilter::Filter(aMaskEx, BitmapMonochromeFilter(255));
-    return aMaskEx.GetBitmap();
-}
-
 AlphaMask BitmapEx::GetAlpha() const
 {
-    if( IsAlpha() )
-    {
-        AlphaMask aAlpha;
-        aAlpha.ImplSetBitmap( maMask );
-        return aAlpha;
-    }
-    else
-    {
-        return AlphaMask(maMask);
-    }
+    return AlphaMask(maAlphaMask);
 }
 
 sal_uLong BitmapEx::GetSizeBytes() const
 {
     sal_uLong nSizeBytes = maBitmap.GetSizeBytes();
 
-    if( meTransparent == TransparentType::Bitmap )
-        nSizeBytes += maMask.GetSizeBytes();
+    if( !maAlphaMask.IsEmpty() )
+        nSizeBytes += maAlphaMask.GetSizeBytes();
 
     return nSizeBytes;
 }
@@ -292,18 +230,11 @@ sal_uLong BitmapEx::GetSizeBytes() const
 BitmapChecksum BitmapEx::GetChecksum() const
 {
     BitmapChecksum  nCrc = maBitmap.GetChecksum();
-    SVBT32      aBT32;
-
-    UInt32ToSVBT32( o3tl::underlyingEnumValue(meTransparent), aBT32 );
-    nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
 
-    UInt32ToSVBT32( sal_uInt32(mbAlpha), aBT32 );
-    nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
-
-    if( ( TransparentType::Bitmap == meTransparent ) && !maMask.IsEmpty() )
+    if( !maAlphaMask.IsEmpty() )
     {
         BitmapChecksumOctetArray aBCOA;
-        BCToBCOA( maMask.GetChecksum(), aBCOA );
+        BCToBCOA( maAlphaMask.GetChecksum(), aBCOA );
         nCrc = vcl_get_checksum( nCrc, aBCOA, BITMAP_CHECKSUM_SIZE );
     }
 
@@ -333,8 +264,8 @@ bool BitmapEx::Mirror( BmpMirrorFlags nMirrorFlags )
     {
         bRet = maBitmap.Mirror( nMirrorFlags );
 
-        if( bRet && ( meTransparent == TransparentType::Bitmap ) && !maMask.IsEmpty() )
-            maMask.Mirror( nMirrorFlags );
+        if( bRet && !maAlphaMask.IsEmpty() )
+            maAlphaMask.Mirror( nMirrorFlags );
     }
 
     return bRet;
@@ -348,14 +279,14 @@ bool BitmapEx::Scale( const double& rScaleX, const double& rScaleY, BmpScaleFlag
     {
         bRet = maBitmap.Scale( rScaleX, rScaleY, nScaleFlag );
 
-        if( bRet && ( meTransparent == TransparentType::Bitmap ) && !maMask.IsEmpty() )
+        if( bRet && !maAlphaMask.IsEmpty() )
         {
-            maMask.Scale( rScaleX, rScaleY, nScaleFlag );
+            maAlphaMask.Scale( rScaleX, rScaleY, nScaleFlag );
         }
 
         SetSizePixel(maBitmap.GetSizePixel());
 
-        SAL_WARN_IF( !maMask.IsEmpty() && maBitmap.GetSizePixel() != maMask.GetSizePixel(), "vcl",
+        SAL_WARN_IF( !maAlphaMask.IsEmpty() && maBitmap.GetSizePixel() != maAlphaMask.GetSizePixel(), "vcl",
                     "BitmapEx::Scale(): size mismatch for bitmap and alpha mask." );
     }
 
@@ -394,27 +325,26 @@ bool BitmapEx::Rotate( Degree10 nAngle10, const Color& rFillColor )
         {
             bRet = maBitmap.Rotate( nAngle10, COL_BLACK );
 
-            if( meTransparent == TransparentType::NONE )
+            if( maAlphaMask.IsEmpty() )
             {
-                maMask = Bitmap(GetSizePixel(), vcl::PixelFormat::N1_BPP);
-                maMask.Erase( COL_BLACK );
-                meTransparent = TransparentType::Bitmap;
+                maAlphaMask = Bitmap(GetSizePixel(), vcl::PixelFormat::N8_BPP, &Bitmap::GetGreyPalette(256));
+                maAlphaMask.Erase( COL_BLACK );
             }
 
-            if( bRet && !maMask.IsEmpty() )
-                maMask.Rotate( nAngle10, COL_WHITE );
+            if( bRet && !maAlphaMask.IsEmpty() )
+                maAlphaMask.Rotate( nAngle10, COL_WHITE );
         }
         else
         {
             bRet = maBitmap.Rotate( nAngle10, rFillColor );
 
-            if( bRet && ( meTransparent == TransparentType::Bitmap ) && !maMask.IsEmpty() )
-                maMask.Rotate( nAngle10, COL_WHITE );
+            if( bRet && !maAlphaMask.IsEmpty() )
+                maAlphaMask.Rotate( nAngle10, COL_WHITE );
         }
 
         SetSizePixel(maBitmap.GetSizePixel());
 
-        SAL_WARN_IF(!maMask.IsEmpty() && maBitmap.GetSizePixel() != maMask.GetSizePixel(), "vcl",
+        SAL_WARN_IF(!maAlphaMask.IsEmpty() && maBitmap.GetSizePixel() != maAlphaMask.GetSizePixel(), "vcl",
                     "BitmapEx::Rotate(): size mismatch for bitmap and alpha mask.");
     }
 
@@ -429,12 +359,12 @@ bool BitmapEx::Crop( const tools::Rectangle& rRectPixel )
     {
         bRet = maBitmap.Crop( rRectPixel );
 
-        if( bRet && ( meTransparent == TransparentType::Bitmap ) && !maMask.IsEmpty() )
-            maMask.Crop( rRectPixel );
+        if( bRet && !maAlphaMask.IsEmpty() )
+            maAlphaMask.Crop( rRectPixel );
 
         SetSizePixel(maBitmap.GetSizePixel());
 
-        SAL_WARN_IF(!maMask.IsEmpty() && maBitmap.GetSizePixel() != maMask.GetSizePixel(), "vcl",
+        SAL_WARN_IF(!maAlphaMask.IsEmpty() && maBitmap.GetSizePixel() != maAlphaMask.GetSizePixel(), "vcl",
                     "BitmapEx::Crop(): size mismatch for bitmap and alpha mask.");
     }
 
@@ -455,15 +385,15 @@ void BitmapEx::Expand( sal_uLong nDX, sal_uLong nDY, bool bExpandTransparent )
 
     bRet = maBitmap.Expand( nDX, nDY );
 
-    if( bRet && ( meTransparent == TransparentType::Bitmap ) && !maMask.IsEmpty() )
+    if( bRet && !maAlphaMask.IsEmpty() )
     {
         Color aColor( bExpandTransparent ? COL_WHITE : COL_BLACK );
-        maMask.Expand( nDX, nDY, &aColor );
+        maAlphaMask.Expand( nDX, nDY, &aColor );
     }
 
     SetSizePixel(maBitmap.GetSizePixel());
 
-    SAL_WARN_IF(!maMask.IsEmpty() && maBitmap.GetSizePixel() != maMask.GetSizePixel(), "vcl",
+    SAL_WARN_IF(!maAlphaMask.IsEmpty() && maBitmap.GetSizePixel() != maAlphaMask.GetSizePixel(), "vcl",
                 "BitmapEx::Expand(): size mismatch for bitmap and alpha mask.");
 }
 
@@ -478,8 +408,8 @@ bool BitmapEx::CopyPixel( const tools::Rectangle& rRectDst, const tools::Rectang
         {
             bRet = maBitmap.CopyPixel( rRectDst, rRectSrc );
 
-            if( bRet && ( meTransparent == TransparentType::Bitmap ) && !maMask.IsEmpty() )
-                maMask.CopyPixel( rRectDst, rRectSrc );
+            if( bRet && !maAlphaMask.IsEmpty() )
+                maAlphaMask.CopyPixel( rRectDst, rRectSrc );
         }
     }
     else
@@ -494,45 +424,15 @@ bool BitmapEx::CopyPixel( const tools::Rectangle& rRectDst, const tools::Rectang
                 {
                     if( IsAlpha() )
                         // cast to use the optimized AlphaMask::CopyPixel
-                        maMask.CopyPixel_AlphaOptimized( rRectDst, rRectSrc, &pBmpExSrc->maMask );
-                    else if( IsTransparent() )
-                    {
-                        std::unique_ptr<AlphaMask> pAlpha(new AlphaMask( maMask ));
-
-                        maMask = pAlpha->ImplGetBitmap();
-                        pAlpha.reset();
-                        mbAlpha = true;
-                        maMask.CopyPixel( rRectDst, rRectSrc, &pBmpExSrc->maMask );
-                    }
+                        maAlphaMask.CopyPixel_AlphaOptimized( rRectDst, rRectSrc, &pBmpExSrc->maAlphaMask );
                     else
                     {
                         sal_uInt8 cBlack = 0;
                         std::unique_ptr<AlphaMask> pAlpha(new AlphaMask(GetSizePixel(), &cBlack));
 
-                        maMask = pAlpha->ImplGetBitmap();
+                        maAlphaMask = pAlpha->ImplGetBitmap();
                         pAlpha.reset();
-                        meTransparent = TransparentType::Bitmap;
-                        mbAlpha = true;
-                        maMask.CopyPixel( rRectDst, rRectSrc, &pBmpExSrc->maMask );
-                    }
-                }
-                else if( pBmpExSrc->IsTransparent() )
-                {
-                    if (IsAlpha())
-                    {
-                        AlphaMask aAlpha( pBmpExSrc->maMask );
-                        maMask.CopyPixel( rRectDst, rRectSrc, &aAlpha.ImplGetBitmap() );
-                    }
-                    else if (IsTransparent())
-                    {
-                        maMask.CopyPixel( rRectDst, rRectSrc, &pBmpExSrc->maMask );
-                    }
-                    else
-                    {
-                        maMask = Bitmap(GetSizePixel(), vcl::PixelFormat::N1_BPP);
-                        maMask.Erase(COL_BLACK);
-                        meTransparent = TransparentType::Bitmap;
-                        maMask.CopyPixel( rRectDst, rRectSrc, &pBmpExSrc->maMask );
+                        maAlphaMask.CopyPixel( rRectDst, rRectSrc, &pBmpExSrc->maAlphaMask );
                     }
                 }
                 else if (IsAlpha())
@@ -540,14 +440,7 @@ bool BitmapEx::CopyPixel( const tools::Rectangle& rRectDst, const tools::Rectang
                     sal_uInt8 cBlack = 0;
                     const AlphaMask aAlphaSrc(pBmpExSrc->GetSizePixel(), &cBlack);
 
-                    maMask.CopyPixel( rRectDst, rRectSrc, &aAlphaSrc.ImplGetBitmap() );
-                }
-                else if (IsTransparent())
-                {
-                    Bitmap aMaskSrc(pBmpExSrc->GetSizePixel(), vcl::PixelFormat::N1_BPP);
-
-                    aMaskSrc.Erase( COL_BLACK );
-                    maMask.CopyPixel( rRectDst, rRectSrc, &aMaskSrc );
+                    maAlphaMask.CopyPixel( rRectDst, rRectSrc, &aAlphaSrc.ImplGetBitmap() );
                 }
             }
         }
@@ -564,18 +457,18 @@ bool BitmapEx::Erase( const Color& rFillColor )
     {
         bRet = maBitmap.Erase( rFillColor );
 
-        if( bRet && ( meTransparent == TransparentType::Bitmap ) && !maMask.IsEmpty() )
+        if( bRet && !maAlphaMask.IsEmpty() )
         {
             // Respect transparency on fill color
             if( rFillColor.IsTransparent() )
             {
                 const Color aFill( 255 - rFillColor.GetAlpha(), 255 - rFillColor.GetAlpha(), 255 - rFillColor.GetAlpha() );
-                maMask.Erase( aFill );
+                maAlphaMask.Erase( aFill );
             }
             else
             {
                 const Color aBlack( COL_BLACK );
-                maMask.Erase( aBlack );
+                maAlphaMask.Erase( aBlack );
             }
         }
     }
@@ -682,42 +575,22 @@ sal_uInt8 BitmapEx::GetAlpha(sal_Int32 nX, sal_Int32 nY) const
         return GetPixelColor(nX, nY).GetAlpha();
 
     sal_uInt8 nAlpha(0);
-    switch(meTransparent)
+    if (maAlphaMask.IsEmpty())
     {
-        case TransparentType::NONE:
-        {
-            // Not transparent, ergo all covered
-            nAlpha = 255;
-            break;
-        }
-        case TransparentType::Bitmap:
-        {
-            if(!maMask.IsEmpty())
-            {
-                Bitmap aTestBitmap(maMask);
-                Bitmap::ScopedReadAccess pRead(aTestBitmap);
-
-                if(pRead)
-                {
-                    const BitmapColor aBitmapColor(pRead->GetPixel(nY, nX));
+        // Not transparent, ergo all covered
+        nAlpha = 255;
+    }
+    else
+    {
+        Bitmap aTestBitmap(maAlphaMask);
+        Bitmap::ScopedReadAccess pRead(aTestBitmap);
 
-                    if(mbAlpha)
-                    {
-                        nAlpha = 255 - aBitmapColor.GetIndex();
-                    }
-                    else
-                    {
-                        if(0x00 == aBitmapColor.GetIndex())
-                        {
-                            nAlpha = 255;
-                        }
-                    }
-                }
-            }
-            break;
+        if(pRead)
+        {
+            const BitmapColor aBitmapColor(pRead->GetPixel(nY, nX));
+            nAlpha = 255 - aBitmapColor.GetIndex();
         }
     }
-
     return nAlpha;
 }
 
@@ -891,18 +764,10 @@ BitmapEx BitmapEx::TransformBitmapEx(
     const Bitmap aDestination(impTransformBitmap(GetBitmap(), aDestinationSize, rTransformation, bSmooth));
 
     // create mask
-    if(IsTransparent())
+    if(IsAlpha())
     {
-        if(IsAlpha())
-        {
-            const Bitmap aAlpha(impTransformBitmap(GetAlpha().GetBitmap(), aDestinationSize, rTransformation, bSmooth));
-            return BitmapEx(aDestination, AlphaMask(aAlpha));
-        }
-        else
-        {
-            const Bitmap aLclMask(impTransformBitmap(GetMask(), aDestinationSize, rTransformation, false));
-            return BitmapEx(aDestination, aLclMask);
-        }
+        const Bitmap aAlpha(impTransformBitmap(GetAlpha().GetBitmap(), aDestinationSize, rTransformation, bSmooth));
+        return BitmapEx(aDestination, AlphaMask(aAlpha));
     }
 
     return BitmapEx(aDestination);
@@ -1002,7 +867,7 @@ BitmapEx BitmapEx::ModifyBitmapEx(const basegfx::BColorModifierStack& rBColorMod
         if(pReplace)
         {
             // complete replace
-            if(IsTransparent())
+            if(IsAlpha())
             {
                 // clear bitmap with dest color
                 if (vcl::isPalettePixelFormat(aChangedBitmap.getPixelFormat()))
@@ -1122,16 +987,9 @@ BitmapEx BitmapEx::ModifyBitmapEx(const basegfx::BColorModifierStack& rBColorMod
     }
     else
     {
-        if(IsTransparent())
+        if(IsAlpha())
         {
-            if(IsAlpha())
-            {
-                return BitmapEx(aChangedBitmap, GetAlpha());
-            }
-            else
-            {
-                return BitmapEx(aChangedBitmap, GetMask());
-            }
+            return BitmapEx(aChangedBitmap, GetAlpha());
         }
         else
         {
@@ -1310,13 +1168,11 @@ void BitmapEx::Replace( const Color* pSearchColors,
 
 void BitmapEx::ReplaceTransparency(const Color& rColor)
 {
-    if( IsTransparent() )
+    if( IsAlpha() )
     {
-        maBitmap.Replace( GetMask(), rColor );
-        maMask = Bitmap();
+        maBitmap.Replace( GetAlpha(), rColor );
+        maAlphaMask = Bitmap();
         maBitmapSize = maBitmap.GetSizePixel();
-        meTransparent = TransparentType::NONE;
-        mbAlpha = false;
     }
 }
 
@@ -1536,15 +1392,10 @@ void BitmapEx::AdjustTransparency(sal_uInt8 cTrans)
 {
     AlphaMask   aAlpha;
 
-    if (!IsTransparent())
+    if (!IsAlpha())
     {
         aAlpha = AlphaMask(GetSizePixel(), &cTrans);
     }
-    else if( !IsAlpha() )
-    {
-        aAlpha = GetMask();
-        aAlpha.Replace( 0, cTrans );
-    }
     else
     {
         aAlpha = GetAlpha();
@@ -1592,10 +1443,9 @@ void BitmapEx::AdjustTransparency(sal_uInt8 cTrans)
 void BitmapEx::CombineMaskOr(Color maskColor, sal_uInt8 nTol)
 {
     Bitmap aNewMask = maBitmap.CreateMask( maskColor, nTol );
-    if ( IsTransparent() )
-         aNewMask.CombineSimple( maMask, BmpCombine::Or );
-    maMask = aNewMask;
-    meTransparent = TransparentType::Bitmap;
+    if ( IsAlpha() )
+         aNewMask.CombineSimple( maAlphaMask, BmpCombine::Or );
+    maAlphaMask = aNewMask;
 }
 
 /**
@@ -1628,7 +1478,7 @@ void  BitmapEx::GetColorModel(css::uno::Sequence< sal_Int32 >& rRGBPalette,
                 *pTmp |= sal_Int32(0x000000ffL);
             }
 
-            if( IsTransparent() )
+            if( IsAlpha() )
             {
                 // append transparent entry
                 *pTmp = sal_Int32(0xffffff00L);
diff --git a/vcl/source/bitmap/BitmapFastScaleFilter.cxx b/vcl/source/bitmap/BitmapFastScaleFilter.cxx
index feeee6c79931..0a1143d28e04 100644
--- a/vcl/source/bitmap/BitmapFastScaleFilter.cxx
+++ b/vcl/source/bitmap/BitmapFastScaleFilter.cxx
@@ -112,9 +112,9 @@ BitmapEx BitmapFastScaleFilter::execute(BitmapEx const& rBitmapEx) const
         }
     }
 
-    Bitmap aMask(rBitmapEx.GetMask());
+    AlphaMask aMask(rBitmapEx.GetAlpha());
 
-    if (bRet && (rBitmapEx.GetTransparentType() == TransparentType::Bitmap) && !aMask.IsEmpty())
+    if (bRet && !aMask.IsEmpty())
         bRet = aMask.Scale(maSize, BmpScaleFlag::Fast);
 
     SAL_WARN_IF(!aMask.IsEmpty() && aBitmap.GetSizePixel() != aMask.GetSizePixel(), "vcl",
diff --git a/vcl/source/bitmap/BitmapFilterStackBlur.cxx b/vcl/source/bitmap/BitmapFilterStackBlur.cxx
index 027b84c5958d..c23adad0176f 100644
--- a/vcl/source/bitmap/BitmapFilterStackBlur.cxx
+++ b/vcl/source/bitmap/BitmapFilterStackBlur.cxx
@@ -624,7 +624,7 @@ BitmapEx BitmapFilterStackBlur::execute(BitmapEx const& rBitmapEx) const
 {
     Bitmap aBitmap = rBitmapEx.GetBitmap();
     Bitmap result = filter(aBitmap);
-    return BitmapEx(result, rBitmapEx.GetMask());
+    return BitmapEx(result, rBitmapEx.GetAlpha());
 }
 
 Bitmap BitmapFilterStackBlur::filter(Bitmap const& rBitmap) const
diff --git a/vcl/source/bitmap/BitmapTools.cxx b/vcl/source/bitmap/BitmapTools.cxx
index 168cf95fb9e0..32204a4a2bb1 100644
--- a/vcl/source/bitmap/BitmapTools.cxx
+++ b/vcl/source/bitmap/BitmapTools.cxx
@@ -341,22 +341,19 @@ BitmapEx CanvasTransformBitmap( const BitmapEx&                 rBitmap,
 
     // differentiate mask and alpha channel (on-off
     // vs. multi-level transparency)
-    if( rBitmap.IsTransparent() )
+    if( rBitmap.IsAlpha() )
     {
-        if( rBitmap.IsAlpha() )
-            aSrcAlpha = rBitmap.GetAlpha().GetBitmap();
-        else
-            aSrcAlpha = rBitmap.GetMask();
+        aSrcAlpha = rBitmap.GetAlpha().GetBitmap();
     }
 
     Bitmap::ScopedReadAccess pReadAccess( aSrcBitmap );
-    Bitmap::ScopedReadAccess pAlphaReadAccess( rBitmap.IsTransparent() ?
+    Bitmap::ScopedReadAccess pAlphaReadAccess( rBitmap.IsAlpha() ?
                                              aSrcAlpha.AcquireReadAccess() :
                                              nullptr,
                                              aSrcAlpha );
 
     if( pReadAccess.get() == nullptr ||
-        (pAlphaReadAccess.get() == nullptr && rBitmap.IsTransparent()) )
+        (pAlphaReadAccess.get() == nullptr && rBitmap.IsAlpha()) )
     {
         // TODO(E2): Error handling!
         ENSURE_OR_THROW( false,
@@ -368,29 +365,15 @@ BitmapEx CanvasTransformBitmap( const BitmapEx&                 rBitmap,
     // paletted 1-bit masks).
     sal_uInt8 aAlphaMap[256];
 
-    if( rBitmap.IsTransparent() )
+    if( rBitmap.IsAlpha() )
     {
-        if( rBitmap.IsAlpha() )
-        {
-            // source already has alpha channel - 1:1 mapping,
-            // i.e. aAlphaMap[0]=0,...,aAlphaMap[255]=255.
-            sal_uInt8  val=0;
-            sal_uInt8* pCur=aAlphaMap;
-            sal_uInt8* const pEnd=&aAlphaMap[256];
-            while(pCur != pEnd)
-                *pCur++ = val++;
-        }
-        else
-        {
-            // mask transparency - determine used palette colors
-            const BitmapColor& rCol0( pAlphaReadAccess->GetPaletteColor( 0 ) );
-            const BitmapColor& rCol1( pAlphaReadAccess->GetPaletteColor( 1 ) );
-
-            // shortcut for true luminance calculation
-            // (assumes that palette is grey-level)
-            aAlphaMap[0] = rCol0.GetRed();
-            aAlphaMap[1] = rCol1.GetRed();
-        }
+        // source already has alpha channel - 1:1 mapping,
+        // i.e. aAlphaMap[0]=0,...,aAlphaMap[255]=255.
+        sal_uInt8  val=0;
+        sal_uInt8* pCur=aAlphaMap;
+        sal_uInt8* const pEnd=&aAlphaMap[256];
+        while(pCur != pEnd)
+            *pCur++ = val++;
     }
     // else: mapping table is not used
 
@@ -428,7 +411,7 @@ BitmapEx CanvasTransformBitmap( const BitmapEx&                 rBitmap,
             {
                 // differentiate mask and alpha channel (on-off
                 // vs. multi-level transparency)
-                if( rBitmap.IsTransparent() )
+                if( rBitmap.IsAlpha() )
                 {
                     Scanline pScan = pWriteAccess->GetScanline( y );
                     Scanline pScanAlpha = pAlphaWriteAccess->GetScanline( y );
@@ -500,10 +483,6 @@ void DrawAlphaBitmapAndAlphaGradient(BitmapEx & rBitmapEx, bool bFixedTransparen
     {
         aOldMask = rBitmapEx.GetAlpha();
     }
-    else if(TransparentType::Bitmap == rBitmapEx.GetTransparentType())
-    {
-        aOldMask = rBitmapEx.GetMask();
-    }
 
     {
         AlphaScopedWriteAccess pOld(aOldMask);
@@ -580,55 +559,43 @@ void DrawAndClipBitmap(const Point& rPos, const Size& rSize, const BitmapEx& rBi
     pVDev->EnableMapMode( false );
     const Bitmap aVDevMask(pVDev->GetBitmap(Point(), aSizePixel));
 
-    if(aBmpEx.IsTransparent())
+    if(aBmpEx.IsAlpha())
     {
         // bitmap already uses a Mask or Alpha, we need to blend that with
-        // the new masking in pVDev
-        if(aBmpEx.IsAlpha())
+        // the new masking in pVDev.
+        // need to blend in AlphaMask quality (8Bit)
+        AlphaMask fromVDev(aVDevMask);
+        AlphaMask fromBmpEx(aBmpEx.GetAlpha());
+        AlphaMask::ScopedReadAccess pR(fromVDev);
+        AlphaScopedWriteAccess pW(fromBmpEx);
+
+        if(pR && pW)
         {
-            // need to blend in AlphaMask quality (8Bit)
-            AlphaMask fromVDev(aVDevMask);
-            AlphaMask fromBmpEx(aBmpEx.GetAlpha());
-            AlphaMask::ScopedReadAccess pR(fromVDev);
-            AlphaScopedWriteAccess pW(fromBmpEx);
+            const tools::Long nWidth(std::min(pR->Width(), pW->Width()));
+            const tools::Long nHeight(std::min(pR->Height(), pW->Height()));
 
-            if(pR && pW)
+            for(tools::Long nY(0); nY < nHeight; nY++)
             {
-                const tools::Long nWidth(std::min(pR->Width(), pW->Width()));
-                const tools::Long nHeight(std::min(pR->Height(), pW->Height()));
-
-                for(tools::Long nY(0); nY < nHeight; nY++)
+                Scanline pScanlineR = pR->GetScanline( nY );
+                Scanline pScanlineW = pW->GetScanline( nY );
+                for(tools::Long nX(0); nX < nWidth; nX++)
                 {
-                    Scanline pScanlineR = pR->GetScanline( nY );
-                    Scanline pScanlineW = pW->GetScanline( nY );
-                    for(tools::Long nX(0); nX < nWidth; nX++)
-                    {
-                        const sal_uInt8 nIndR(pR->GetIndexFromData(pScanlineR, nX));
-                        const sal_uInt8 nIndW(pW->GetIndexFromData(pScanlineW, nX));
+                    const sal_uInt8 nIndR(pR->GetIndexFromData(pScanlineR, nX));
+                    const sal_uInt8 nIndW(pW->GetIndexFromData(pScanlineW, nX));
 
-                        // these values represent transparency (0 == no, 255 == fully transparent),
-                        // so to blend these we have to multiply the inverse (opacity)
-                        // and re-invert the result to transparence
-                        const sal_uInt8 nCombined(0x00ff - (((0x00ff - nIndR) * (0x00ff - nIndW)) >> 8));
+                    // these values represent transparency (0 == no, 255 == fully transparent),
+                    // so to blend these we have to multiply the inverse (opacity)
+                    // and re-invert the result to transparence
+                    const sal_uInt8 nCombined(0x00ff - (((0x00ff - nIndR) * (0x00ff - nIndW)) >> 8));
 
-                        pW->SetPixelOnData(pScanlineW, nX, BitmapColor(nCombined));
-                    }
+                    pW->SetPixelOnData(pScanlineW, nX, BitmapColor(nCombined));
                 }
             }
-
-            pR.reset();
-            pW.reset();
-            aBmpEx = BitmapEx(aBmpEx.GetBitmap(), fromBmpEx);
         }
-        else
-        {
-            // need to blend in Mask quality (1Bit)
-            Bitmap aMask(aVDevMask.CreateMask(COL_WHITE));
-
-            aMask.CombineSimple( rBitmap.GetMask(), BmpCombine::And );
 
-            aBmpEx = BitmapEx( rBitmap.GetBitmap(), aMask );
-        }
+        pR.reset();
+        pW.reset();
+        aBmpEx = BitmapEx(aBmpEx.GetBitmap(), fromBmpEx);
     }
     else
     {
@@ -647,12 +614,6 @@ css::uno::Sequence< sal_Int8 > GetMaskDIB(BitmapEx const & aBmpEx)
         WriteDIB(aBmpEx.GetAlpha().GetBitmap(), aMem, false, true);
         return css::uno::Sequence< sal_Int8 >( static_cast<sal_Int8 const *>(aMem.GetData()), aMem.Tell() );
     }
-    else if ( aBmpEx.IsTransparent() )
-    {
-        SvMemoryStream aMem;
-        WriteDIB(aBmpEx.GetMask(), aMem, false, true);
-        return css::uno::Sequence< sal_Int8 >( static_cast<sal_Int8 const *>(aMem.GetData()), aMem.Tell() );
-    }
 
     return css::uno::Sequence< sal_Int8 >();
 }
@@ -712,7 +673,7 @@ void CanvasCairoExtractBitmapData( BitmapEx const & aBmpEx, Bitmap & aBitmap, un
     tools::Long nX, nY;
     bool bIsAlpha = false;
 
-    if( aBmpEx.IsTransparent() || aBmpEx.IsAlpha() )
+    if( aBmpEx.IsAlpha() )
         pAlphaReadAcc = aAlpha.AcquireReadAccess();
 
     data = static_cast<unsigned char*>(malloc( nWidth*nHeight*4 ));
@@ -1007,7 +968,7 @@ void CanvasCairoExtractBitmapData( BitmapEx const & aBmpEx, Bitmap & aBitmap, un
     {
         bool bRet(false);
 
-        if(!rBitmapEx.IsTransparent())
+        if(!rBitmapEx.IsAlpha())
         {
             Bitmap aBitmap(rBitmapEx.GetBitmap());
 
@@ -1162,7 +1123,7 @@ bool convertBitmap32To24Plus8(BitmapEx const & rInput, BitmapEx & rResult)
             }
         }
     }
-    if (rInput.IsTransparent())
+    if (rInput.IsAlpha())
         rResult = BitmapEx(aResultBitmap, rInput.GetAlpha());
     else
         rResult = BitmapEx(aResultBitmap, aResultAlpha);
diff --git a/vcl/source/bitmap/bitmapfilter.cxx b/vcl/source/bitmap/bitmapfilter.cxx
index 70d9cdd62dc1..f2020539e04d 100644
--- a/vcl/source/bitmap/bitmapfilter.cxx
+++ b/vcl/source/bitmap/bitmapfilter.cxx
@@ -23,7 +23,7 @@ bool BitmapFilter::Filter(BitmapEx& rBmpEx, BitmapFilter const& rFilter)
 
     if (aTmpBmpEx.IsEmpty())
     {
-        SAL_WARN("vcl.gdi", "Bitmap filter failed");
+        SAL_WARN("vcl.gdi", "Bitmap filter failed " << typeid(rFilter).name());
         return false;
     }
 
diff --git a/vcl/source/bitmap/dibtools.cxx b/vcl/source/bitmap/dibtools.cxx
index f583ca0b332e..407deaeb4f9f 100644
--- a/vcl/source/bitmap/dibtools.cxx
+++ b/vcl/source/bitmap/dibtools.cxx
@@ -1737,7 +1737,7 @@ bool ReadDIBBitmapEx(
             {
                 switch (tmp)
                 {
-                case static_cast<int>(TransparentType::Bitmap):
+                case 2: // TransparentType::Bitmap
                     {
                         Bitmap aMask;
 
@@ -1845,11 +1845,11 @@ bool WriteDIBBitmapEx(
     {
         rOStm.WriteUInt32( 0x25091962 );
         rOStm.WriteUInt32( 0xACB20201 );
-        rOStm.WriteUChar( static_cast<unsigned char>(rSource.meTransparent) );
+        rOStm.WriteUChar( rSource.IsAlpha() ? 2 : 0 ); // Used to be TransparentType enum
 
-        if(TransparentType::Bitmap == rSource.meTransparent)
+        if(rSource.IsAlpha())
         {
-            return ImplWriteDIB(rSource.maMask, rOStm, true, true);
+            return ImplWriteDIB(rSource.maAlphaMask, rOStm, true, true);
         }
     }
 
diff --git a/vcl/source/control/ivctrl.cxx b/vcl/source/control/ivctrl.cxx
index 998a44888aee..c96e133a506f 100644
--- a/vcl/source/control/ivctrl.cxx
+++ b/vcl/source/control/ivctrl.cxx
@@ -343,7 +343,7 @@ void SvtIconChoiceCtrl::SetBackground( const Wallpaper& rPaper )
         Color aBack( aBackground.GetColor());
         if( aBack == COL_TRANSPARENT &&
             (!aBackground.IsBitmap() ||
-             aBackground.GetBitmap().IsTransparent() ||
+             aBackground.GetBitmap().IsAlpha() ||
              (eStyle != WallpaperStyle::Tile && eStyle != WallpaperStyle::Scale)) )
         {
             aBackground.SetColor( rStyleSettings.GetFieldColor() );
diff --git a/vcl/source/filter/egif/egif.cxx b/vcl/source/filter/egif/egif.cxx
index 79caa7db584b..660ebf95333c 100644
--- a/vcl/source/filter/egif/egif.cxx
+++ b/vcl/source/filter/egif/egif.cxx
@@ -242,7 +242,7 @@ bool GIFWriter::CreateAccess( const BitmapEx& rBmpEx )
 {
     if( bStatus )
     {
-        Bitmap aMask( rBmpEx.GetMask() );
+        Bitmap aMask( rBmpEx.GetAlpha() );
 
         aAccBmp = rBmpEx.GetBitmap();
         bTransparent = false;
diff --git a/vcl/source/filter/eps/eps.cxx b/vcl/source/filter/eps/eps.cxx
index 567512554c90..fbea39008af9 100644
--- a/vcl/source/filter/eps/eps.cxx
+++ b/vcl/source/filter/eps/eps.cxx
@@ -824,7 +824,7 @@ void PSWriter::ImplWriteActions( const GDIMetaFile& rMtf, VirtualDevice& rVDev )
                 Bitmap aBitmap( aBitmapEx.GetBitmap() );
                 if ( mbGrayScale )
                     aBitmap.Convert( BmpConversion::N8BitGreys );
-                Bitmap aMask( aBitmapEx.GetMask() );
+                Bitmap aMask( aBitmapEx.GetAlpha() );
                 Point aPoint( static_cast<const MetaBmpExAction*>(pMA)->GetPoint() );
                 Size aSize( rVDev.PixelToLogic( aBitmap.GetSizePixel() ) );
                 ImplBmp( &aBitmap, &aMask, aPoint, aSize.Width(), aSize.Height() );
@@ -837,7 +837,7 @@ void PSWriter::ImplWriteActions( const GDIMetaFile& rMtf, VirtualDevice& rVDev )
                 Bitmap aBitmap( aBitmapEx.GetBitmap() );
                 if ( mbGrayScale )
                     aBitmap.Convert( BmpConversion::N8BitGreys );
-                Bitmap aMask( aBitmapEx.GetMask() );
+                Bitmap aMask( aBitmapEx.GetAlpha() );
                 Point aPoint = static_cast<const MetaBmpExScaleAction*>(pMA)->GetPoint();
                 Size aSize( static_cast<const MetaBmpExScaleAction*>(pMA)->GetSize() );
                 ImplBmp( &aBitmap, &aMask, aPoint, aSize.Width(), aSize.Height() );
@@ -852,7 +852,7 @@ void PSWriter::ImplWriteActions( const GDIMetaFile& rMtf, VirtualDevice& rVDev )
                 Bitmap      aBitmap( aBitmapEx.GetBitmap() );
                 if ( mbGrayScale )
                     aBitmap.Convert( BmpConversion::N8BitGreys );
-                Bitmap      aMask( aBitmapEx.GetMask() );
+                Bitmap      aMask( aBitmapEx.GetAlpha() );
                 Point aPoint = static_cast<const MetaBmpExScalePartAction*>(pMA)->GetDestPoint();
                 Size aSize = static_cast<const MetaBmpExScalePartAction*>(pMA)->GetDestSize();
                 ImplBmp( &aBitmap, &aMask, aPoint, aSize.Width(), aSize.Height() );
@@ -904,7 +904,7 @@ void PSWriter::ImplWriteActions( const GDIMetaFile& rMtf, VirtualDevice& rVDev )
                 {
                     BitmapEx aBitmapEx = aWallpaper.GetBitmap();
                     Bitmap aBitmap( aBitmapEx.GetBitmap() );
-                    if ( aBitmapEx.IsTransparent() )
+                    if ( aBitmapEx.IsAlpha() )
                     {
                         if ( aWallpaper.IsGradient() )
                         {
@@ -912,7 +912,7 @@ void PSWriter::ImplWriteActions( const GDIMetaFile& rMtf, VirtualDevice& rVDev )
                         // gradient action
 
                         }
-                        Bitmap aMask( aBitmapEx.GetMask() );
+                        Bitmap aMask( aBitmapEx.GetAlpha() );
                         ImplBmp( &aBitmap, &aMask, Point( aRect.Left(), aRect.Top() ), aRect.GetWidth(), aRect.GetHeight() );
                     }
                     else
diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx
index 9de2f801c790..b6ebf1d4aace 100644
--- a/vcl/source/filter/graphicfilter.cxx
+++ b/vcl/source/filter/graphicfilter.cxx
@@ -659,8 +659,6 @@ void GraphicFilter::ImportGraphics(std::vector< std::shared_ptr<Graphic> >& rGra
                         const BitmapEx& rBitmapEx = rContext.m_pGraphic->GetBitmapExRef();
                         Bitmap& rBitmap = const_cast<Bitmap&>(rBitmapEx.GetBitmap());
                         rContext.m_pAccess = std::make_unique<BitmapScopedWriteAccess>(rBitmap);
-                        // The png reader either uses only Bitmap or Bitmap+AlphaMask.
-                        assert(rBitmapEx.IsAlpha() || !rBitmapEx.IsTransparent());
                         if(rBitmapEx.IsAlpha())
                         {
                             // The separate alpha bitmap causes a number of complications. Not only
diff --git a/vcl/source/filter/png/pngwrite.cxx b/vcl/source/filter/png/pngwrite.cxx
index 379c805f313b..0554a314e83c 100644
--- a/vcl/source/filter/png/pngwrite.cxx
+++ b/vcl/source/filter/png/pngwrite.cxx
@@ -40,7 +40,6 @@
 #define PNGCHUNK_IDAT 0x49444154
 #define PNGCHUNK_IEND 0x49454e44
 #define PNGCHUNK_pHYs 0x70485973
-#define PNGCHUNK_tRNS 0x74524e53
 
 namespace vcl
 {
@@ -83,7 +82,6 @@ private:
     void ImplWriteIDAT();
     sal_uLong ImplGetFilter(sal_uLong nY, sal_uLong nXStart = 0, sal_uLong nXAdd = 1);
     void ImplClearFirstScanline();
-    void ImplWriteTransparent();
     bool ImplWriteHeader();
     void ImplWritePalette();
     void ImplOpenChunk(sal_uLong nChunkType);
@@ -144,86 +142,39 @@ PNGWriterImpl::PNGWriterImpl(const BitmapEx& rBitmapEx,
     }
     mnBitsPerPixel = sal_uInt8(vcl::pixelFormatBitCount(aBmp.getPixelFormat()));
 
-    if (aBitmapEx.IsTransparent())
+    if (aBitmapEx.IsAlpha())
     {
-        if (mnBitsPerPixel <= 8 && aBitmapEx.IsAlpha())
+        if (mnBitsPerPixel <= 8)
         {
             aBmp.Convert(BmpConversion::N24Bit);
             mnBitsPerPixel = 24;
         }
 
-        if (mnBitsPerPixel <= 8) // transparent palette
+        mpAccess = Bitmap::ScopedReadAccess(aBmp); // true RGB with alphachannel
+        if (mpAccess)
         {
-            aBmp.Convert(BmpConversion::N8BitTrans);
-            aBmp.Replace(aBitmapEx.GetMask(), BMP_COL_TRANS);
-            mnBitsPerPixel = 8;
-            mpAccess = Bitmap::ScopedReadAccess(aBmp);
-            if (mpAccess)
+            mbTrueAlpha = true;
+            AlphaMask aMask(aBitmapEx.GetAlpha());
+            mpMaskAccess = aMask.AcquireReadAccess();
+            if (mpMaskAccess)
             {
                 if (ImplWriteHeader())
                 {
                     ImplWritepHYs(aBitmapEx);
-                    ImplWritePalette();
-                    ImplWriteTransparent();
                     ImplWriteIDAT();
                 }
-                mpAccess.reset();
+                aMask.ReleaseAccess(mpMaskAccess);
+                mpMaskAccess = nullptr;
             }
             else
             {
                 mbStatus = false;
             }
+            mpAccess.reset();
         }
         else
         {
-            mpAccess = Bitmap::ScopedReadAccess(aBmp); // true RGB with alphachannel
-            if (mpAccess)
-            {
-                mbTrueAlpha = aBitmapEx.IsAlpha();
-                if (mbTrueAlpha)
-                {
-                    AlphaMask aMask(aBitmapEx.GetAlpha());
-                    mpMaskAccess = aMask.AcquireReadAccess();
-                    if (mpMaskAccess)
-                    {
-                        if (ImplWriteHeader())
-                        {
-                            ImplWritepHYs(aBitmapEx);
-                            ImplWriteIDAT();
-                        }
-                        aMask.ReleaseAccess(mpMaskAccess);
-                        mpMaskAccess = nullptr;
-                    }
-                    else
-                    {
-                        mbStatus = false;
-                    }
-                }
-                else
-                {
-                    Bitmap aMask(aBitmapEx.GetMask());
-                    mpMaskAccess = aMask.AcquireReadAccess();
-                    if (mpMaskAccess)
-                    {
-                        if (ImplWriteHeader())
-                        {
-                            ImplWritepHYs(aBitmapEx);
-                            ImplWriteIDAT();
-                        }
-                        Bitmap::ReleaseAccess(mpMaskAccess);
-                        mpMaskAccess = nullptr;
-                    }
-                    else
-                    {
-                        mbStatus = false;
-                    }
-                }
-                mpAccess.reset();
-            }
-            else
-            {
-                mbStatus = false;
-            }
+            mbStatus = false;
         }
     }
     else
@@ -339,19 +290,6 @@ void PNGWriterImpl::ImplWritePalette()
     ImplWriteChunk(pTempBuf.get(), nCount * 3);
 }
 
-void PNGWriterImpl::ImplWriteTransparent()
-{
-    const sal_uLong nTransIndex = mpAccess->GetBestPaletteIndex(BMP_COL_TRANS);
-
-    ImplOpenChunk(PNGCHUNK_tRNS);
-
-    for (sal_uLong n = 0; n <= nTransIndex; n++)
-    {
-        ImplWriteChunk((nTransIndex == n) ? static_cast<sal_uInt8>(0x0)
-                                          : static_cast<sal_uInt8>(0xff));
-    }
-}
-
 void PNGWriterImpl::ImplWritepHYs(const BitmapEx& rBmpEx)
 {
     if (rBmpEx.GetPrefMapMode().GetMapUnit() != MapUnit::Map100thMM)
diff --git a/vcl/source/filter/wmf/emfwr.cxx b/vcl/source/filter/wmf/emfwr.cxx
index 432af89ee774..9776de87e182 100644
--- a/vcl/source/filter/wmf/emfwr.cxx
+++ b/vcl/source/filter/wmf/emfwr.cxx
@@ -1289,7 +1289,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf )
             {
                 const MetaBmpExAction*  pA = static_cast<const MetaBmpExAction *>(pAction);
                 Bitmap                  aBmp( pA->GetBitmapEx().GetBitmap() );
-                Bitmap                  aMsk( pA->GetBitmapEx().GetMask() );
+                Bitmap                  aMsk( pA->GetBitmapEx().GetAlpha() );
 
                 if( !aMsk.IsEmpty() )
                 {
@@ -1307,7 +1307,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf )
             {
                 const MetaBmpExScaleAction* pA = static_cast<const MetaBmpExScaleAction*>(pAction);
                 Bitmap                      aBmp( pA->GetBitmapEx().GetBitmap() );
-                Bitmap                      aMsk( pA->GetBitmapEx().GetMask() );
+                Bitmap                      aMsk( pA->GetBitmapEx().GetAlpha() );
 
                 if( !aMsk.IsEmpty() )
                 {
@@ -1327,7 +1327,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf )
                 BitmapEx                        aBmpEx( pA->GetBitmapEx() );
                 aBmpEx.Crop( tools::Rectangle( pA->GetSrcPoint(), pA->GetSrcSize() ) );
                 Bitmap                          aBmp( aBmpEx.GetBitmap() );
-                Bitmap                          aMsk( aBmpEx.GetMask() );
+                Bitmap                          aMsk( aBmpEx.GetAlpha() );
 
                 if( !aMsk.IsEmpty() )
                 {
diff --git a/vcl/source/filter/wmf/wmfwr.cxx b/vcl/source/filter/wmf/wmfwr.cxx
index efb1c56403ac..2fa1a0839d38 100644
--- a/vcl/source/filter/wmf/wmfwr.cxx
+++ b/vcl/source/filter/wmf/wmfwr.cxx
@@ -1245,7 +1245,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF )
             {
                 const MetaBmpExAction*  pA = static_cast<const MetaBmpExAction *>(pMA);
                 Bitmap                  aBmp( pA->GetBitmapEx().GetBitmap() );
-                Bitmap                  aMsk( pA->GetBitmapEx().GetMask() );
+                Bitmap                  aMsk( pA->GetBitmapEx().GetAlpha() );
 
                 if( !aMsk.IsEmpty() )
                 {
@@ -1263,7 +1263,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF )
             {
                 const MetaBmpExScaleAction* pA = static_cast<const MetaBmpExScaleAction*>(pMA);
                 Bitmap                      aBmp( pA->GetBitmapEx().GetBitmap() );
-                Bitmap                      aMsk( pA->GetBitmapEx().GetMask() );
+                Bitmap                      aMsk( pA->GetBitmapEx().GetAlpha() );
 
                 if( !aMsk.IsEmpty() )
                 {
@@ -1283,7 +1283,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF )
                 BitmapEx                        aBmpEx( pA->GetBitmapEx() );
                 aBmpEx.Crop( tools::Rectangle( pA->GetSrcPoint(), pA->GetSrcSize() ) );
                 Bitmap                          aBmp( aBmpEx.GetBitmap() );
-                Bitmap                          aMsk( aBmpEx.GetMask() );
+                Bitmap                          aMsk( aBmpEx.GetAlpha() );
 
                 if( !aMsk.IsEmpty() )
                 {
diff --git a/vcl/source/gdi/gdimetafiletools.cxx b/vcl/source/gdi/gdimetafiletools.cxx
index e0b96a6ba5ce..9b3e26afb331 100644
--- a/vcl/source/gdi/gdimetafiletools.cxx
+++ b/vcl/source/gdi/gdimetafiletools.cxx
@@ -171,7 +171,7 @@ namespace
         aVDev->SetFillColor( COL_WHITE);
         aVDev->SetLineColor();
 
-        if(rBitmapEx.IsTransparent())
+        if(rBitmapEx.IsAlpha())
         {
             // use given alpha channel
             aVDev->DrawBitmap(Point(0, 0), rBitmapEx.GetAlpha().GetBitmap());
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index 2856ecaed18e..a31f8e768ece 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -1780,8 +1780,6 @@ BitmapEx GDIMetaFile::ImplBmpMonoFnc( const BitmapEx& rBmpEx, const void* pBmpPa
 
     if( rBmpEx.IsAlpha() )
         return BitmapEx( aBmp, rBmpEx.GetAlpha() );
-    else if( rBmpEx.IsTransparent() )
-        return BitmapEx( aBmp, rBmpEx.GetMask() );
     else
         return BitmapEx( aBmp );
 }
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index b06423adbe3e..91f2bca31189 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -466,7 +466,7 @@ bool ImpGraphic::isTransparent() const
     }
     else if (meType == GraphicType::Bitmap && !maVectorGraphicData)
     {
-        bRet = mpAnimation ? mpAnimation->IsTransparent() : maBitmapEx.IsTransparent();
+        bRet = mpAnimation ? mpAnimation->IsTransparent() : maBitmapEx.IsAlpha();
     }
 
     return bRet;
@@ -741,7 +741,7 @@ const GDIMetaFile& ImpGraphic::getGDIMetaFile() const
 
         // #123983# directly create a metafile with the same PrefSize and PrefMapMode
         // the bitmap has, this will be an always correct metafile
-        if(maBitmapEx.IsTransparent())
+        if(maBitmapEx.IsAlpha())
         {
             pThat->maMetaFile.AddAction(new MetaBmpExScaleAction(Point(), maBitmapEx.GetPrefSize(), maBitmapEx));
         }
diff --git a/vcl/source/gdi/mtfxmldump.cxx b/vcl/source/gdi/mtfxmldump.cxx
index 373eb2b20a69..d612898e6c8c 100644
--- a/vcl/source/gdi/mtfxmldump.cxx
+++ b/vcl/source/gdi/mtfxmldump.cxx
@@ -331,14 +331,12 @@ OString convertLineStyleToString(const MetaActionType nActionType)
     return "";
 }
 
-OUString convertBitmapExTransparentType(TransparentType eType)
+OUString convertBitmapExTransparentType(BitmapEx const & rBitmapEx)
 {
-    switch (eType)
-    {
-        default:
-        case TransparentType::NONE:   return "none";
-        case TransparentType::Bitmap: return "bitmap";
-    }
+    if (rBitmapEx.IsAlpha())
+        return "bitmap";
+    else
+        return "none";
 }
 
 OUString convertMapUnitToString(MapUnit eUnit)
@@ -856,7 +854,7 @@ void MetafileXmlDump::writeXml(const GDIMetaFile& rMetaFile, tools::XmlWriter& r
                 rWriter.startElement(sCurrentElementTag);
                 writePoint(rWriter, pMeta->GetPoint());
                 rWriter.attribute("crc", hex32(pMeta->GetBitmapEx().GetBitmap().GetChecksum()));
-                rWriter.attribute("transparenttype", convertBitmapExTransparentType(pMeta->GetBitmapEx().GetTransparentType()));
+                rWriter.attribute("transparenttype", convertBitmapExTransparentType(pMeta->GetBitmapEx()));
                 rWriter.endElement();
             }
             break;
@@ -868,7 +866,7 @@ void MetafileXmlDump::writeXml(const GDIMetaFile& rMetaFile, tools::XmlWriter& r
                 writePoint(rWriter, pMeta->GetPoint());
                 writeSize(rWriter, pMeta->GetSize());

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list