Hi, Lubos fixed an ugly crasher in vcl via fdo#33108 - I've stripped the patch down to the absolute minimum, and would be ok for taking that for -3-3-0 - any further reviews, please? Cheers, -- Thorsten
diff --git a/vcl/unx/inc/salgdi.h b/vcl/unx/inc/salgdi.h
index ef7cf8c..e47c24a 100644
--- a/vcl/unx/inc/salgdi.h
+++ b/vcl/unx/inc/salgdi.h
@@ -221,7 +221,7 @@ public:
inline Drawable GetDrawable() const { return hDrawable_; }
void SetDrawable( Drawable d, int nScreen );
XID GetXRenderPicture();
- void* GetXRenderFormat() const { return m_pRenderFormat; }
+ void* GetXRenderFormat() const;
inline void SetXRenderFormat( void* pRenderFormat ) { m_pRenderFormat =
pRenderFormat; }
inline const SalColormap& GetColormap() const { return *m_pColormap; }
using SalGraphics::GetPixel;
diff --git a/vcl/unx/source/gdi/salgdi.cxx b/vcl/unx/source/gdi/salgdi.cxx
index 4746e94..2c275ca 100644
--- a/vcl/unx/source/gdi/salgdi.cxx
+++ b/vcl/unx/source/gdi/salgdi.cxx
@@ -1024,17 +1024,9 @@ XID X11SalGraphics::GetXRenderPicture()
if( !m_aRenderPicture )
{
// check xrender support for matching visual
- // find a XRenderPictFormat compatible with the Drawable
XRenderPictFormat* pVisualFormat = static_cast<XRenderPictFormat*>(GetXRenderFormat());
if( !pVisualFormat )
- {
- Visual* pVisual = GetDisplay()->GetVisual( m_nScreen ).GetVisual();
- pVisualFormat = rRenderPeer.FindVisualFormat( pVisual );
- if( !pVisualFormat )
- return 0;
- // cache the XRenderPictFormat
- SetXRenderFormat( static_cast<void*>(pVisualFormat) );
- }
+ return 0;
// get the matching xrender target for drawable
m_aRenderPicture = rRenderPeer.CreatePicture( hDrawable_, pVisualFormat, 0, NULL );
@@ -1051,6 +1043,13 @@ XID X11SalGraphics::GetXRenderPicture()
return m_aRenderPicture;
}
+void* X11SalGraphics::GetXRenderFormat() const
+{
+ if( m_pRenderFormat == NULL )
+ const_cast<X11SalGraphics*>(this)->m_pRenderFormat =
XRenderPeer::GetInstance().FindVisualFormat( GetVisual().visual );
+ return m_pRenderFormat;
+}
+
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
SystemGraphicsData X11SalGraphics::GetGraphicsData() const
diff --git a/vcl/unx/source/gdi/salgdi3.cxx b/vcl/unx/source/gdi/salgdi3.cxx
index 02d9491..d4300a2 100644
--- a/vcl/unx/source/gdi/salgdi3.cxx
+++ b/vcl/unx/source/gdi/salgdi3.cxx
@@ -986,14 +986,6 @@ void X11SalGraphics::DrawCairoAAFontString( const ServerFontLayout& rLayout )
// find a XRenderPictFormat compatible with the Drawable
XRenderPictFormat* pVisualFormat = static_cast<XRenderPictFormat*>(GetXRenderFormat());
- if( !pVisualFormat )
- {
- Visual* pVisual = GetDisplay()->GetVisual( m_nScreen ).GetVisual();
- pVisualFormat = XRenderPeer::GetInstance().FindVisualFormat( pVisual );
- // cache the XRenderPictFormat
- SetXRenderFormat( static_cast<void*>(pVisualFormat) );
- }
-
DBG_ASSERT( pVisualFormat!=NULL, "no matching XRenderPictFormat for text" );
if( !pVisualFormat )
return;
Attachment:
pgpvGRKDaDIOV.pgp
Description: PGP signature