diff --git a/doc/public/cairo-sections.txt b/doc/public/cairo-sections.txt index fba168302..d3b7319f6 100644 --- a/doc/public/cairo-sections.txt +++ b/doc/public/cairo-sections.txt @@ -408,7 +408,6 @@ cairo_set_scaled_font cairo_get_scaled_font cairo_show_text cairo_show_glyphs -cairo_has_show_text_glyphs cairo_show_text_glyphs cairo_font_extents cairo_text_extents diff --git a/doc/public/tmpl/cairo-text.sgml b/doc/public/tmpl/cairo-text.sgml index 64c63dae1..24e264b0e 100644 --- a/doc/public/tmpl/cairo-text.sgml +++ b/doc/public/tmpl/cairo-text.sgml @@ -197,15 +197,6 @@ Cairo has two sets of text rendering capabilities: @num_glyphs: - - - - - -@cr: -@Returns: - - diff --git a/src/cairo-gstate.c b/src/cairo-gstate.c index b4fb5a432..1034d4214 100644 --- a/src/cairo-gstate.c +++ b/src/cairo-gstate.c @@ -1536,12 +1536,6 @@ _cairo_gstate_glyph_extents (cairo_gstate_t *gstate, return cairo_scaled_font_status (gstate->scaled_font); } -cairo_bool_t -_cairo_gstate_has_show_text_glyphs (cairo_gstate_t *gstate) -{ - return cairo_surface_has_show_text_glyphs (gstate->target); -} - cairo_status_t _cairo_gstate_show_text_glyphs (cairo_gstate_t *gstate, const char *utf8, @@ -1600,7 +1594,7 @@ _cairo_gstate_show_text_glyphs (cairo_gstate_t *gstate, * fast rasterizer in cairo, we may want to readjust this. * * Needless to say, do this only if show_text_glyphs is not available. */ - if (_cairo_gstate_has_show_text_glyphs (gstate) || + if (cairo_surface_has_show_text_glyphs (gstate->target) || _cairo_scaled_font_get_max_scale (gstate->scaled_font) <= 10240) { status = _cairo_surface_show_text_glyphs (gstate->target, gstate->op, diff --git a/src/cairo.c b/src/cairo.c index cdfefa023..9bb2b663d 100644 --- a/src/cairo.c +++ b/src/cairo.c @@ -3079,6 +3079,7 @@ cairo_show_text (cairo_t *cr, const char *utf8) int utf8_len, num_glyphs, num_clusters; cairo_text_cluster_flags_t cluster_flags; double x, y; + cairo_bool_t has_show_text_glyphs; if (cr->status) return; @@ -3090,11 +3091,14 @@ cairo_show_text (cairo_t *cr, const char *utf8) utf8_len = strlen (utf8); + has_show_text_glyphs = + cairo_surface_has_show_text_glyphs (cairo_get_target (cr)); + status = _cairo_gstate_text_to_glyphs (cr->gstate, x, y, utf8, utf8_len, &glyphs, &num_glyphs, - cairo_has_show_text_glyphs (cr) ? &clusters : NULL, &num_clusters, + has_show_text_glyphs ? &clusters : NULL, &num_clusters, &cluster_flags); if (status) goto BAIL; @@ -3169,36 +3173,6 @@ cairo_show_glyphs (cairo_t *cr, const cairo_glyph_t *glyphs, int num_glyphs) _cairo_set_error (cr, status); } -/** - * cairo_has_show_text_glyphs: - * @cr: a cairo context - * - * Returns whether the target surface of a cairo context supports - * sophisticated cairo_show_text_glyphs() operations. That is, - * whether it actually uses the provided text and cluster data - * to a cairo_show_text_glyphs() call. - * - * Note: Even if this function returns %FALSE, a - * cairo_show_text_glyphs() operation will still succeed. It just will - * act like a cairo_show_glyphs() operation. Users can use this - * function to avoid computing UTF-8 text and cluster mapping if the - * target surface does not use it. - * - * This is a convenience function that simply calls - * cairo_surface_has_show_text_glyphs() on @cr's target. - * - * Return value: %TRUE if the target surface of @cr supports - * cairo_show_text_glyphs(), %FALSE otherwise - * - * Since: 1.8 - **/ -cairo_bool_t -cairo_has_show_text_glyphs (cairo_t *cr) -{ - return _cairo_gstate_has_show_text_glyphs (cr->gstate); -} -slim_hidden_def (cairo_has_show_text_glyphs); - /** * cairo_show_text_glyphs: * @cr: a cairo context diff --git a/src/cairo.h b/src/cairo.h index 8abf359ee..8b5044a6f 100644 --- a/src/cairo.h +++ b/src/cairo.h @@ -1209,9 +1209,6 @@ cairo_show_text (cairo_t *cr, const char *utf8); cairo_public void cairo_show_glyphs (cairo_t *cr, const cairo_glyph_t *glyphs, int num_glyphs); -cairo_public cairo_bool_t -cairo_has_show_text_glyphs (cairo_t *cr); - cairo_public void cairo_show_text_glyphs (cairo_t *cr, const char *utf8, diff --git a/src/cairoint.h b/src/cairoint.h index 85aa47c52..51d467405 100644 --- a/src/cairoint.h +++ b/src/cairoint.h @@ -1238,9 +1238,6 @@ _cairo_gstate_glyph_extents (cairo_gstate_t *gstate, int num_glyphs, cairo_text_extents_t *extents); -cairo_private cairo_bool_t -_cairo_gstate_has_show_text_glyphs (cairo_gstate_t *gstate); - cairo_private cairo_status_t _cairo_gstate_show_text_glyphs (cairo_gstate_t *gstate, const char *utf8, @@ -2389,7 +2386,6 @@ slim_hidden_proto (cairo_get_current_point); slim_hidden_proto (cairo_get_matrix); slim_hidden_proto (cairo_get_target); slim_hidden_proto (cairo_get_tolerance); -slim_hidden_proto (cairo_has_show_text_glyphs); slim_hidden_proto (cairo_glyph_allocate); slim_hidden_proto (cairo_glyph_free); slim_hidden_proto (cairo_image_surface_create);