1 diff --git a/gfx/cairo/cairo/src/cairo-xlib-surface.c b/gfx/cairo/cairo/src/cairo-xlib-surface.c
2 index f0de3c7..e24c962 100644
3 --- a/gfx/cairo/cairo/src/cairo-xlib-surface.c
4 +++ b/gfx/cairo/cairo/src/cairo-xlib-surface.c
6 #include "cairo-xlib-private.h"
7 #include "cairo-xlib-surface-private.h"
8 #include "cairo-clip-private.h"
9 #include "cairo-error-private.h"
10 #include "cairo-scaled-font-private.h"
11 #include "cairo-surface-snapshot-private.h"
12 #include "cairo-surface-subsurface-private.h"
13 #include "cairo-region-private.h"
14 +#include "cairo-xlib-xrender-private.h"
16 #include <X11/Xutil.h> /* for XDestroyImage */
17 +#include <X11/Xlibint.h> /* for access to XDisplay's innards */
19 #define XLIB_COORD_MAX 32767
24 #define UNSUPPORTED(reason) \
26 "cairo-xlib: hit unsupported operation %s(), line %d: %s\n", \
27 __FUNCTION__, __LINE__, reason), \
28 CAIRO_INT_STATUS_UNSUPPORTED
30 #define UNSUPPORTED(reason) CAIRO_INT_STATUS_UNSUPPORTED
34 -#include <X11/Xlibint.h>
35 static void CAIRO_PRINTF_FORMAT (2, 3)
36 _x_bread_crumb (Display *dpy,
42 unsigned int len, len_dwords;
43 @@ -4313,16 +4314,23 @@ _cairo_xlib_surface_add_glyph (cairo_xlib_display_t *display,
50 /* XXX assume X server wants pixman padding. Xft assumes this as well */
52 + struct _XDisplay *dpy = (struct _XDisplay *) display->display;
53 + int req_length = sz_xRenderAddGlyphsReq + 4;
55 + req_length += 4 - (req_length & 3);
56 + if (dpy->bufptr + req_length > dpy->bufmax)
57 + XFlush (display->display);
59 XRenderAddGlyphs (display->display, glyphset_info->glyphset,
60 &glyph_index, &glyph_info, 1,
62 glyph_surface->stride * glyph_surface->height);
64 if (data != glyph_surface->data)