commit 358d1cbb56c32be1bc7b816281d77f099d6f8dde Author: Carl Worth Date: Mon May 22 17:51:49 2006 -0700 Move freeze/thaw of scaled_font glyph cache up to _cairo_surface_show_glyphs This is needed as things like _cairo_xlib_surface_show_glyphs depend on glyphs not disappearing from the cache during a single show_glyphs operation. Seems easiest to get this right by doing it across the entire show_glyphs operation. diff --git a/src/cairo-scaled-font.c b/src/cairo-scaled-font.c index 8fc3eeb..ff119cf 100644 --- a/src/cairo-scaled-font.c +++ b/src/cairo-scaled-font.c @@ -878,8 +878,6 @@ _cairo_scaled_font_show_glyphs (cairo_sc status = CAIRO_STATUS_SUCCESS; - _cairo_cache_freeze (scaled_font->glyphs); - for (i = 0; i < num_glyphs; i++) { int x, y; cairo_surface_pattern_t glyph_pattern; @@ -960,8 +958,6 @@ _cairo_scaled_font_show_glyphs (cairo_sc } CLEANUP_MASK: - _cairo_cache_thaw (scaled_font->glyphs); - if (mask != NULL) cairo_surface_destroy (mask); return status; diff --git a/src/cairo-surface.c b/src/cairo-surface.c index 422152f..c60a8a4 100644 --- a/src/cairo-surface.c +++ b/src/cairo-surface.c @@ -1587,6 +1587,8 @@ _cairo_surface_show_glyphs (cairo_surfac } } + _cairo_cache_freeze (scaled_font->glyphs); + if (surface->backend->show_glyphs) { status = surface->backend->show_glyphs (surface, op, &dev_source.base, dev_glyphs, num_glyphs, @@ -1600,6 +1602,8 @@ _cairo_surface_show_glyphs (cairo_surfac scaled_font); FINISH: + _cairo_cache_thaw (scaled_font->glyphs); + if (dev_glyphs != glyphs) free (dev_glyphs);