[Libreoffice-commits] .: Branch 'libreoffice-3-3-0' - vcl/unx

Thorsten Behrens thorsten at kemper.freedesktop.org
Tue Jan 18 04:13:30 PST 2011


 vcl/unx/inc/salgdi.h           |    2 +-
 vcl/unx/source/gdi/salgdi.cxx  |   17 ++++++++---------
 vcl/unx/source/gdi/salgdi3.cxx |    8 --------
 3 files changed, 9 insertions(+), 18 deletions(-)

New commits:
commit 3c2e3b6efc81c5e34c56f0f11723ed848801be35
Author: Luboš Luňák <l.lunak at suse.cz>
Date:   Tue Jan 18 13:11:00 2011 +0100

    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.
    
    Signed-off-by: Thorsten Behrens <tbehrens at novell.com>
    Signed-off-by: Radek Doulik <rodo at novell.com>
    Signed-off-by: Michael Meeks <michael.meeks at novell.com>

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;


More information about the Libreoffice-commits mailing list