1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/cairo/xlib-flush-glyphs.patch Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,66 @@ 1.4 +diff --git a/gfx/cairo/cairo/src/cairo-xlib-surface.c b/gfx/cairo/cairo/src/cairo-xlib-surface.c 1.5 +index f0de3c7..e24c962 100644 1.6 +--- a/gfx/cairo/cairo/src/cairo-xlib-surface.c 1.7 ++++ b/gfx/cairo/cairo/src/cairo-xlib-surface.c 1.8 +@@ -50,35 +50,36 @@ 1.9 + #include "cairo-xlib-private.h" 1.10 + #include "cairo-xlib-surface-private.h" 1.11 + #include "cairo-clip-private.h" 1.12 + #include "cairo-error-private.h" 1.13 + #include "cairo-scaled-font-private.h" 1.14 + #include "cairo-surface-snapshot-private.h" 1.15 + #include "cairo-surface-subsurface-private.h" 1.16 + #include "cairo-region-private.h" 1.17 ++#include "cairo-xlib-xrender-private.h" 1.18 + 1.19 + #include <X11/Xutil.h> /* for XDestroyImage */ 1.20 ++#include <X11/Xlibint.h> /* for access to XDisplay's innards */ 1.21 + 1.22 + #define XLIB_COORD_MAX 32767 1.23 + 1.24 + #define DEBUG 0 1.25 + 1.26 + #if DEBUG 1.27 + #define UNSUPPORTED(reason) \ 1.28 + fprintf (stderr, \ 1.29 + "cairo-xlib: hit unsupported operation %s(), line %d: %s\n", \ 1.30 + __FUNCTION__, __LINE__, reason), \ 1.31 + CAIRO_INT_STATUS_UNSUPPORTED 1.32 + #else 1.33 + #define UNSUPPORTED(reason) CAIRO_INT_STATUS_UNSUPPORTED 1.34 + #endif 1.35 + 1.36 + #if DEBUG 1.37 +-#include <X11/Xlibint.h> 1.38 + static void CAIRO_PRINTF_FORMAT (2, 3) 1.39 + _x_bread_crumb (Display *dpy, 1.40 + const char *fmt, 1.41 + ...) 1.42 + { 1.43 + xReq *req; 1.44 + char buf[2048]; 1.45 + unsigned int len, len_dwords; 1.46 +@@ -4313,16 +4314,23 @@ _cairo_xlib_surface_add_glyph (cairo_xlib_display_t *display, 1.47 + } 1.48 + break; 1.49 + default: 1.50 + ASSERT_NOT_REACHED; 1.51 + break; 1.52 + } 1.53 + /* XXX assume X server wants pixman padding. Xft assumes this as well */ 1.54 + 1.55 ++ struct _XDisplay *dpy = (struct _XDisplay *) display->display; 1.56 ++ int req_length = sz_xRenderAddGlyphsReq + 4; 1.57 ++ if (req_length & 3) 1.58 ++ req_length += 4 - (req_length & 3); 1.59 ++ if (dpy->bufptr + req_length > dpy->bufmax) 1.60 ++ XFlush (display->display); 1.61 ++ 1.62 + XRenderAddGlyphs (display->display, glyphset_info->glyphset, 1.63 + &glyph_index, &glyph_info, 1, 1.64 + (char *) data, 1.65 + glyph_surface->stride * glyph_surface->height); 1.66 + 1.67 + if (data != glyph_surface->data) 1.68 + free (data); 1.69 +