summaryrefslogtreecommitdiffstats
path: root/gfx/cairo/xlib-flush-glyphs.patch
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
commit2aa4a82499d4becd2284cdb482213d541b8804dd (patch)
treeb80bf8bf13c3766139fbacc530efd0dd9d54394c /gfx/cairo/xlib-flush-glyphs.patch
parentInitial commit. (diff)
downloadfirefox-2aa4a82499d4becd2284cdb482213d541b8804dd.tar.xz
firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.zip
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gfx/cairo/xlib-flush-glyphs.patch')
-rw-r--r--gfx/cairo/xlib-flush-glyphs.patch66
1 files changed, 66 insertions, 0 deletions
diff --git a/gfx/cairo/xlib-flush-glyphs.patch b/gfx/cairo/xlib-flush-glyphs.patch
new file mode 100644
index 0000000000..78a19d0dd7
--- /dev/null
+++ b/gfx/cairo/xlib-flush-glyphs.patch
@@ -0,0 +1,66 @@
+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);
+