summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-11-11 16:00:14 +0000
committerCaolán McNamara <caolanm@redhat.com>2011-11-11 16:32:40 +0000
commit75d3b1cbfd0fa54a944ce47c455b12909081bdd3 (patch)
tree17df9466468c8e86371d1bf6570b24e7cc310b82 /vcl
parent889b6a6e00994099327b9b874c93add6f88baa0a (diff)
allow capability to render text with no XRenderPictFormat
Diffstat (limited to 'vcl')
-rw-r--r--vcl/unx/generic/gdi/salgdi3.cxx22
1 files changed, 17 insertions, 5 deletions
diff --git a/vcl/unx/generic/gdi/salgdi3.cxx b/vcl/unx/generic/gdi/salgdi3.cxx
index 9d2cb4bfcc09..66a316bb5005 100644
--- a/vcl/unx/generic/gdi/salgdi3.cxx
+++ b/vcl/unx/generic/gdi/salgdi3.cxx
@@ -84,6 +84,7 @@
#include <cairo.h>
#include <cairo-ft.h>
+#include <cairo-xlib.h>
#include <cairo-xlib-xrender.h>
struct BOX
@@ -321,14 +322,25 @@ void X11SalGraphics::DrawServerFontLayout( const ServerFontLayout& rLayout )
// find a XRenderPictFormat compatible with the Drawable
XRenderPictFormat* pVisualFormat = GetXRenderFormat();
- DBG_ASSERT( pVisualFormat!=NULL, "no matching XRenderPictFormat for text" );
- if( !pVisualFormat )
- return;
Display* pDisplay = GetXDisplay();
- cairo_surface_t *surface = cairo_xlib_surface_create_with_xrender_format (pDisplay,
- hDrawable_, ScreenOfDisplay(pDisplay, m_nScreen), pVisualFormat, SAL_MAX_INT16, SAL_MAX_INT16);
+ cairo_surface_t *surface;
+
+ if (pVisualFormat)
+ {
+ surface = cairo_xlib_surface_create_with_xrender_format (pDisplay, hDrawable_,
+ ScreenOfDisplay(pDisplay, m_nScreen), pVisualFormat, SAL_MAX_INT16, SAL_MAX_INT16);
+ }
+ else
+ {
+ surface = cairo_xlib_surface_create(pDisplay, hDrawable_,
+ GetVisual().visual, SAL_MAX_INT16, SAL_MAX_INT16);
+ }
+
+ DBG_ASSERT( surface!=NULL, "no cairo surface for text" );
+ if( !surface )
+ return;
/*
* It might be ideal to cache surface and cairo context between calls and