summaryrefslogtreecommitdiff
path: root/vcl/unx/source
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2011-01-17 16:24:49 +0100
committerLuboš Luňák <l.lunak@suse.cz>2011-01-17 16:26:33 +0100
commit275ffb03d3b22005497b6267f6d9a13d85cd0d34 (patch)
tree5d0250a5649850468cafea83eb655a9ea945a86a /vcl/unx/source
parent6a1ec8a0060f7b9b352a64750e23b1a759f051b0 (diff)
do not mix unrelated X11 Visuals (fdo#33108)
Do not assume that there is just one generic Visual, as today's XServers are ARGB-capable and cases of both the default depth and 32bit visuals can happen.
Diffstat (limited to 'vcl/unx/source')
-rw-r--r--vcl/unx/source/gdi/salgdi.cxx18
-rw-r--r--vcl/unx/source/gdi/salgdi3.cxx8
2 files changed, 8 insertions, 18 deletions
diff --git a/vcl/unx/source/gdi/salgdi.cxx b/vcl/unx/source/gdi/salgdi.cxx
index c7a9afe97a70..9cbcb1b4bc5a 100644
--- a/vcl/unx/source/gdi/salgdi.cxx
+++ b/vcl/unx/source/gdi/salgdi.cxx
@@ -1017,18 +1017,9 @@ XID X11SalGraphics::GetXRenderPicture()
if( !m_aXRenderPicture )
{
// check xrender support for matching visual
- // find a XRenderPictFormat compatible with the Drawable
XRenderPictFormat* pVisualFormat = GetXRenderFormat();
if( !pVisualFormat )
- {
- Visual* pVisual = GetDisplay()->GetVisual( m_nScreen ).GetVisual();
- pVisualFormat = rRenderPeer.FindVisualFormat( pVisual );
- if( !pVisualFormat )
- return 0;
- // cache the XRenderPictFormat
- SetXRenderFormat( pVisualFormat );
- }
-
+ return 0;
// get the matching xrender target for drawable
m_aXRenderPicture = rRenderPeer.CreatePicture( hDrawable_, pVisualFormat, 0, NULL );
}
@@ -1044,6 +1035,13 @@ XID X11SalGraphics::GetXRenderPicture()
return m_aXRenderPicture;
}
+XRenderPictFormat* X11SalGraphics::GetXRenderFormat() const
+{
+ if( m_pXRenderFormat == NULL )
+ m_pXRenderFormat = XRenderPeer::GetInstance().FindVisualFormat( GetVisual().visual );
+ return m_pXRenderFormat;
+}
+
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
SystemGraphicsData X11SalGraphics::GetGraphicsData() const
diff --git a/vcl/unx/source/gdi/salgdi3.cxx b/vcl/unx/source/gdi/salgdi3.cxx
index 5903d4937ed9..aaaec1222868 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 = GetXRenderFormat();
- if( !pVisualFormat )
- {
- Visual* pVisual = GetDisplay()->GetVisual( m_nScreen ).GetVisual();
- pVisualFormat = XRenderPeer::GetInstance().FindVisualFormat( pVisual );
- // cache the XRenderPictFormat
- SetXRenderFormat( pVisualFormat );
- }
-
DBG_ASSERT( pVisualFormat!=NULL, "no matching XRenderPictFormat for text" );
if( !pVisualFormat )
return;