vcl/source/opengl/x11/context.cxx |    2 +-
 vcl/unx/generic/app/saldisp.cxx   |    6 +-----
 vcl/unx/generic/gdi/salvd.cxx     |   14 +++++++-------
 3 files changed, 9 insertions(+), 13 deletions(-)

New commits:
commit 943814bf72181b3592e58d64ffa07358633d9ee7
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Sat Aug 16 18:19:35 2025 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Mon Aug 18 10:04:05 2025 +0200

    fix gen backend under 'make vcl.check'
    
    to test this run
      SAL_USE_VCLPLUGIN=gen make vcl.check
    
    this went wrong with
        commit 088a7c7c451321a800ca8d3523a18b6bb93239b7
        Author: Noel Grandin <noelgran...@gmail.com>
        Date:   Tue Sep 24 16:18:11 2024 +0200
        remove alpha device from OutputDevice
    
    Sadly this does not fix any of the rendering
    issues with the gen backend, because raw X11
    cannot handle alpha at all. Fixing the rendering
    issues would likely require using the XRender
    API.
    
    Change-Id: I35f35036e180d3ab76be337bc9fec0d98777ab22
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189827
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/vcl/source/opengl/x11/context.cxx 
b/vcl/source/opengl/x11/context.cxx
index 1c20d6ea1a44..b8f3c1a48803 100644
--- a/vcl/source/opengl/x11/context.cxx
+++ b/vcl/source/opengl/x11/context.cxx
@@ -136,7 +136,7 @@ private:
             GLX_GREEN_SIZE,         8,
             GLX_BLUE_SIZE,          8,
             GLX_ALPHA_SIZE,         8,
-            GLX_DEPTH_SIZE,         24,
+            GLX_DEPTH_SIZE,         32,
             GLX_X_VISUAL_TYPE,      GLX_TRUE_COLOR,
             None
         };
diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx
index f972beb46165..9b9b57444a7f 100644
--- a/vcl/unx/generic/app/saldisp.cxx
+++ b/vcl/unx/generic/app/saldisp.cxx
@@ -166,13 +166,9 @@ bool SalDisplay::BestVisual( Display     *pDisplay,
         else if( pVInfos[i].c_class == TrueColor )
         {
             nTrueColor = 2048;
-            if( pVInfos[i].depth == 24 )
+            if( pVInfos[i].depth == 32 )
                 bUsable = true;
         }
-        else if( pVInfos[i].c_class == PseudoColor )
-        {
-            bUsable = true;
-        }
         aWeights[i] = bUsable ? nTrueColor*pVInfos[i].depth : -1024;
         aWeights[i] -= pVInfos[ i ].visualid;
     }
diff --git a/vcl/unx/generic/gdi/salvd.cxx b/vcl/unx/generic/gdi/salvd.cxx
index bd9756bd44f3..fd7e08e35118 100644
--- a/vcl/unx/generic/gdi/salvd.cxx
+++ b/vcl/unx/generic/gdi/salvd.cxx
@@ -103,13 +103,13 @@ void X11SalGraphics::Init(X11SalVirtualDevice *pDevice, 
SalColormap* pColormap,
 
     if (bAlphaMaskTransparent)
     {
-        mxImpl->SetFillColor(COL_TRANSPARENT);
+        mxImpl->SetFillColor(Color(ColorAlpha, 0, 0, 0, 0));
         mxImpl->drawRect(0, 0, pDevice->GetWidth(), pDevice->GetHeight());
     }
 }
 
 X11SalVirtualDevice::X11SalVirtualDevice(const SalGraphics& rGraphics, 
tools::Long nDX, tools::Long nDY,
-                                         DeviceFormat /*eFormat*/,
+                                         DeviceFormat eFormat,
                                          std::unique_ptr<X11SalGraphics> 
pNewGraphics) :
     pGraphics_(std::move(pNewGraphics)),
     m_nXScreen(0),
@@ -118,9 +118,8 @@ X11SalVirtualDevice::X11SalVirtualDevice(const SalGraphics& 
rGraphics, tools::Lo
     SalColormap* pColormap = nullptr;
     bool bDeleteColormap = false;
 
-    sal_uInt16 nBitCount = rGraphics.GetBitCount();
+    nDepth_                 = eFormat == DeviceFormat::WITH_ALPHA ? 32 : 
rGraphics.GetBitCount();
     pDisplay_               = vcl_sal::getSalDisplay(GetGenericUnixSalData());
-    nDepth_                 = nBitCount;
 
     nDX_ = nDX;
     nDY_ = nDY;
@@ -128,12 +127,12 @@ X11SalVirtualDevice::X11SalVirtualDevice(const 
SalGraphics& rGraphics, tools::Lo
     hDrawable_ = limitXCreatePixmap( GetXDisplay(),
                                      pDisplay_->GetDrawable( m_nXScreen ),
                                      nDX_, nDY_,
-                                     GetDepth() );
+                                     nDepth_ );
     bExternPixmap_ = false;
 
-    if( nBitCount != pDisplay_->GetVisual( m_nXScreen ).GetDepth() )
+    if( nDepth_ != pDisplay_->GetVisual( m_nXScreen ).GetDepth() )
     {
-        pColormap = new SalColormap( nBitCount );
+        pColormap = new SalColormap( nDepth_ );
         bDeleteColormap = true;
     }
 
@@ -238,6 +237,7 @@ void X11SalVirtualDevice::ReleaseGraphics( SalGraphics* )
 
 bool X11SalVirtualDevice::SetSize( tools::Long nDX, tools::Long nDY, bool 
bAlphaMaskTransparent )
 {
+    assert((!bAlphaMaskTransparent || nDepth_ == 32) && "alpha requires 32-bit 
depth");
     if( bExternPixmap_ )
         return false;
 

Reply via email to