Implement show_text_glyphs instead of show_glyphs in SVG backend

Signed-off-by: Raman Varabets <gitlab-20240601-da2ef10c@cyborgize.sg>
This commit is contained in:
Raman Varabets 2024-06-03 10:47:51 +08:00
parent da46b016b8
commit 74b0f6a3f6
2 changed files with 21 additions and 23 deletions

View file

@ -2863,19 +2863,6 @@ composite_color_glyphs (cairo_surface_t *surface,
continue;
}
cairo_bool_t supports_color_glyph = FALSE;
if (surface->backend->supports_color_glyph) {
_cairo_scaled_font_thaw_cache (scaled_font);
supports_color_glyph = _cairo_surface_supports_color_glyph (surface, scaled_font, glyphs[glyph_pos].index);
_cairo_scaled_font_freeze_cache (scaled_font);
}
if (supports_color_glyph) {
glyphs[remaining_glyphs++] = glyphs[glyph_pos];
continue;
}
status = composite_one_color_glyph (surface, op, source, clip,
&glyphs[glyph_pos], scaled_glyph,
x_scale, y_scale);

View file

@ -4183,14 +4183,25 @@ _cairo_svg_surface_show_glyphs_impl (cairo_svg_stream_t *output,
return status;
}
static cairo_bool_t
_cairo_svg_surface_has_show_text_glyphs (void *abstract_surface)
{
return TRUE;
}
static cairo_int_status_t
_cairo_svg_surface_show_glyphs (void *abstract_surface,
cairo_operator_t op,
const cairo_pattern_t *source,
cairo_glyph_t *glyphs,
int num_glyphs,
cairo_scaled_font_t *scaled_font,
const cairo_clip_t *clip)
_cairo_svg_surface_show_text_glyphs (void *abstract_surface,
cairo_operator_t op,
const cairo_pattern_t *source,
const char *utf8,
int utf8_len,
cairo_glyph_t *glyphs,
int num_glyphs,
const cairo_text_cluster_t *clusters,
int num_clusters,
cairo_text_cluster_flags_t cluster_flags,
cairo_scaled_font_t *scaled_font,
const cairo_clip_t *clip)
{
cairo_svg_surface_t *surface = abstract_surface;
cairo_int_status_t status;
@ -4314,9 +4325,9 @@ static const cairo_surface_backend_t cairo_svg_surface_backend = {
_cairo_svg_surface_stroke,
_cairo_svg_surface_fill,
_cairo_svg_surface_fill_stroke,
_cairo_svg_surface_show_glyphs,
NULL, /* has_show_text_glyphs */
NULL, /* show_text_glyphs */
NULL, /* show_glyphs */
_cairo_svg_surface_has_show_text_glyphs,
_cairo_svg_surface_show_text_glyphs,
_cairo_svg_surface_get_supported_mime_types,
NULL, /* tag */
_cairo_svg_surface_supports_color_glyph,