mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-04-20 14:10:46 +02:00
[cairo-xlib] Upon seeing glyphs with large position, just let fallback handle
This now fixes the large-font test for xlib again.
This commit is contained in:
parent
e55252bd3b
commit
c20072c881
1 changed files with 12 additions and 21 deletions
|
|
@ -3165,8 +3165,6 @@ typedef struct {
|
|||
/* compile-time assert that #cairo_xlib_glyph_t is the same size as #cairo_glyph_t */
|
||||
typedef int cairo_xlib_glyph_t_size_assertion [sizeof (cairo_xlib_glyph_t) == sizeof (cairo_glyph_t) ? 1 : -1];
|
||||
|
||||
#define GLYPH_INDEX_SKIP ((unsigned long) -1)
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_xlib_surface_emit_glyphs_chunk (cairo_xlib_surface_t *dst,
|
||||
cairo_xlib_glyph_t *glyphs,
|
||||
|
|
@ -3229,10 +3227,6 @@ _cairo_xlib_surface_emit_glyphs_chunk (cairo_xlib_surface_t *dst,
|
|||
j = 0;
|
||||
for (i = 0; i < num_glyphs; i++) {
|
||||
|
||||
/* Skip glyphs marked so */
|
||||
if (glyphs[i].index == GLYPH_INDEX_SKIP)
|
||||
continue;
|
||||
|
||||
/* Start a new element for first output glyph, and for glyphs with
|
||||
* unexpected position */
|
||||
if (!j || glyphs[i].p.i.x || glyphs[i].p.i.y) {
|
||||
|
|
@ -3339,11 +3333,12 @@ _cairo_xlib_surface_emit_glyphs (cairo_xlib_surface_t *dst,
|
|||
* may start off the screen but part of it make it to the screen.
|
||||
* Anyway, we will allow positions in the range -4096..122887. That
|
||||
* will buy us a few more years before this stops working.
|
||||
*
|
||||
* Update: upon seeing weird glyphs, we just return and let fallback
|
||||
* code do the job.
|
||||
*/
|
||||
if (((this_x+4096)|(this_y+4096))&~0x3fffu) {
|
||||
glyphs[i].index = GLYPH_INDEX_SKIP;
|
||||
continue;
|
||||
}
|
||||
if (((this_x+4096)|(this_y+4096))&~0x3fffu)
|
||||
break;
|
||||
|
||||
/* Send unsent glyphs to the server */
|
||||
if (_cairo_xlib_scaled_glyph_get_glyphset_info (scaled_glyph) == NULL) {
|
||||
|
|
@ -3428,22 +3423,18 @@ _cairo_xlib_surface_emit_glyphs (cairo_xlib_surface_t *dst,
|
|||
request_size += width;
|
||||
}
|
||||
|
||||
if (num_elts) {
|
||||
/* status may be UNSUPPORTED. Shouldn't override that to SUCCESS */
|
||||
cairo_status_t status2;
|
||||
status2 = _cairo_xlib_surface_emit_glyphs_chunk (dst, glyphs, num_glyphs,
|
||||
scaled_font, op, src, attributes,
|
||||
num_elts, width, glyphset_info);
|
||||
if (status2 != CAIRO_STATUS_SUCCESS)
|
||||
status = status2;
|
||||
}
|
||||
if (num_elts)
|
||||
status = _cairo_xlib_surface_emit_glyphs_chunk (dst, glyphs, num_glyphs,
|
||||
scaled_font, op, src, attributes,
|
||||
num_elts, width, glyphset_info);
|
||||
|
||||
*remaining_glyphs = num_glyphs - i;
|
||||
if (*remaining_glyphs && status == CAIRO_STATUS_SUCCESS)
|
||||
status = CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
#undef GLYPH_INDEX_SKIP
|
||||
|
||||
static cairo_int_status_t
|
||||
_cairo_xlib_surface_show_glyphs (void *abstract_dst,
|
||||
cairo_operator_t op,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue