[cairo] [cairo-commit] 10 commits - configure.in src/cairo-arc.c src/cairo-pattern.c src/cairo-scaled-font.c src/cairo-scaled-font-private.h src/cairo-xlib-display.c src/cairo-xlib-private.h src/cairo-xlib-surface.c test/cairo-test.c test/degenerate-arc.c test/degenerate-arc-ps-ref.png test/degenerate-arc-ref.png test/.gitignore test/invalid-matrix.c test/Makefile.am
Behdad Esfahbod
behdad at behdad.org
Thu May 8 09:08:26 PDT 2008
On Wed, 2008-05-07 at 00:22 -0700, Chris Wilson wrote:
>
> + glyph_index = _cairo_scaled_glyph_index (scaled_glyph);
> +
> if (!glyph_surface) {
> status = _cairo_scaled_glyph_lookup (scaled_font,
> - _cairo_scaled_glyph_index
> (scaled_glyph),
> + glyph_index,
>
> CAIRO_SCALED_GLYPH_INFO_METRICS |
>
> CAIRO_SCALED_GLYPH_INFO_SURFACE,
> pscaled_glyph);
> @@ -2939,6 +2964,23 @@ _cairo_xlib_surface_add_glyph (Display *dpy,
> glyphset_info =
> _cairo_xlib_scaled_font_get_glyphset_info_for_format (scaled_font,
>
> glyph_surface->format);
>
> + /* check to see if we have a pending XRenderFreeGlyph for this
> glyph */
> + if (glyphset_info->pending_free_glyphs != NULL) {
> + cairo_xlib_font_glyphset_free_glyphs_t *to_free;
> + int i;
> +
> + to_free = glyphset_info->pending_free_glyphs;
> + for (i = 0; i < to_free->glyph_count; i++) {
> + if (to_free->glyph_indices[i] == glyph_index) {
> + to_free->glyph_count--;
> + memmove (&to_free->glyph_indices[i],
> + &to_free->glyph_indices[i+1],
> + (to_free->glyph_count - i) * sizeof
> (to_free->glyph_indices));
> + goto DONE;
> + }
> + }
> + }
Also, if you are going to skip uploading the glyph image because it's
already been there, you should avoid rendering it. That is, move the
new code block before the _cairo_scaled_glyph_lookup().
--
behdad
http://behdad.org/
"Those who would give up Essential Liberty to purchase a little
Temporary Safety, deserve neither Liberty nor Safety."
-- Benjamin Franklin, 1759
More information about the cairo
mailing list