diff --git a/gfx/cairo/cairo/src/cairo-xlib-surface.c b/gfx/cairo/cairo/src/cairo-xlib-surface.c index f0de3c7..e24c962 100644 --- a/gfx/cairo/cairo/src/cairo-xlib-surface.c +++ b/gfx/cairo/cairo/src/cairo-xlib-surface.c @@ -50,35 +50,36 @@ #include "cairo-xlib-private.h" #include "cairo-xlib-surface-private.h" #include "cairo-clip-private.h" #include "cairo-error-private.h" #include "cairo-scaled-font-private.h" #include "cairo-surface-snapshot-private.h" #include "cairo-surface-subsurface-private.h" #include "cairo-region-private.h" +#include "cairo-xlib-xrender-private.h" #include <X11/Xutil.h> /* for XDestroyImage */ +#include <X11/Xlibint.h> /* for access to XDisplay's innards */ #define XLIB_COORD_MAX 32767 #define DEBUG 0 #if DEBUG #define UNSUPPORTED(reason) \ fprintf (stderr, \ "cairo-xlib: hit unsupported operation %s(), line %d: %s\n", \ __FUNCTION__, __LINE__, reason), \ CAIRO_INT_STATUS_UNSUPPORTED #else #define UNSUPPORTED(reason) CAIRO_INT_STATUS_UNSUPPORTED #endif #if DEBUG -#include <X11/Xlibint.h> static void CAIRO_PRINTF_FORMAT (2, 3) _x_bread_crumb (Display *dpy, const char *fmt, ...) { xReq *req; char buf[2048]; unsigned int len, len_dwords; @@ -4313,16 +4314,23 @@ _cairo_xlib_surface_add_glyph (cairo_xlib_display_t *display, } break; default: ASSERT_NOT_REACHED; break; } /* XXX assume X server wants pixman padding. Xft assumes this as well */ + struct _XDisplay *dpy = (struct _XDisplay *) display->display; + int req_length = sz_xRenderAddGlyphsReq + 4; + if (req_length & 3) + req_length += 4 - (req_length & 3); + if (dpy->bufptr + req_length > dpy->bufmax) + XFlush (display->display); + XRenderAddGlyphs (display->display, glyphset_info->glyphset, &glyph_index, &glyph_info, 1, (char *) data, glyph_surface->stride * glyph_surface->height); if (data != glyph_surface->data) free (data);